123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389 |
- <UserControl
- x:Class="PDF_Office.Views.HomePanel.RecentFiles.RecentFilesContent"
- xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
- xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
- xmlns:DataConvert="clr-namespace:PDF_Office.DataConvert"
- xmlns:customControl="clr-namespace:PDF_Office.CustomControl"
- xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
- xmlns:i="http://schemas.microsoft.com/xaml/behaviors"
- xmlns:local="clr-namespace:PDF_Office.Views.HomePanel.RecentFiles"
- xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
- xmlns:prism="http://prismlibrary.com/"
- d:DesignHeight="450"
- d:DesignWidth="800"
- prism:ViewModelLocator.AutoWireViewModel="True"
- Loaded="UserControl_Loaded"
- mc:Ignorable="d">
- <UserControl.Resources>
- <ResourceDictionary>
- <ResourceDictionary.MergedDictionaries>
- <ResourceDictionary Source="../../../Styles/ListViewStyle.xaml" />
- <ResourceDictionary Source="../../../Styles/CustomBtnStyle.xaml" />
- <ResourceDictionary Source="../../../Styles/RadioButtonStyle.xaml" />
- <ResourceDictionary Source="../../../Styles/ButtonStyle.xaml" />
- </ResourceDictionary.MergedDictionaries>
- <DataConvert:BoolToVisible x:Key="BoolToVisible" />
- <DataConvert:InvertBoolToVisibleConvert x:Key="InvertBoolToVisibleConvert" />
- <DataConvert:InvertBoolConvert x:Key="InvertBoolConvert" />
- <DataTemplate x:Key="listviewItem">
- <local:DocItemListViewControl
- HorizontalAlignment="Stretch"
- DeleteItemHandler="DocItemListViewControl_DeleteItemHandler"
- OpenFileItemHandler="DocItemListViewControl_OpenFileItemHandler" />
- </DataTemplate>
- <DataTemplate x:Key="gridviewItem">
- <local:DocItemControl HorizontalAlignment="Stretch" />
- </DataTemplate>
- <ItemsPanelTemplate x:Key="listPanel">
- <StackPanel Orientation="Vertical" />
- </ItemsPanelTemplate>
- <ItemsPanelTemplate x:Key="gridPanel">
- <WrapPanel />
- </ItemsPanelTemplate>
- <ContextMenu
- x:Key="FlyoutMenu"
- FontSize="14"
- Opened="ContextMenu_Opened">
- <ContextMenu.ItemContainerStyle>
- <Style TargetType="MenuItem">
- <Setter Property="Padding" Value="0,7,0,7" />
- <Setter Property="VerticalContentAlignment" Value="Center" />
- </Style>
- </ContextMenu.ItemContainerStyle>
- <MenuItem
- Name="FilePathMenuItem"
- Click="FilePathMenuItem_Click"
- Header="打开文件路径"
- IsEnabled="True">
- <MenuItem.Icon>
- <Path Data="M5.24031 1.5H0.5V14.5H15.5V4H7.24031L5.24031 1.5ZM1.5 13.5V2.5H4.75969L6.75969 5H14.5V13.5H1.5ZM4 7.5H12V6.5H4V7.5Z" Fill="Black">
- <Path.RenderTransform>
- <TranslateTransform X="3.0000" Y="0" />
- </Path.RenderTransform>
- </Path>
- </MenuItem.Icon>
- </MenuItem>
- <MenuItem
- Name="DeleteMenuItem"
- Click="DeleteMenuItem_Click"
- Header="从最近列表删除"
- IsEnabled="True">
- <MenuItem.Icon>
- <Path Data="M9 0H3V2H0V3H1V14H11V3H12V2H9V0ZM2 13V3H3H4H8H9H10V13H2ZM8 2V1H4V2H8ZM4 12V4H3V12H4ZM6.5 4V12H5.5V4H6.5ZM9 12V4H8V12H9Z" Fill="Black">
- <Path.RenderTransform>
- <TranslateTransform X="5.0000" Y="0" />
- </Path.RenderTransform>
- </Path>
- </MenuItem.Icon>
- </MenuItem>
- </ContextMenu>
- <Style
- x:Key="SubFilesListViewItemStyle"
- BasedOn="{StaticResource FilesListViewItemStyle}"
- TargetType="{x:Type ListViewItem}">
- <Setter Property="ContextMenu" Value="{StaticResource FlyoutMenu}" />
- <Setter Property="HorizontalContentAlignment" Value="Center" />
- <Setter Property="Margin" Value="0,0,0,0" />
- <EventSetter Event="PreviewMouseRightButtonDown" Handler="ListViewItem_PreviewMouseRightButtonDown" />
- <EventSetter Event="PreviewMouseDoubleClick" Handler="RecentFilesList_PreviewMouseDoubleClick" />
- </Style>
- <Style
- x:Key="HomeGridViewItemStyle"
- BasedOn="{StaticResource FilesGridItemStyle}"
- TargetType="{x:Type ListViewItem}">
- <Setter Property="ContextMenu" Value="{StaticResource FlyoutMenu}" />
- <Setter Property="HorizontalContentAlignment" Value="Center" />
- <EventSetter Event="PreviewMouseRightButtonDown" Handler="ListViewItem_PreviewMouseRightButtonDown" />
- <EventSetter Event="PreviewMouseDoubleClick" Handler="RecentFilesList_PreviewMouseDoubleClick" />
- </Style>
- </ResourceDictionary>
- </UserControl.Resources>
- <Grid>
- <Grid>
- <Grid.RowDefinitions>
- <RowDefinition Height="Auto" />
- <RowDefinition Height="Auto" />
- <RowDefinition />
- </Grid.RowDefinitions>
- <Grid x:Name="GridRecentFilesTile" Margin="32,38,0,13">
- <TextBlock
- x:Name="TxbRecentlyTile"
- Margin="0,0,0,0"
- Padding="0,6,0,0"
- HorizontalAlignment="Left"
- FontSize="20"
- FontWeight="Semibold"
- Text="Recent" />
- <StackPanel
- x:Name="PnlRightBtns"
- Grid.Column="0"
- Grid.ColumnSpan="2"
- Margin="0,0,0,0"
- HorizontalAlignment="Right"
- Orientation="Horizontal">
- <Border
- Height="30"
- Padding="1,0,1,0"
- Background="#EEF2F3"
- CornerRadius="4">
- <StackPanel Orientation="Horizontal">
- <RadioButton
- x:Name="BtnListMode"
- Width="40"
- Height="28"
- HorizontalContentAlignment="Center"
- VerticalContentAlignment="Center"
- Foreground="#333333"
- GroupName="Mode"
- IsChecked="{Binding IsListMode, Mode=OneTime}"
- Style="{StaticResource ListModeRadioBtnStyle}"
- Tag="ListMode">
- <Grid Margin="-5,0,0,0" HorizontalAlignment="Center">
- <Path
- Data="M3 5L17 5"
- Stroke="{Binding ElementName=BtnListMode, Path=Foreground}"
- StrokeStartLineCap="Round"
- StrokeThickness="1.5" />
- <Path
- Data="M3 10H17"
- Stroke="{Binding ElementName=BtnListMode, Path=Foreground}"
- StrokeStartLineCap="Round"
- StrokeThickness="1.5" />
- <Path
- Data="M3 15H17"
- Stroke="{Binding ElementName=BtnListMode, Path=Foreground}"
- StrokeStartLineCap="Round"
- StrokeThickness="1.5" />
- </Grid>
- <i:Interaction.Triggers>
- <i:EventTrigger EventName="Checked">
- <i:InvokeCommandAction Command="{Binding ListModeCheckedCommand}" CommandParameter="{Binding ElementName=BtnListMode, Path=Tag}" />
- </i:EventTrigger>
- </i:Interaction.Triggers>
- </RadioButton>
- <RadioButton
- x:Name="BtnGridMode"
- Width="40"
- Height="28"
- HorizontalContentAlignment="Center"
- VerticalContentAlignment="Center"
- Foreground="#6B869C"
- GroupName="Mode"
- IsChecked="{Binding IsListMode, Converter={StaticResource InvertBoolConvert}, Mode=OneTime}"
- Style="{StaticResource ListModeRadioBtnStyle}"
- Tag="GridMode">
- <Grid Margin="-5,0,0,0" HorizontalAlignment="Center">
- <Grid.RowDefinitions>
- <RowDefinition />
- <RowDefinition />
- </Grid.RowDefinitions>
- <Grid.ColumnDefinitions>
- <ColumnDefinition />
- <ColumnDefinition />
- </Grid.ColumnDefinitions>
- <Rectangle
- Grid.Row="0"
- Grid.Column="0"
- Width="5"
- Height="5"
- Margin="1"
- Stroke="{Binding ElementName=BtnGridMode, Path=Foreground}"
- StrokeDashCap="Round"
- StrokeThickness="1.5" />
- <Rectangle
- Grid.Row="0"
- Grid.Column="1"
- Width="5"
- Height="5"
- Margin="1"
- Stroke="{Binding ElementName=BtnGridMode, Path=Foreground}"
- StrokeDashCap="Round"
- StrokeThickness="1.5" />
- <Rectangle
- Grid.Row="1"
- Grid.Column="0"
- Width="5"
- Height="5"
- Margin="1"
- Stroke="{Binding ElementName=BtnGridMode, Path=Foreground}"
- StrokeDashCap="Round"
- StrokeThickness="1.5" />
- <Rectangle
- Grid.Row="1"
- Grid.Column="1"
- Width="5"
- Height="5"
- Margin="1"
- Stroke="{Binding ElementName=BtnGridMode, Path=Foreground}"
- StrokeDashCap="Round"
- StrokeThickness="1.5" />
- </Grid>
- <i:Interaction.Triggers>
- <i:EventTrigger EventName="Checked">
- <i:InvokeCommandAction Command="{Binding ListModeCheckedCommand}" CommandParameter="{Binding ElementName=BtnGridMode, Path=Tag}" />
- </i:EventTrigger>
- </i:Interaction.Triggers>
- </RadioButton>
- </StackPanel>
- </Border>
- <Separator
- Width="1"
- Height="16"
- Margin="1,0,1,0"
- BorderBrush="#1A000000"
- BorderThickness="1" />
- <Button
- x:Name="BtnDelete"
- Width="28"
- Height="28"
- MaxHeight="40"
- Margin="0"
- Padding="0,0,0,0"
- Background="Transparent"
- BorderThickness="0"
- Command="{Binding RemoveFilesFromContainerCommand}"
- CommandParameter="{Binding ElementName=RecentFilesList, Path=SelectedItems}"
- Foreground="#6B6F7D"
- IsEnabled="{Binding IsEmpty, Converter={StaticResource InvertBoolConvert}, Mode=OneWay}"
- Style="{StaticResource OnlyContentBtn}">
- <Grid Width="20" Height="20">
- <Path
- Data="M8 2H12"
- Stroke="{Binding ElementName=BtnDelete, Path=Foreground}"
- StrokeDashCap="Round"
- StrokeThickness="2" />
- <Path
- Data="M5 5V17H15V5"
- Stroke="{Binding ElementName=BtnDelete, Path=Foreground}"
- StrokeDashCap="Round"
- StrokeThickness="2" />
- <Path
- Data="M17 5H3"
- Stroke="{Binding ElementName=BtnDelete, Path=Foreground}"
- StrokeDashCap="Round"
- StrokeThickness="2" />
- <Path
- Data="M10 9V13"
- Stroke="{Binding ElementName=BtnDelete, Path=Foreground}"
- StrokeDashCap="Round"
- StrokeThickness="2" />
- </Grid>
- </Button>
- </StackPanel>
- </Grid>
- <Grid Grid.Row="2" Visibility="{Binding IsEmpty, Converter={StaticResource InvertBoolToVisibleConvert}}">
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="799*" />
- <ColumnDefinition Width="*" />
- </Grid.ColumnDefinitions>
- <Border Visibility="{Binding IsListMode, Converter={StaticResource BoolToVisible}}">
- <ListView
- x:Name="RecentFilesList"
- Grid.ColumnSpan="2"
- MinWidth="380"
- MinHeight="216"
- Margin="32,0,0,0"
- Padding="0,0,0,0"
- Background="Transparent"
- BorderThickness="0"
- ItemContainerStyle="{StaticResource SubFilesListViewItemStyle}"
- ItemTemplate="{StaticResource listviewItem}"
- ItemsPanel="{StaticResource listPanel}"
- ItemsSource="{Binding RecentFilesGroup}"
- ScrollViewer.HorizontalScrollBarVisibility="Disabled"
- ScrollViewer.VerticalScrollBarVisibility="Auto"
- SelectionMode="Extended"
- Style="{StaticResource FilesListViewStyle}"
- VirtualizingPanel.CacheLength="1"
- VirtualizingPanel.CacheLengthUnit="Page"
- VirtualizingPanel.IsVirtualizing="True"
- VirtualizingPanel.ScrollUnit="Pixel" />
- </Border>
- <ListView
- x:Name="GridRecentFilesList"
- Grid.ColumnSpan="2"
- MinWidth="380"
- MinHeight="216"
- Margin="32,0,0,0"
- Padding="0,0,0,0"
- Background="Transparent"
- BorderThickness="0"
- ItemContainerStyle="{StaticResource HomeGridViewItemStyle}"
- ItemTemplate="{StaticResource gridviewItem}"
- ItemsPanel="{StaticResource gridPanel}"
- ItemsSource="{Binding RecentFilesGroup}"
- ScrollViewer.HorizontalScrollBarVisibility="Disabled"
- ScrollViewer.VerticalScrollBarVisibility="Auto"
- SelectionMode="Extended"
- Style="{StaticResource FilesGridViewStyle}"
- VirtualizingPanel.CacheLength="1"
- VirtualizingPanel.CacheLengthUnit="Page"
- VirtualizingPanel.IsVirtualizing="True"
- VirtualizingPanel.ScrollUnit="Pixel"
- Visibility="{Binding IsListMode, Converter={StaticResource InvertBoolToVisibleConvert}}" />
- </Grid>
- <StackPanel
- x:Name="BlankContentPanel"
- Grid.Row="1"
- Grid.RowSpan="2"
- HorizontalAlignment="Center"
- VerticalAlignment="Center"
- Visibility="{Binding IsEmpty, Converter={StaticResource BoolToVisible}}">
- <Button
- x:Name="BtnAddFiles"
- Width="128"
- Height="128"
- MaxHeight="128"
- Background="Transparent"
- BorderThickness="0"
- Command="{Binding OpenFilesCommand}"
- Foreground="#6B6F7D"
- Style="{StaticResource OnlyContentBtn}">
- <Grid Width="128" Height="128">
- <Image
- Width="128"
- Height="128"
- VerticalAlignment="Center"
- Source="../../../Resources/HomeIcon/add.png"
- Stretch="Uniform" />
- </Grid>
- </Button>
- <TextBlock
- x:Name="NoFilesText"
- HorizontalAlignment="Center"
- FontFamily="Segoe UI"
- FontSize="16"
- Foreground="#FF333333"
- LineHeight="22"
- Text="No documents"
- TextAlignment="Center" />
- <StackPanel Margin="0,12,0,0" Orientation="Horizontal">
- <TextBlock
- x:Name="clickFileText"
- VerticalAlignment="Center"
- FontSize="14"
- Foreground="#FF999999"
- Text="Drop documents here or click the '" />
- </StackPanel>
- </StackPanel>
- </Grid>
- </Grid>
- </UserControl>
|