Loading files
<UserControl x:Class="IDE.Documents.Views.RecentFilesView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:cmd="clr-namespace:IDE.Core.Commands;assembly=IDE.Core.Presentation"
xmlns:ctrls="clr-namespace:IDE.Controls"
xmlns:conv="clr-namespace:IDE.Core.Converters"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:utils="clr-namespace:IDE.Core.Utilities"
xmlns:resources="clr-namespace:IDE.Resources.Local;assembly=IDE.Resources"
mc:Ignorable="d"
d:DesignHeight="300"
d:DesignWidth="300">
<UserControl.Resources>
<ResourceDictionary>
<utils:BindingProxy x:Key="modelProxy"
Data="{Binding RecentFilesViewModel}" />
</ResourceDictionary>
</UserControl.Resources>
<Grid>
<Grid Background="{DynamicResource ToolViewBackground}">
<Grid.Resources>
<Style TargetType="{x:Type ctrls:FileHyperlink}">
<Setter Property="SnapsToDevicePixels"
Value="True" />
<Setter Property="ContextMenu">
<Setter.Value>
<ContextMenu>
<MenuItem Header="{x:Static resources:Strings.CopyPathToClipboard}"
Command="{x:Static ctrls:FileHyperlink.CopyUri}"
CommandTarget="{Binding PlacementTarget, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type ContextMenu}}}"
Margin="3" />
<MenuItem Header="{x:Static resources:Strings.OpenFolderInFileExplorer}"
Command="{x:Static ctrls:FileHyperlink.OpenContainingFolder}"
CommandTarget="{Binding PlacementTarget, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type ContextMenu}}}"
Margin="3" />
<Separator />
<MenuItem Header="{x:Static resources:Strings.Remove}"
Command="{Binding Data.RemoveEntryCommand, Source={StaticResource modelProxy}}"
CommandParameter="{Binding}"
CommandTarget="{Binding PlacementTarget, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type ContextMenu}}}"
Margin="3" />
</ContextMenu>
</Setter.Value>
</Setter>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type ctrls:FileHyperlink}">
<TextBlock ToolTip="{Binding ElementName=PART_Hyperlink, Path=NavigateUri}"
HorizontalAlignment="Stretch">
<TextBlock.InputBindings>
<KeyBinding Key="C"
Modifiers="Ctrl"
Command="{x:Static ctrls:FileHyperlink.CopyUri}"
CommandParameter="{Binding ElementName=PART_Hyperlink, Path=NavigateUri}" />
</TextBlock.InputBindings>
<Hyperlink Name="PART_Hyperlink"
NavigateUri="{Binding Path=NavigateUri, RelativeSource={RelativeSource FindAncestor, AncestorType=ctrls:FileHyperlink, AncestorLevel=1}}"
Command="cmd:AppCommand.LoadFile"
CommandParameter="{Binding Path=NavigateUri, RelativeSource={RelativeSource FindAncestor, AncestorType=ctrls:FileHyperlink, AncestorLevel=1}}">
<Hyperlink.Style>
<!-- Change resource to show underline on mouseover only -->
<Style TargetType="{x:Type Hyperlink}">
<Style.Triggers>
<Trigger Property="IsMouseOver"
Value="true">
<Setter Property="TextDecorations"
Value="Underline" />
<Setter Property="Foreground"
Value="{DynamicResource HyperlinkForeground}" />
</Trigger>
<Trigger Property="IsEnabled"
Value="false">
<Setter Property="Foreground"
Value="{DynamicResource HyperlinkForegroundDisabled}" />
</Trigger>
<Trigger Property="IsEnabled"
Value="true">
<Setter Property="Cursor"
Value="Hand" />
</Trigger>
</Style.Triggers>
<Setter Property="TextBlock.TextDecorations"
Value="{x:Null}" />
<Setter Property="Foreground"
Value="{DynamicResource HyperlinkForeground}" />
</Style>
</Hyperlink.Style>
<!-- Moved link to event handler RequestNavigate="Hyperlink_RequestNavigate" to code behind -->
<!-- TextBlock Text="{Binding Path=Text, RelativeSource={RelativeSource FindAncestor, AncestorType=hyperl:FileHyperlink, AncestorLevel=1}}" / -->
<ctrls:PathTrimmingTextBlock Path="{Binding Text, RelativeSource={RelativeSource FindAncestor, AncestorType=ctrls:FileHyperlink, AncestorLevel=1}}" />
</Hyperlink>
</TextBlock>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</Grid.Resources>
<Grid.RowDefinitions>
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<ctrls:PinableListView Margin="0"
AllowDrop="False"
SelectionMode="Single"
HorizontalAlignment="Stretch"
VerticalAlignment="Stretch"
SnapsToDevicePixels="True"
HorizontalContentAlignment="Stretch"
BorderThickness="0"
ItemsSource="{Binding Data.MruList, Source={StaticResource modelProxy}}"
ctrls:ListViewColumns.Stretch="true"
Background="Transparent"
ScrollViewer.HorizontalScrollBarVisibility="Hidden"
Grid.Row="1">
<ctrls:PinableListView.View>
<GridView>
<GridView.ColumnHeaderContainerStyle>
<!-- To hide the header of a ListView you can modify the Visibility property of the ColumnHeaderContainer by overriding the style. -->
<Style>
<Setter Property="FrameworkElement.Visibility"
Value="Collapsed" />
</Style>
</GridView.ColumnHeaderContainerStyle>
<GridViewColumn Width="32">
<GridViewColumn.CellTemplate>
<DataTemplate>
<Grid>
<!-- Pin/Unpin column -->
<ctrls:PinnableCheckbox Command="{Binding Data.TogglePinnedForEntryCommand, Source={StaticResource modelProxy}}"
CommandParameter="{Binding}"
IsChecked="{Binding IsPinned, Mode=OneWay}">
<CheckBox.Visibility>
<MultiBinding Converter="{conv:BoolOrToVisibilityConverter}">
<Binding Path="IsMouseOverListViewItem"
RelativeSource="{RelativeSource AncestorType={x:Type ctrls:PinableListViewItem}}" />
<Binding Path="IsChecked"
RelativeSource="{RelativeSource Self}" />
</MultiBinding>
</CheckBox.Visibility>
</ctrls:PinnableCheckbox>
</Grid>
</DataTemplate>
</GridViewColumn.CellTemplate>
</GridViewColumn>
<GridViewColumn>
<GridViewColumn.CellTemplate>
<DataTemplate>
<Grid>
<ctrls:FileHyperlink Text="{Binding FileName, Mode=OneWay}"
Margin="3,3,16,3"
NavigateUri="{Binding PathFileName, Mode=OneWay}"
HorizontalAlignment="Stretch"
VerticalAlignment="Center" />
</Grid>
</DataTemplate>
</GridViewColumn.CellTemplate>
</GridViewColumn>
</GridView>
</ctrls:PinableListView.View>
</ctrls:PinableListView>
</Grid>
</Grid>
</UserControl>
366e28f22This file is pinned to the selected release. Download the original to open it in your design tool.