|
@@ -5,6 +5,8 @@
|
|
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
|
|
xmlns:local="clr-namespace:PDF_Office.Views.HomePanel.RecentFiles"
|
|
|
xmlns:customControl ="clr-namespace:PDF_Office.CustomControl"
|
|
|
+ xmlns:DataConvert ="clr-namespace:PDF_Office.DataConvert"
|
|
|
+ xmlns:i="http://schemas.microsoft.com/xaml/behaviors"
|
|
|
xmlns:prism ="http://prismlibrary.com/"
|
|
|
prism:ViewModelLocator.AutoWireViewModel="True"
|
|
|
mc:Ignorable="d" Loaded="UserControl_Loaded"
|
|
@@ -14,16 +16,18 @@
|
|
|
<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"
|
|
|
-
|
|
|
+ OpenFileItemHandler ="DocItemListViewControl_OpenFileItemHandler"
|
|
|
+ DeleteItemHandler="DocItemListViewControl_DeleteItemHandler"
|
|
|
/>
|
|
|
- <!--FileInfoItemHandler="FileInfoMenuItem_Click"
|
|
|
- PrintItemHandler="PrintMenuItem_Click"
|
|
|
- DeleteItemHandler="DeleteItemHandler_Click"
|
|
|
- ShareItemHandler="ShareMenuItem_Click"
|
|
|
- FilePathItemHandler ="FilePathMenuItem_Click"-->
|
|
|
</DataTemplate>
|
|
|
|
|
|
<DataTemplate x:Key="gridviewItem">
|
|
@@ -46,7 +50,7 @@
|
|
|
<Setter Property="VerticalContentAlignment" Value="Center"/>
|
|
|
</Style>
|
|
|
</ContextMenu.ItemContainerStyle>
|
|
|
- <MenuItem Name="FilePathMenuItem" Header="FilePath" IsEnabled="True" Click="FilePathMenuItem_Click">
|
|
|
+ <MenuItem Name="FilePathMenuItem" Header="打开文件路径" IsEnabled="True" Click="FilePathMenuItem_Click">
|
|
|
<MenuItem.Icon>
|
|
|
<Path Fill="Black"
|
|
|
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">
|
|
@@ -76,7 +80,8 @@
|
|
|
<EventSetter Event="PreviewMouseRightButtonDown"
|
|
|
Handler="ListViewItem_PreviewMouseRightButtonDown"/>
|
|
|
<EventSetter Event="PreviewMouseDoubleClick"
|
|
|
- Handler="RecentFilesList_PreviewMouseDoubleClick"/>
|
|
|
+ Handler="RecentFilesList_PreviewMouseDoubleClick">
|
|
|
+ </EventSetter>
|
|
|
</Style>
|
|
|
|
|
|
<Style x:Key="HomeGridViewItemStyle" BasedOn="{StaticResource FilesGridItemStyle}" TargetType="{x:Type ListViewItem}">
|
|
@@ -100,48 +105,80 @@
|
|
|
<RowDefinition />
|
|
|
</Grid.RowDefinitions>
|
|
|
<Grid x:Name="GridRecentFilesTile" Margin="32,38,0,13">
|
|
|
- <TextBlock x:Name="TxbRecentlyTile" Text="Recent" HorizontalAlignment="Left" FontWeight="Semibold" FontSize="24" Padding="0,6,0,0" Margin="0,0,0,0"/>
|
|
|
-
|
|
|
+ <TextBlock x:Name="TxbRecentlyTile" Text="Recent" HorizontalAlignment="Left" FontWeight="Semibold" FontSize="20" Padding="0,6,0,0" Margin="0,0,0,0"/>
|
|
|
<StackPanel x:Name="PnlRightBtns" Grid.Column="0" Grid.ColumnSpan="2" Margin="0,0,0,0" Orientation="Horizontal" HorizontalAlignment="Right">
|
|
|
-
|
|
|
-
|
|
|
- <customControl:CustomIconToggleBtn x:Name="BtnListMode" Tag="ListMode" Width="32" Height="24" Click="ListModeBtn_Click"
|
|
|
- Style="{StaticResource ToggleBtnViewModeStyle}">
|
|
|
- <StackPanel Orientation="Horizontal" Margin="8,0,8,0">
|
|
|
- <Path Fill="Black" Data="M15 2H1V7H15V2ZM14 3V6H2V3H14ZM15 9H1V14H15V9ZM14 10V13H2V10H14Z"/>
|
|
|
- </StackPanel>
|
|
|
- </customControl:CustomIconToggleBtn>
|
|
|
-
|
|
|
- <customControl:CustomIconToggleBtn x:Name="BtnGridMode" Margin="0" Width="32" Height="24" Tag="GridMode" Click="GridModeBtn_Click"
|
|
|
- Style="{StaticResource ToggleBtnViewModeStyle}">
|
|
|
- <StackPanel Orientation="Horizontal" Margin="8,0,8,0">
|
|
|
- <Path Fill="Black" Data="M7 2H2V7H7V2ZM6 3V6H3V3H6ZM14 2H9V7H14V2ZM13 3V6H10V3H13ZM2 9H7V14H2V9ZM6 13V10H3V13H6ZM14 9H9V14H14V9ZM13 10V13H10V10H13Z"/>
|
|
|
+ <Border Background="#EEF2F3" Height="30" CornerRadius="4" Padding="1,0,1,0">
|
|
|
+ <StackPanel Orientation="Horizontal">
|
|
|
+ <RadioButton x:Name="BtnListMode" GroupName="Mode" Tag="ListMode" Width="40" Height="28" Foreground="#333333"
|
|
|
+ HorizontalContentAlignment="Center" VerticalContentAlignment="Center"
|
|
|
+ IsChecked="{Binding IsListMode,Mode=OneTime}"
|
|
|
+ Style="{StaticResource ListModeRadioBtnStyle}">
|
|
|
+ <Grid Margin="-5,0,0,0" HorizontalAlignment="Center">
|
|
|
+ <Path Data="M3 5L17 5" Stroke="{Binding ElementName=BtnListMode,Path=Foreground}" StrokeThickness="1.5" StrokeStartLineCap="Round" />
|
|
|
+ <Path Data="M3 10H17" Stroke="{Binding ElementName=BtnListMode,Path=Foreground}" StrokeThickness="1.5" StrokeStartLineCap="Round" />
|
|
|
+ <Path Data="M3 15H17" Stroke="{Binding ElementName=BtnListMode,Path=Foreground}" StrokeThickness="1.5" StrokeStartLineCap="Round" />
|
|
|
+ </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" GroupName="Mode" Tag="GridMode" Width="40" Height="28" Foreground="#6B869C"
|
|
|
+ HorizontalContentAlignment="Center" VerticalContentAlignment="Center"
|
|
|
+ IsChecked="{Binding IsListMode,Converter={StaticResource InvertBoolConvert},Mode=OneTime}"
|
|
|
+ Style="{StaticResource ListModeRadioBtnStyle}">
|
|
|
+ <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" Margin="1" Width="5" Height="5" StrokeThickness="1.5" Stroke="{Binding ElementName=BtnGridMode,Path=Foreground}" StrokeDashCap="Round"/>
|
|
|
+ <Rectangle Grid.Row="0" Grid.Column="1" Margin="1" Width="5" Height="5" StrokeThickness="1.5" Stroke="{Binding ElementName=BtnGridMode,Path=Foreground}" StrokeDashCap="Round"/>
|
|
|
+ <Rectangle Grid.Row="1" Grid.Column="0" Margin="1" Width="5" Height="5" StrokeThickness="1.5" Stroke="{Binding ElementName=BtnGridMode,Path=Foreground}" StrokeDashCap="Round"/>
|
|
|
+ <Rectangle Grid.Row="1" Grid.Column="1" Margin="1" Width="5" Height="5" StrokeThickness="1.5" Stroke="{Binding ElementName=BtnGridMode,Path=Foreground}" StrokeDashCap="Round"/>
|
|
|
+ </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>
|
|
|
- </customControl:CustomIconToggleBtn>
|
|
|
-
|
|
|
-
|
|
|
+ </Border>
|
|
|
+
|
|
|
<Separator Margin="1 0 1 0" Width="1" Height="16" BorderBrush="#1A000000" BorderThickness="1"/>
|
|
|
|
|
|
- <Button x:Name="BtnDelete" Margin="0" Padding="0,0,0,0" MaxHeight="40" Width="20" Height="20" Background="Transparent" BorderThickness="0" Command="{Binding RemoveFilesFromContainerCommand}" CommandParameter="{Binding ElementName=RecentFilesList,Path=SelectedItems}"
|
|
|
- >
|
|
|
- <StackPanel Orientation="Horizontal">
|
|
|
- <StackPanel Orientation="Horizontal" VerticalAlignment="Center" Margin="4,0,4,0">
|
|
|
- <Path Fill="Black" VerticalAlignment="Center" Data="M9 0H3V2H0V3H1V14H11V3H12V2H9V0ZM2 13V3H3H4H8H9H10V13H2ZM8 2V1H4V2H8ZM4 12V4H3V12H4ZM6.5 4V12H5.5V4H6.5ZM9 12V4H8V12H9Z"/>
|
|
|
- </StackPanel>
|
|
|
- </StackPanel>
|
|
|
+ <Button x:Name="BtnDelete" Margin="0" Padding="0,0,0,0" MaxHeight="40" Width="28" Height="28" Background="Transparent" BorderThickness="0"
|
|
|
+ IsEnabled="{Binding IsEmpty,Converter={StaticResource InvertBoolConvert},Mode=OneWay}"
|
|
|
+ Command="{Binding RemoveFilesFromContainerCommand}" CommandParameter="{Binding ElementName=RecentFilesList,Path=SelectedItems}"
|
|
|
+ Style="{StaticResource OnlyContentBtn}" Foreground="#6B6F7D"
|
|
|
+ >
|
|
|
+ <Grid Width="20" Height="20">
|
|
|
+ <Path Data="M8 2H12" Stroke="{Binding ElementName=BtnDelete,Path=Foreground}" StrokeThickness="2" StrokeDashCap="Round"/>
|
|
|
+ <Path Data="M5 5V17H15V5" Stroke="{Binding ElementName=BtnDelete,Path=Foreground}" StrokeThickness="2" StrokeDashCap="Round"/>
|
|
|
+ <Path Data="M17 5H3" Stroke="{Binding ElementName=BtnDelete,Path=Foreground}" StrokeThickness="2" StrokeDashCap="Round"/>
|
|
|
+ <Path Data="M10 9V13" Stroke="{Binding ElementName=BtnDelete,Path=Foreground}" StrokeThickness="2" StrokeDashCap="Round"/>
|
|
|
+ </Grid>
|
|
|
</Button>
|
|
|
|
|
|
</StackPanel>
|
|
|
|
|
|
</Grid>
|
|
|
|
|
|
- <Grid Grid.Row="2">
|
|
|
- <Grid.ColumnDefinitions>
|
|
|
- <ColumnDefinition Width="799*"/>
|
|
|
- <ColumnDefinition Width="*"/>
|
|
|
- </Grid.ColumnDefinitions>
|
|
|
- <ListView x:Name="RecentFilesList"
|
|
|
- ItemsSource="{Binding RecentFilesGroup}"
|
|
|
+ <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"
|
|
|
+ ItemsSource="{Binding RecentFilesGroup}"
|
|
|
Margin="32,0,0,0"
|
|
|
VirtualizingPanel.IsVirtualizing="True"
|
|
|
VirtualizingPanel.CacheLengthUnit="Page"
|
|
@@ -152,17 +189,19 @@
|
|
|
Background="Transparent" BorderThickness="0"
|
|
|
Padding="0,0,0,0" MinHeight="216" MinWidth="380"
|
|
|
SelectionMode="Multiple"
|
|
|
- SelectionChanged="RecentFilesList_SelectionChanged"
|
|
|
ItemContainerStyle="{StaticResource SubFilesListViewItemStyle}"
|
|
|
Style="{StaticResource FilesListViewStyle}"
|
|
|
ItemTemplate="{StaticResource listviewItem}"
|
|
|
ItemsPanel="{StaticResource listPanel}" Grid.ColumnSpan="2"
|
|
|
>
|
|
|
- </ListView>
|
|
|
+ </ListView>
|
|
|
+ </Border>
|
|
|
+
|
|
|
|
|
|
- <ListView x:Name="GridRecentFilesList"
|
|
|
- ItemsSource="{Binding RecentFilesGroup}"
|
|
|
- Margin="32,0,0,0" Visibility="Collapsed"
|
|
|
+ <ListView x:Name="GridRecentFilesList"
|
|
|
+ Visibility="{Binding IsListMode,Converter={StaticResource InvertBoolToVisibleConvert}}"
|
|
|
+ ItemsSource="{Binding RecentFilesGroup}"
|
|
|
+ Margin="32,0,0,0"
|
|
|
VirtualizingPanel.IsVirtualizing="True"
|
|
|
VirtualizingPanel.CacheLengthUnit="Page"
|
|
|
VirtualizingPanel.CacheLength="1"
|
|
@@ -172,22 +211,23 @@
|
|
|
Background="Transparent" BorderThickness="0"
|
|
|
Padding="0,0,0,0" MinHeight="216" MinWidth="380"
|
|
|
SelectionMode="Multiple"
|
|
|
- SelectionChanged="GridRecentFilesList_SelectionChanged"
|
|
|
ItemContainerStyle="{StaticResource HomeGridViewItemStyle}"
|
|
|
Style="{StaticResource FilesGridViewStyle}"
|
|
|
ItemTemplate="{StaticResource gridviewItem}"
|
|
|
ItemsPanel="{StaticResource gridPanel}" Grid.ColumnSpan="2"
|
|
|
>
|
|
|
- </ListView>
|
|
|
+ </ListView>
|
|
|
|
|
|
- </Grid>
|
|
|
- <StackPanel x:Name="BlankContentPanel" Grid.Row="1" Grid.RowSpan="2" HorizontalAlignment="Center" VerticalAlignment="Center" Visibility="Collapsed">
|
|
|
+ </Grid>
|
|
|
+
|
|
|
+ <StackPanel x:Name="BlankContentPanel" Grid.Row="1" Grid.RowSpan="2" HorizontalAlignment="Center" VerticalAlignment="Center"
|
|
|
+ Visibility="{Binding IsEmpty,Converter={StaticResource BoolToVisible}}">
|
|
|
<!--<Image Source="../../Resources/Image/Home/empty_recent2x.png" Width="140" Height="140" Stretch="Uniform" VerticalAlignment="Center"/>-->
|
|
|
<TextBlock x:Name="NoFilesText" Text="No documents" TextAlignment="Center" HorizontalAlignment="Center" FontSize="16" LineHeight="22" Foreground="#FF333333" FontFamily="Segoe UI" />
|
|
|
<StackPanel Orientation="Horizontal" Margin="0,12,0,0">
|
|
|
<TextBlock x:Name="clickFileText" Text="Drop documents here or click the '" Foreground="#FF999999" VerticalAlignment="Center" FontSize="14"/>
|
|
|
<TextBlock Margin="2,0,2,0" VerticalAlignment="Center" FontSize="15">
|
|
|
- <Hyperlink Click="OpenFiles_Click">
|
|
|
+ <Hyperlink Command="{Binding OpenFilesCommand}">
|
|
|
<TextBlock x:Name="OpenFilesLinkText" Text="Open Files"/>
|
|
|
</Hyperlink>
|
|
|
</TextBlock>
|