123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525 |
- <UserControl
- x:Class="PDF_Office.Views.Dialog.HomePageToolsDialogs.HomePagePictureToPDFDialog"
- xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
- xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
- xmlns:convert="clr-namespace:PDF_Office.DataConvert"
- xmlns:cus="clr-namespace:PDF_Office.CustomControl"
- xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
- xmlns:homepagetoolsdialogs="clr-namespace:PDF_Office.ViewModels.Dialog.HomePageToolsDialogs"
- xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
- xmlns:prism="http://prismlibrary.com/"
- x:Name="userControl"
- d:DataContext="{d:DesignInstance Type=homepagetoolsdialogs:HomePagePictureToPDFDialogViewModel}"
- d:DesignHeight="554"
- d:DesignWidth="892"
- prism:Dialog.WindowStyle="{StaticResource stlWindowEx}"
- prism:ViewModelLocator.AutoWireViewModel="True"
- mc:Ignorable="d">
- <UserControl.Resources>
- <ResourceDictionary>
- <ResourceDictionary.MergedDictionaries>
- <ResourceDictionary Source="pack://application:,,,/PDF Office;component/Styles/ListViewStyle.xaml" />
- </ResourceDictionary.MergedDictionaries>
- <Style x:Key="ImageFilesListViewStyle" TargetType="{x:Type ListView}">
- <Setter Property="Template">
- <Setter.Value>
- <ControlTemplate TargetType="{x:Type ListView}">
- <Border
- x:Name="Bd"
- Padding="1"
- Background="{TemplateBinding Background}"
- BorderBrush="{TemplateBinding BorderBrush}"
- BorderThickness="{TemplateBinding BorderThickness}"
- SnapsToDevicePixels="true">
- <ScrollViewer Padding="{TemplateBinding Padding}" Focusable="false">
- <Grid>
- <Grid.RowDefinitions>
- <RowDefinition Height="Auto" />
- <RowDefinition />
- </Grid.RowDefinitions>
- <Grid>
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="4.5*" MinWidth="0" />
- <ColumnDefinition Width="3*" />
- <ColumnDefinition Width="2*" />
- <ColumnDefinition Width="100" />
- </Grid.ColumnDefinitions>
- <!-- 以下是列表模式的列标题 -->
- <TextBlock
- Margin="12,0,0,6"
- HorizontalAlignment="Left"
- VerticalAlignment="Center"
- FontSize="14" />
- <TextBlock
- Grid.Column="1"
- Margin="0,0,0,6"
- HorizontalAlignment="Center"
- VerticalAlignment="Center"
- FontSize="14"
- TextAlignment="Center"
- TextWrapping="Wrap" />
- <TextBlock
- Grid.Column="2"
- Margin="0,0,0,6"
- HorizontalAlignment="Center"
- VerticalAlignment="Center"
- FontSize="14" />
- <!-- 列表模式的列标题的分隔线 -->
- <Rectangle
- Grid.ColumnSpan="4"
- Height="0"
- Margin="12,0,0,0"
- HorizontalAlignment="Stretch"
- VerticalAlignment="Bottom"
- Fill="#26000000" />
- </Grid>
- <ItemsPresenter Grid.Row="1" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
- </Grid>
- </ScrollViewer>
- </Border>
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- </Style>
- <Style x:Key="HeadStyle" TargetType="{x:Type GridViewColumnHeader}">
- <Setter Property="OverridesDefaultStyle" Value="False" />
- <Setter Property="VerticalAlignment" Value="Center" />
- <Setter Property="HorizontalContentAlignment" Value="Left" />
- <Setter Property="Height" Value=" 32" />
- <Setter Property="TextBlock.FontFamily" Value="Segoe UI" />
- <Setter Property="Template">
- <Setter.Value>
- <ControlTemplate TargetType="{x:Type GridViewColumnHeader}">
- <Grid
- Name="g"
- HorizontalAlignment="Stretch"
- Background="AliceBlue">
- <Border Name="bd" Padding="{TemplateBinding Padding}">
- <ContentPresenter Margin="5,4,1,3" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" />
- </Border>
- </Grid>
- <ControlTemplate.Triggers>
- <Trigger Property="IsMouseOver" Value="True">
- <Setter TargetName="g" Property="Background">
- <Setter.Value>
- <LinearGradientBrush StartPoint="0.5,0" EndPoint="0.5,1">
- <GradientStop Offset="0.3" Color="#CED0D4" />
- </LinearGradientBrush>
- </Setter.Value>
- </Setter>
- </Trigger>
- </ControlTemplate.Triggers>
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- </Style>
- <!-- ListViewItem的样式 -->
- <Style x:Key="listitem1" TargetType="{x:Type ListViewItem}">
- <Style.Setters>
- <Setter Property="SnapsToDevicePixels" Value="True" />
- <Setter Property="Template">
- <Setter.Value>
- <ControlTemplate TargetType="{x:Type ListViewItem}">
- <Border
- Name="Bd"
- Margin="{TemplateBinding Padding}"
- Padding="{TemplateBinding Control.Padding}"
- Background="{TemplateBinding Panel.Background}"
- BorderBrush="{TemplateBinding BorderBrush}"
- BorderThickness="{TemplateBinding BorderThickness}"
- SnapsToDevicePixels="True">
- <GridViewRowPresenter
- Margin="3"
- HorizontalAlignment="{TemplateBinding Control.HorizontalContentAlignment}"
- VerticalAlignment="{TemplateBinding Control.VerticalContentAlignment}"
- SnapsToDevicePixels="{TemplateBinding UIElement.SnapsToDevicePixels}" />
- </Border>
- <ControlTemplate.Triggers>
- <Trigger Property="IsSelected" Value="True">
- <!--<Trigger.Setters>
- <Setter TargetName="Bd" Property="Background">
- <Setter.Value>
- <LinearGradientBrush StartPoint="0.5,0.22" EndPoint="0.5,1">
- <GradientStop Offset="0.31" Color="LightGray" />
- <GradientStop Offset="0.88" Color="Gray" />
- </LinearGradientBrush>
- </Setter.Value>
- </Setter>
- </Trigger.Setters>-->
- </Trigger>
- </ControlTemplate.Triggers>
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- </Style.Setters>
- </Style>
- <convert:UnVisivleConvert x:Key="unVisibleConvert" />
- </ResourceDictionary>
- </UserControl.Resources>
- <Grid IsEnabled="{Binding PictureToPDFGridIsEnabled}">
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="632*" />
- <ColumnDefinition Width="260" />
- </Grid.ColumnDefinitions>
- <Grid Grid.Column="0">
- <Grid.RowDefinitions>
- <RowDefinition Height="*" />
- <RowDefinition Height="72" />
- </Grid.RowDefinitions>
- <Grid
- Grid.Row="0"
- AllowDrop="True"
- DragEnter="MainPage_DragEnter"
- DragLeave="MainPage_DragLeave"
- DragOver="MainPage_DragOver"
- Drop="Grid_Drop">
- <!--<Label Name="DropGrid" Background="#18A0FB" Opacity="0.5" Panel.ZIndex="1" Visibility="Collapsed"/>-->
- <Grid
- x:Name="grid"
- Width="632"
- Height="480"
- Visibility="{Binding AddFileVisibility}">
- <Button
- Name="BtnBlank"
- Width="418"
- Height="180"
- Background="White"
- BorderBrush="#FFFFFF"
- Command="{Binding ADDPictureCommand}"
- Visibility="{Binding AddFileVisibility}">
- <StackPanel>
- <Grid Width="128" Height="128">
- <Path
- Data="M19.5 43.7691C19.5 42.7996 20.286 42.0137 21.2555 42.0137H40.478C40.8527 42.0137 41.2176 42.1336 41.5193 42.3559L50.4493 48.9359C51.2666 49.5381 52.2551 49.8629 53.2702 49.8629H93.2372C94.2067 49.8629 94.9927 50.6489 94.9927 51.6184V95.5671C94.9927 96.5366 94.2067 97.3225 93.2372 97.3225H21.2555C20.286 97.3225 19.5 96.5366 19.5 95.5671V43.7691Z"
- Stroke="#CED0D4"
- StrokeThickness="3" />
- <Path
- Data="M27 41.3125V37.2555C27 35.4575 28.4575 34 30.2555 34H49.478C50.1729 34 50.8496 34.2224 51.4091 34.6346L60.3391 41.2146C60.8986 41.6269 61.5753 41.8493 62.2702 41.8493H100.237C102.035 41.8493 103.493 43.3068 103.493 45.1047V91C103.493 94.3137 100.806 97 97.4927 97H91.6811"
- Stroke="#CED0D4"
- StrokeThickness="3" />
- </Grid>
- <TextBlock
- Margin="0,8,0,0"
- HorizontalAlignment="Center"
- FontSize="14"
- Style="{StaticResource PropertyHeaderLv2}"
- Text="No Files" />
- <TextBlock
- Width="418"
- Height="20"
- Margin="0,2,0,0"
- FontSize="12"
- Style="{StaticResource PropertyHeaderLv2}"
- Text="Click the button below to select the file."
- TextAlignment="Center"
- TextBlock.Foreground="{StaticResource color.sys.text.neutral.lv3}" />
- </StackPanel>
- </Button>
- </Grid>
- <ListView
- x:Name="listView"
- Width="{Binding ActualWidth, ElementName=grid, Mode=OneWay}"
- Height="{Binding ActualHeight, ElementName=grid, Mode=OneWay}"
- Background="White"
- BorderBrush="{StaticResource color.item-state.sel.border.lv3}"
- BorderThickness="0,0,0,1"
- DataContext="{Binding ImagesDataTable}"
- ItemsSource="{Binding}"
- SelectionChanged="listView_SelectionChanged"
- Visibility="{Binding ElementName=BtnBlank, Path=Visibility, Converter={StaticResource unVisibleConvert}}">
- <ListView.ContextMenu>
- <ContextMenu StaysOpen="True">
- <MenuItem
- Name="OpenFileMenuItem"
- Click="OpenFileMenuItem_Click"
- Header="打开文件" />
- <MenuItem
- Name="RemoveFileMenuItem"
- Click="RemoveFileMenuItem_Click"
- Header="移除" />
- </ContextMenu>
- </ListView.ContextMenu>
- <ListView.View>
- <GridView ColumnHeaderContainerStyle="{StaticResource HeadStyle}">
- <GridViewColumn Width="400" Header="文档名">
- <GridViewColumn.CellTemplate>
- <DataTemplate>
- <StackPanel Orientation="Horizontal">
- <Label VerticalAlignment="Center">
- <Grid>
- <Rectangle
- Width="16"
- Height="16"
- Fill="AliceBlue"
- RadiusX="2"
- RadiusY="2" />
- <Path Data="M1.59814 10.3584H2.63037V5.42627H1.59814V10.3584Z" Fill="white" />
- <Path Data="M3.82666 10.3584H4.74609V7.00195H4.81445L6.0791 10.3584H6.7251L7.98975 7.00195H8.05811V10.3584H8.97754V5.42627H7.79492L6.43457 9.03564H6.37305L5.00928 5.42627H3.82666V10.3584Z" Fill="white" />
- <Path Data="M12.3237 10.4849C13.6704 10.4849 14.5112 9.66455 14.5112 8.35547V7.72998H12.4399V8.48193H13.5063L13.5029 8.57422C13.4824 9.19629 13.0176 9.60986 12.3408 9.60986C11.5273 9.60986 11.0112 8.9502 11.0112 7.88037V7.87354C11.0112 6.82422 11.5034 6.1748 12.2998 6.1748C12.8774 6.1748 13.2979 6.46533 13.438 6.9541L13.4448 6.98828H14.4702L14.4634 6.9541C14.3164 5.96973 13.4653 5.2998 12.2998 5.2998C10.8643 5.2998 9.9585 6.30127 9.9585 7.88379V7.89062C9.9585 9.49707 10.8574 10.4849 12.3237 10.4849Z" Fill="white" />
- </Grid>
- </Label>
- <TextBlock
- Margin="8,0,0,0"
- HorizontalAlignment="Left"
- VerticalAlignment="Center"
- Text="{Binding FileName}" />
- </StackPanel>
- </DataTemplate>
- </GridViewColumn.CellTemplate>
- </GridViewColumn>
- <GridViewColumn DisplayMemberBinding="{Binding FileSize}" Header="大小" />
- <GridViewColumn Header="状态">
- <GridViewColumn.CellTemplate>
- <DataTemplate>
- <StackPanel Orientation="Horizontal">
- <cus:BatchStatus
- Width="16"
- Height="16"
- MaxStatusValue="{Binding MaxPageRange, Mode=TwoWay}"
- StatusValue="{Binding FileState, Mode=TwoWay}" />
- <Button
- Name="DeleteTemplateBtn"
- Width="18"
- Height="18"
- Margin="39,0,0,0"
- Background="Transparent"
- BorderBrush="Transparent"
- Click="DeleteTemplateBtn_Click"
- Style="{StaticResource btn.sec}">
- <Grid Width="14" Height="14">
- <Path
- Data="M7 14C10.866 14 14 10.866 14 7C14 3.13401 10.866 0 7 0C3.13401 0 0 3.13401 0 7C0 10.866 3.13401 14 7 14ZM10.5303 4.53038L8.06069 7L10.5303 9.46962L9.46967 10.5303L7.00002 8.06066L4.53033 10.5303L3.46967 9.46967L5.93936 7L3.46967 4.53033L4.53033 3.46967L7.00002 5.93934L9.46967 3.46971L10.5303 4.53038Z"
- Fill="#CED0D4"
- Stretch="Fill" />
- </Grid>
- </Button>
- </StackPanel>
- <DataTemplate.Triggers>
- <DataTrigger Binding="{Binding Path=IsMouseOver, RelativeSource={RelativeSource FindAncestor, AncestorType=ListViewItem}}" Value="True">
- <Setter TargetName="DeleteTemplateBtn" Property="Visibility" Value="Visible" />
- </DataTrigger>
- <DataTrigger Binding="{Binding Path=IsMouseOver, RelativeSource={RelativeSource FindAncestor, AncestorType=ListViewItem}}" Value="False">
- <Setter TargetName="DeleteTemplateBtn" Property="Visibility" Value="Hidden" />
- </DataTrigger>
- </DataTemplate.Triggers>
- </DataTemplate>
- </GridViewColumn.CellTemplate>
- </GridViewColumn>
- </GridView>
- </ListView.View>
- <ListView.ItemContainerStyle>
- <Style BasedOn="{StaticResource listitem1}" TargetType="ListViewItem">
- <Setter Property="Height" Value="42" />
- <Setter Property="Margin" Value="0" />
- <Setter Property="BorderThickness" Value="0,1,0,0" />
- <Setter Property="TextBlock.Foreground" Value="{StaticResource color.sys.text.neutral.lv1}" />
- <Setter Property="TextBlock.FontFamily" Value="Segoe UI" />
- <Setter Property="BorderBrush" Value="{StaticResource color.item-state.sel.border.lv3}" />
- <Setter Property="Padding" Value="16,0,16,0" />
- <Style.Triggers>
- <Trigger Property="IsMouseOver" Value="True">
- <Setter Property="Background" Value="{StaticResource color.item-state.sel.bg.lv3}" />
- <Setter Property="BorderBrush" Value="{StaticResource color.item-state.sel.border.lv3}" />
- <Setter Property="BorderThickness" Value="2,2,2,2" />
- </Trigger>
- <Trigger Property="IsSelected" Value="True">
- <Setter Property="Background" Value="{StaticResource color.item-state.sel.bg.lv3}" />
- <Setter Property="BorderBrush" Value="{StaticResource color.item-state.sel.border.lv3}" />
- <Setter Property="BorderThickness" Value="2,2,2,2" />
- </Trigger>
- <Trigger Property="ListView.AlternationIndex" Value="1">
- <Setter Property="Background" Value="{StaticResource color.item-state.sel.bg.lv3}" />
- </Trigger>
- </Style.Triggers>
- </Style>
- </ListView.ItemContainerStyle>
- </ListView>
- </Grid>
- <Grid Grid.Row="1">
- <Button
- x:Name="MenuBtn"
- Width="113"
- Height="32"
- Margin="25,0,0,0"
- HorizontalAlignment="Left"
- Click="Menu_Click"
- Style="{StaticResource btn.sec}">
- <StackPanel Orientation="Horizontal">
- <Border HorizontalAlignment="Right">
- <TextBlock
- Width="57"
- Height="22"
- FontSize="14"
- Foreground="Black"
- Text="Add Files" />
- </Border>
- <Border
- Width="12"
- Height="7"
- Margin="12,0,0,0">
- <Path
- HorizontalAlignment="Right"
- VerticalAlignment="Center"
- Data="M6 4.80726L1.26513 0L0 1.28448L5.36743 6.73398C5.71679 7.08868 6.28321 7.08868 6.63257 6.73398L12 1.28448L10.7349 0L6 4.80726Z"
- Fill="#94989C"
- Stretch="Fill" />
- </Border>
- </StackPanel>
- </Button>
- <Popup
- x:Name="menuPop1"
- AllowsTransparency="True"
- PlacementTarget="{Binding ElementName=MenuBtn}"
- StaysOpen="False">
- <Grid
- Width="auto"
- Height="auto"
- HorizontalAlignment="Left">
- <Border
- Margin="3"
- Background="White"
- BorderThickness="0"
- CornerRadius="3">
- <Border.Effect>
- <DropShadowEffect ShadowDepth="0" Color="#FFB6B6B6" />
- </Border.Effect>
- <StackPanel Margin="0">
- <MenuItem
- x:Name="添加文件"
- Command="{Binding ADDPictureCommand}"
- Header="添加文件" />
- <MenuItem
- x:Name="添加文件夹"
- Command="{Binding ADDPictureFilesCommand}"
- Header="添加文件夹" />
- </StackPanel>
- </Border>
- </Grid>
- </Popup>
- <!--<Button
- Width="40"
- Height="40"
- Margin="0,0,90,0"
- HorizontalAlignment="Right">
- </Button>-->
- <Button
- Width="32"
- Height="32"
- Margin="25,0"
- HorizontalAlignment="Right"
- Command="{Binding RemovePictureFileCommand}"
- IsEnabled="{Binding RemoveIsEnable}"
- Style="{StaticResource btn.sec}">
- <Grid Width="16" Height="16">
- <Path Data="M6 1.75H10V0.25H6V1.75ZM1 4.25H2.25V15C2.25 15.4142 2.58579 15.75 3 15.75H13C13.4142 15.75 13.75 15.4142 13.75 15V4.25H15V2.75H1V4.25ZM3.75 14.25V4.25H12.25V14.25H3.75ZM7.25 6.5V11.5H8.75V6.5H7.25Z" Fill="#616469" />
- </Grid>
- </Button>
- </Grid>
- </Grid>
- <Grid
- Grid.Column="1"
- Background="WhiteSmoke"
- IsEnabled="{Binding SetPictureToPDFGridIsEnabled}">
- <Grid.RowDefinitions>
- <RowDefinition Height="1*" />
- <RowDefinition Height="64" />
- </Grid.RowDefinitions>
- <Grid Grid.Row="0" Margin="16,14,0,0">
- <StackPanel>
- <TextBlock Style="{StaticResource PagesView_titleContext}" Text="Setting" />
- <TextBlock
- Height="20"
- Margin="0,16,0,0"
- Style="{StaticResource PropertyHeaderLv2}"
- Text="Export" />
- <StackPanel Margin="0,8,0,0">
- <RadioButton
- Name="NewFilesRadioButtom"
- Padding="9,0,0,0"
- Click="RadioButton_Click"
- IsChecked="True"
- Style="{StaticResource RadioButtonStyleText}">
- <TextBlock Text="新建文档" />
- </RadioButton>
- <RadioButton
- Name="OneNewFileNameRadioButtom"
- Margin="0,8,0,0"
- Padding="9,0,0,0"
- Click="RadioButton_Click"
- Style="{StaticResource RadioButtonStyleText}">
- <TextBlock Text="合并为同一份PDF文档" />
- </RadioButton>
- <RadioButton
- Name="SelectFileNameRadioButton"
- Margin="0,8,0,0"
- Padding="9,0,0,0"
- Click="RadioButton_Click"
- Style="{StaticResource RadioButtonStyleText}"
- Visibility="Hidden">
- <TextBlock Text="插入现有PDF文档" />
- </RadioButton>
- </StackPanel>
- <StackPanel
- Margin="0,4,0,0"
- Orientation="Horizontal"
- Visibility="Hidden">
- <TextBox
- Width="190"
- Height="32"
- VerticalContentAlignment="Center"
- IsEnabled="False"
- Text="{Binding SelectFileName}" />
- <Button
- Width="32"
- Command="{Binding SelectFileCommand}"
- IsEnabled="{Binding ElementName=SelectFileNameRadioButton, Path=IsChecked}"
- Style="{StaticResource btn.sec}" />
- </StackPanel>
- </StackPanel>
- </Grid>
- <Grid
- Grid.Row="1"
- Margin="15,0,0,0"
- Visibility="Hidden">
- <StackPanel>
- <TextBlock Text="OCR" />
- <CheckBox Name="NeedOCRCheckBox" Margin="0,7,0,0">
- <TextBlock Text="在需要时识别文本" />
- </CheckBox>
- <ComboBox
- Width="228"
- Height="28.55"
- Margin="0,4,0,0"
- HorizontalAlignment="Left"
- IsEnabled="{Binding ElementName=NeedOCRCheckBox, Path=IsChecked}" />
- <CheckBox Margin="0,16,0,0" IsEnabled="{Binding ElementName=NeedOCRCheckBox, Path=IsChecked}">
- <TextBlock Text="识别为TXT" />
- </CheckBox>
- </StackPanel>
- </Grid>
- <Grid Grid.Row="1">
- <Button
- Width="228"
- Height="32"
- Command="{Binding ToPDFCommand}"
- IsEnabled="{Binding ImageToPDFBtnIsEnable}"
- Style="{StaticResource Btn.cta}">
- <TextBlock
- FontSize="18"
- Foreground="White"
- Text="导出文档" />
- </Button>
- </Grid>
- </Grid>
- </Grid>
- </UserControl>
|