Skip to content

Commit

Permalink
Add Link to the project treeview.
Browse files Browse the repository at this point in the history
Issue #15
  • Loading branch information
steffen-wilke committed Jan 27, 2020
1 parent c1b47bb commit 1f647af
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,16 @@
<TextBlock Margin="10,0,0,0"
Focusable="False"
Text="{Binding Name}" />
<TextBlock Margin="5,0,0,0">
<Hyperlink
NavigateUri="{Binding Address}"
RequestNavigate="HyperlinkRequestNavigate"
Style="{StaticResource MaterialDesignHeadline4Hyperlink}">
<TextBlock>
<materialDesign:PackIcon Kind="Link" Width="14"/>
</TextBlock>
</Hyperlink>
</TextBlock>
</StackPanel>
<StackPanel DockPanel.Dock="Right"
Opacity="0.5"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,10 @@

namespace Soloplan.WhatsON.GUI.Configuration.Wizard
{
using System.Diagnostics;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Navigation;

/// <summary>
/// Interaction logic for ProjectsTreeView.xaml.
Expand Down Expand Up @@ -50,5 +52,16 @@ private void TreeViewItemPreviewKeyUp(object sender, System.Windows.Input.KeyEve
}
}
}

/// <summary>
/// Handles the hyperlink requiest event of elements in the TreeViewItem control.
/// </summary>
/// <param name="sender">The source of the event.</param>
/// <param name="e">The <see cref="RequestNavigateEventArgs"/> instance containing the event data.</param>
private void HyperlinkRequestNavigate(object sender, RequestNavigateEventArgs e)
{
Process.Start(new ProcessStartInfo(e.Uri.AbsoluteUri));
e.Handled = true;
}
}
}

0 comments on commit 1f647af

Please sign in to comment.