123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334 |
- <UserControl
- x:Class="PDF_Master.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_Master.DataConvert"
- xmlns:customControl="clr-namespace:PDF_Master.CustomControl"
- xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
- xmlns:i="http://schemas.microsoft.com/xaml/behaviors"
- xmlns:local="clr-namespace:PDF_Master.Views.HomePanel.RecentFiles"
- xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
- xmlns:prism="http://prismlibrary.com/"
- xmlns:recentfiles="clr-namespace:PDF_Master.ViewModels.HomePanel.RecentFiles"
- d:DataContext="{d:DesignInstance Type=recentfiles:RecentFilesContentViewModel}"
- d:DesignHeight="450"
- d:DesignWidth="800"
- prism:ViewModelLocator.AutoWireViewModel="True"
- IsVisibleChanged="UserControl_IsVisibleChanged"
- KeyDown="UserControl_KeyDown"
- 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 Margin="0,-22,0,0" Orientation="Vertical" />
- </ItemsPanelTemplate>
- <ItemsPanelTemplate x:Key="gridPanel">
- <WrapPanel />
- </ItemsPanelTemplate>
- <ContextMenu
- x:Key="FlyoutMenu"
- FontSize="14"
- Opened="ContextMenu_Opened">
- <MenuItem
- Name="FilePathMenuItem"
- Click="FilePathMenuItem_Click"
- Header="{Binding T_MenuShow}"
- IsEnabled="True" />
- <MenuItem
- Name="MenuOpenFile"
- Click="MenuOpenFile_Click"
- Header="Open File"
- IsEnabled="True"
- Visibility="Collapsed" />
- <MenuItem
- Name="DeleteMenuItem"
- Click="DeleteMenuItem_Click"
- Header="{Binding T_MenuRemove}"
- IsEnabled="True" />
- </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="Height" Value="72" />
- <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" />
- <Setter Property="VerticalContentAlignment" Value="Center" />
- <Setter Property="Width" Value="226" />
- <Setter Property="Height" Value="248" />
- <Setter Property="Padding" Value="0" />
- <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">
- <TextBlock
- x:Name="TxbRecentlyTile"
- Margin="0,0,0,0"
- Padding="0,6,0,0"
- HorizontalAlignment="Left"
- FontFamily="Segoe UI"
- FontSize="20"
- FontWeight="Semibold"
- Text="{Binding T_Title}" />
- <StackPanel
- x:Name="PnlRightBtns"
- Grid.Column="0"
- Grid.ColumnSpan="2"
- Margin="0,0,0,0"
- HorizontalAlignment="Right"
- Orientation="Horizontal">
- <Border
- Height="32"
- Padding="2"
- Background="{StaticResource color.sys.layout.fg.dark}"
- CornerRadius="4">
- <StackPanel Orientation="Horizontal">
- <RadioButton
- x:Name="BtnGridMode"
- Width="32"
- Height="28"
- Padding="0"
- HorizontalContentAlignment="Center"
- VerticalContentAlignment="Center"
- GroupName="Mode"
- IsChecked="{Binding IsListMode, Converter={StaticResource InvertBoolConvert}, Mode=OneTime}"
- Style="{StaticResource ListModeRadioBtnStyle}"
- Tag="GridMode">
- <Path
- Width="32"
- Height="28"
- HorizontalAlignment="Center"
- VerticalAlignment="Center"
- Data="M10.8 7.25C9.94396 7.25 9.25 7.94396 9.25 8.8V12C9.25 12.856 9.94396 13.55 10.8 13.55H14C14.856 13.55 15.55 12.856 15.55 12V8.8C15.55 7.94396 14.856 7.25 14 7.25H10.8ZM10.75 8.8C10.75 8.77239 10.7724 8.75 10.8 8.75H14C14.0276 8.75 14.05 8.77239 14.05 8.8V12C14.05 12.0276 14.0276 12.05 14 12.05H10.8C10.7724 12.05 10.75 12.0276 10.75 12V8.8ZM10.8 14.45C9.94396 14.45 9.25 15.144 9.25 16V19.2C9.25 20.056 9.94396 20.75 10.8 20.75H14C14.856 20.75 15.55 20.056 15.55 19.2V16C15.55 15.144 14.856 14.45 14 14.45H10.8ZM10.75 16C10.75 15.9724 10.7724 15.95 10.8 15.95H14C14.0276 15.95 14.05 15.9724 14.05 16V19.2C14.05 19.2276 14.0276 19.25 14 19.25H10.8C10.7724 19.25 10.75 19.2276 10.75 19.2V16ZM16.45 8.8C16.45 7.94396 17.1439 7.25 18 7.25H21.2C22.056 7.25 22.75 7.94396 22.75 8.8V12C22.75 12.856 22.056 13.55 21.2 13.55H18C17.1439 13.55 16.45 12.856 16.45 12V8.8ZM18 8.75C17.9723 8.75 17.95 8.77239 17.95 8.8V12C17.95 12.0276 17.9723 12.05 18 12.05H21.2C21.2276 12.05 21.25 12.0276 21.25 12V8.8C21.25 8.77239 21.2276 8.75 21.2 8.75H18ZM18 14.45C17.1439 14.45 16.45 15.144 16.45 16V19.2C16.45 20.056 17.1439 20.75 18 20.75H21.2C22.056 20.75 22.75 20.056 22.75 19.2V16C22.75 15.144 22.056 14.45 21.2 14.45H18ZM17.95 16C17.95 15.9724 17.9723 15.95 18 15.95H21.2C21.2276 15.95 21.25 15.9724 21.25 16V19.2C21.25 19.2276 21.2276 19.25 21.2 19.25H18C17.9723 19.25 17.95 19.2276 17.95 19.2V16Z"
- Fill="{Binding ElementName=BtnGridMode, Path=Foreground}" />
- <i:Interaction.Triggers>
- <i:EventTrigger EventName="Checked">
- <i:InvokeCommandAction Command="{Binding ListModeCheckedCommand}" CommandParameter="{Binding ElementName=BtnGridMode, Path=Tag}" />
- </i:EventTrigger>
- </i:Interaction.Triggers>
- </RadioButton>
- <RadioButton
- x:Name="BtnListMode"
- Width="32"
- Height="28"
- Padding="0"
- HorizontalContentAlignment="Center"
- VerticalContentAlignment="Center"
- GroupName="Mode"
- IsChecked="{Binding IsListMode, Mode=OneTime}"
- Style="{StaticResource ListModeRadioBtnStyle}"
- Tag="ListMode">
- <Path
- Width="16"
- Height="16"
- Data="M15 3.75H1V2.25H15V3.75ZM15 8.75H1V7.25H15V8.75ZM1 13.75H15V12.25H1V13.75Z"
- Fill="{Binding ElementName=BtnListMode, Path=Foreground}" />
- <i:Interaction.Triggers>
- <i:EventTrigger EventName="Checked">
- <i:InvokeCommandAction Command="{Binding ListModeCheckedCommand}" CommandParameter="{Binding ElementName=BtnListMode, 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="32"
- Height="32"
- MaxHeight="40"
- Margin="16,0,0,0"
- Padding="0,0,0,0"
- Command="{Binding RemoveFilesFromContainerCommand}"
- Foreground="#6B6F7D"
- IsEnabled="{Binding IsEmpty, Converter={StaticResource InvertBoolConvert}, Mode=OneWay}">
- <Path
- Width="32"
- Height="32"
- Data="M14 9.75H18V8.25H14V9.75ZM9 12.25H10.25V23C10.25 23.4142 10.5858 23.75 11 23.75H21C21.4142 23.75 21.75 23.4142 21.75 23V12.25H23V10.75H9V12.25ZM11.75 22.25V12.25H20.25V22.25H11.75ZM15.25 14.5V19.5H16.75V14.5H15.25Z"
- Fill="{Binding ElementName=BtnDelete, Path=Foreground}" />
- <Button.Style>
- <Style BasedOn="{StaticResource btn.sec}" TargetType="{x:Type Button}">
- <Style.Triggers>
- <DataTrigger Binding="{Binding ElementName=RecentFilesList, Path=Visibility}" Value="Visible">
- <Setter Property="CommandParameter" Value="{Binding ElementName=RecentFilesList, Path=SelectedItems}" />
- </DataTrigger>
- <DataTrigger Binding="{Binding ElementName=GridRecentFilesList, Path=Visibility}" Value="Visible">
- <Setter Property="CommandParameter" Value="{Binding ElementName=GridRecentFilesList, Path=SelectedItems}" />
- </DataTrigger>
- </Style.Triggers>
- </Style>
- </Button.Style>
- </Button>
- </StackPanel>
- </Grid>
- <Grid
- Grid.Row="2"
- Margin="0,16,0,0"
- 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="200"
- MinHeight="216"
- 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="200"
- MinHeight="216"
- Background="Transparent"
- BorderThickness="0"
- ItemContainerStyle="{StaticResource HomeGridViewItemStyle}"
- ItemTemplate="{StaticResource gridviewItem}"
- ItemsPanel="{StaticResource gridPanel}"
- ItemsSource="{Binding RecentFilesGroup}"
- ScrollViewer.HorizontalScrollBarVisibility="Disabled"
- ScrollViewer.VerticalScrollBarVisibility="Auto"
- SelectionMode="Extended"
- 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="92"
- Height="114"
- MaxHeight="128"
- Background="Transparent"
- BorderThickness="0"
- Command="{Binding OpenFilesCommand}"
- Foreground="#6B6F7D"
- Style="{StaticResource OnlyContentBtn}">
- <Grid>
- <Rectangle
- Width="90"
- Height="114"
- RadiusX="2"
- RadiusY="4"
- Stroke="{StaticResource color.icon.base.neutral.norm.lv2}"
- StrokeDashArray="6 6"
- StrokeThickness="2" />
- <Path
- Width="30"
- Height="30"
- HorizontalAlignment="Center"
- VerticalAlignment="Center"
- Data="M13.3333 16.6667V30H16.6667V16.6667H30V13.3333H16.6667V0H13.3333V13.3333H0V16.6667H13.3333Z"
- Fill="{StaticResource color.icon.base.neutral.norm.lv2}" />
- <!--<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="{StaticResource color.sys.text.neutral.lv2}"
- LineHeight="22"
- Text="{Binding T_NoFilesTitle}"
- TextAlignment="Center" />
- <StackPanel Margin="0,12,0,0" Orientation="Horizontal">
- <TextBlock
- x:Name="clickFileText"
- VerticalAlignment="Center"
- FontSize="14"
- Foreground="#FF999999"
- Text="{Binding T_NoFilesContent}" />
- </StackPanel>
- </StackPanel>
- </Grid>
- </Grid>
- </UserControl>
|