123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210 |
- <UserControl x:Class="PDF_Office.Views.Dialog.ToolsDialogs.MergeDialog"
- xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
- xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
- xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
- xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
- xmlns:local="clr-namespace:PDF_Office.Views.Dialog.PageEditDialogs"
- mc:Ignorable="d"
- xmlns:prism="http://prismlibrary.com/" xmlns:customcontrol="clr-namespace:PDF_Office.CustomControl" xmlns:dataconvert="clr-namespace:PDF_Office.DataConvert" xmlns:toolsdialogs="clr-namespace:PDF_Office.ViewModels.Dialog.ToolsDialogs" xmlns:i="http://schemas.microsoft.com/xaml/behaviors" d:DataContext="{d:DesignInstance Type=toolsdialogs:MergeDialogViewModel}"
- prism:Dialog.WindowStyle="{StaticResource DialogWindowStyle}"
- Width="818"
- Height="600"
- >
- <UserControl.Resources>
- <dataconvert:IndexConverter x:Key="IndexConverter"/>
- <dataconvert:BoolToVisible x:Key="BoolToVisible" />
- <dataconvert:UnVisivleConvert x:Key="UnVisivleConvert" />
- <dataconvert:ListCountToVisible x:Key="ListCountToVisible"/>
- <dataconvert:UnVisibleToBoolConvert x:Key="UnVisibleToBoolConvert"/>
- </UserControl.Resources>
- <Grid Background="{StaticResource color.sys.layout.anti}">
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="16"/>
- <ColumnDefinition Width="558"/>
- <ColumnDefinition Width="260"/>
- <ColumnDefinition Width="16"/>
- </Grid.ColumnDefinitions>
- <Grid.RowDefinitions>
- <RowDefinition Height="16"/>
- <RowDefinition Height="20"/>
- <RowDefinition Height="8"/>
- <RowDefinition Height="*"/>
- <RowDefinition Height="16"/>
- <RowDefinition Height="50"/>
- <RowDefinition Height="16"/>
- </Grid.RowDefinitions>
- <Border Grid.Column="1" Grid.Row="3">
- <Grid AllowDrop="True" Background="{StaticResource color.sys.layout.anti}"
- PreviewDrop="Grid_Drop"
- PreviewDragEnter="Grid_DragEnter"
- PreviewDragOver="Grid_DragOver"
- PreviewDragLeave="Grid_DragLeave"
- >
- <StackPanel
- x:Name="NoFileStackPanel" HorizontalAlignment="Center" VerticalAlignment="Center" Visibility="{Binding MergeObjectlist.Count, Converter={StaticResource ListCountToVisible}}" >
- <customcontrol:ImageButton
- Height="128" Width="128" IconHeight="128" IconWidth="128"
- Icon="pack://application:,,,/PDF Office;component/Resources/Dialog/AddImage.png"
- IconPress="pack://application:,,,/PDF Office;component/Resources/Dialog/AddImageSuspend.png"
- IconMouseOver="pack://application:,,,/PDF Office;component/Resources/Dialog/AddImageSuspend.png" Command="{Binding AddFilesCommand}" CommandParameter="0"/>
- <TextBlock Text="Selected files" FontSize="14" FontFamily="Segoe UI" HorizontalAlignment="Center" VerticalAlignment="Center"/>
- <TextBlock Text="Drop files here or Click Add Files at bottom right button. You can drag files to reorder as you need." FontSize="14" FontFamily="Segoe UI" HorizontalAlignment="Center" TextAlignment="Center" VerticalAlignment="Center" TextWrapping="Wrap"/>
- </StackPanel>
- <ListView x:Name="MergeView" AllowDrop="True"
- Visibility="{Binding ElementName=NoFileStackPanel,Path=Visibility,Converter={StaticResource UnVisivleConvert}}"
- Drop="MergeView_Drop"
- DragEnter="MergeView_DragEnter"
- DragOver="MergeView_DragOver"
- DragLeave="MergeView_DragLeave"
- PreviewMouseMove="MergeView_PreviewMouseMove"
- ItemsSource="{Binding MergeObjectlist}"
- ScrollViewer.HorizontalScrollBarVisibility="Disabled"
- HorizontalContentAlignment="Stretch">
- <ListView.ItemTemplate>
- <DataTemplate >
- <Grid x:Name="ContentPanel" >
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="Auto"/>
- <ColumnDefinition Width="*"/>
- <ColumnDefinition Width="*"/>
- <ColumnDefinition Width="*"/>
- <ColumnDefinition Width="*"/>
- <ColumnDefinition Width="*"/>
- </Grid.ColumnDefinitions>
- <TextBlock Text="{Binding RelativeSource={RelativeSource FindAncestor,
- AncestorType={x:Type ListViewItem}},
- Converter={StaticResource IndexConverter}}"
- VerticalAlignment="Center" HorizontalAlignment="Center"/>
- <Image Grid.Column="1" Width="50" Height="50" HorizontalAlignment="Center" VerticalAlignment="Center" Source="{Binding DocThumbnail}" Stretch="Uniform" />
- <StackPanel Grid.Column="2" HorizontalAlignment="Center" VerticalAlignment="Center">
- <TextBlock Text="{Binding DocName}" TextTrimming="CharacterEllipsis"/>
- <TextBlock Text="{Binding DocPageCount}" />
- </StackPanel>
- <StackPanel Grid.Column="3" HorizontalAlignment="Center" VerticalAlignment="Center">
- <customcontrol:WritableComboBox SelectedIndex="0" MaxPageRange="{Binding SDKPageCount}" Text="{Binding SetPageRange,Mode=TwoWay}"/>
- </StackPanel>
- <TextBlock Grid.Column="4" Text="{Binding DocSize}" HorizontalAlignment="Center" VerticalAlignment="Center"/>
- <StackPanel Grid.Column="5" VerticalAlignment="Center">
- <Button Content="删除" Click="Delete_Click"/>
- </StackPanel>
- <StackPanel Grid.ColumnSpan="5" Visibility="{Binding IsForward, Converter={StaticResource BoolToVisible}}" Orientation="Horizontal" HorizontalAlignment="Stretch" VerticalAlignment="Bottom">
- <Line Margin="0,0,0,0" X1="0" X2="{Binding ElementName=ContentPanel,Path=ActualWidth}" HorizontalAlignment="Stretch" StrokeThickness="1.5" Stroke="#FF0078D7" VerticalAlignment="Bottom"/>
- </StackPanel>
- <StackPanel Grid.ColumnSpan="5" Visibility="{Binding IsBackwards, Converter={StaticResource BoolToVisible}}" Orientation="Horizontal" HorizontalAlignment="Stretch" VerticalAlignment="Top">
- <Line X1="0" X2="{Binding ElementName=ContentPanel,Path=ActualWidth}" HorizontalAlignment="Stretch" StrokeThickness="1.5" Stroke="Red" VerticalAlignment="Bottom"/>
- </StackPanel>
- </Grid>
- </DataTemplate>
- </ListView.ItemTemplate>
- </ListView>
- </Grid>
- </Border>
- <Border Grid.Column="2" Grid.Row="3">
- <Grid>
- <Grid.RowDefinitions>
- <RowDefinition Height="20"/>
- <RowDefinition Height="*"/>
- </Grid.RowDefinitions>
- <TextBlock Text=" Page Size"/>
- <StackPanel Grid.Row="1">
- <RadioButton Content="Original page size" Tag="0">
- <i:Interaction.Triggers>
- <i:EventTrigger EventName="Checked">
- <i:InvokeCommandAction Command="{Binding SetPageSizeTypeCommand}" CommandParameter="{Binding RelativeSource={RelativeSource AncestorType=RadioButton}}" PassEventArgsToCommand="True" />
- </i:EventTrigger>
- </i:Interaction.Triggers>
- </RadioButton>
- <RadioButton Content="A4" Tag="1">
- <i:Interaction.Triggers>
- <i:EventTrigger EventName="Checked">
- <i:InvokeCommandAction Command="{Binding SetPageSizeTypeCommand}" CommandParameter="{Binding RelativeSource={RelativeSource AncestorType=RadioButton}}" PassEventArgsToCommand="True" />
- </i:EventTrigger>
- </i:Interaction.Triggers>
- </RadioButton>
- <RadioButton Content="A3" Tag="2">
- <i:Interaction.Triggers>
- <i:EventTrigger EventName="Checked">
- <i:InvokeCommandAction Command="{Binding SetPageSizeTypeCommand}" CommandParameter="{Binding RelativeSource={RelativeSource AncestorType=RadioButton}}" PassEventArgsToCommand="True" />
- </i:EventTrigger>
- </i:Interaction.Triggers>
- </RadioButton>
- <RadioButton Content="U.S.Letter" Tag="3">
- <i:Interaction.Triggers>
- <i:EventTrigger EventName="Checked">
- <i:InvokeCommandAction Command="{Binding SetPageSizeTypeCommand}" CommandParameter="{Binding RelativeSource={RelativeSource AncestorType=RadioButton}}" PassEventArgsToCommand="True" />
- </i:EventTrigger>
- </i:Interaction.Triggers>
- </RadioButton>
- <RadioButton Content="U.S.Legal" Tag="4">
- <i:Interaction.Triggers>
- <i:EventTrigger EventName="Checked">
- <i:InvokeCommandAction Command="{Binding SetPageSizeTypeCommand}" CommandParameter="{Binding RelativeSource={RelativeSource AncestorType=RadioButton}}" PassEventArgsToCommand="True" />
- </i:EventTrigger>
- </i:Interaction.Triggers>
- </RadioButton>
- <RadioButton x:Name="Customized" Content="Customized" Tag="5">
- <i:Interaction.Triggers>
- <i:EventTrigger EventName="Checked">
- <i:InvokeCommandAction Command="{Binding SetPageSizeTypeCommand}" CommandParameter="{Binding RelativeSource={RelativeSource AncestorType=RadioButton}}" PassEventArgsToCommand="True" />
- </i:EventTrigger>
- </i:Interaction.Triggers>
- </RadioButton>
- <Grid IsEnabled="{Binding ElementName=Customized, Path=IsChecked}">
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="*"/>
- <ColumnDefinition Width="20"/>
- <ColumnDefinition Width="*"/>
- </Grid.ColumnDefinitions>
- <customcontrol:TextBoxEx PreviewKeyDown="TextBoxEx_PreviewKeyDown" x:Name="TextWidth" PlaceholderText="595" Text="{Binding InputWidth,Mode=TwoWay}" PreviewTextInput="TextBox_PreviewTextInput" LostFocus="TextBoxEx_LostFocus"/>
- <TextBlock Text="X" Grid.Column="1" HorizontalAlignment="Center" VerticalAlignment="Center"/>
- <customcontrol:TextBoxEx PreviewKeyDown="TextBoxEx_PreviewKeyDown" x:Name="TextHeight" PlaceholderText="841" Grid.Column="2" Text="{Binding InputHeight,Mode=TwoWay}" PreviewTextInput="TextBox_PreviewTextInput" LostFocus="TextBoxEx_LostFocus"/>
- </Grid>
- </StackPanel>
- </Grid>
- </Border>
- <ComboBox Grid.Column="1" SelectedIndex="0" Grid.Row="5" Width="113" Height="32" HorizontalAlignment="Left" VerticalAlignment="Bottom" >
- <ComboBoxItem Tag="0">
- <TextBlock Text="Add Files" />
- <i:Interaction.Triggers>
- <i:EventTrigger EventName="PreviewMouseUp">
- <i:InvokeCommandAction
- Command="{Binding AddFilesCommand}"
- CommandParameter="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type ComboBoxItem}},Path=Tag}"
- PassEventArgsToCommand="True" />
- </i:EventTrigger>
- </i:Interaction.Triggers>
- </ComboBoxItem>
- <ComboBoxItem Tag="1">
- <TextBlock Text="添加文件夹"/>
- <i:Interaction.Triggers>
- <i:EventTrigger EventName="PreviewMouseUp">
- <i:InvokeCommandAction
- Command="{Binding AddFilesCommand}"
- CommandParameter="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type ComboBoxItem}},Path=Tag}"
- PassEventArgsToCommand="True" />
- </i:EventTrigger>
- </i:Interaction.Triggers>
- </ComboBoxItem>
- <ComboBoxItem Tag="2">
- <TextBlock Text="添加已打开文件"/>
- <i:Interaction.Triggers>
- <i:EventTrigger EventName="PreviewMouseUp">
- <i:InvokeCommandAction
- Command="{Binding AddFilesCommand}"
- CommandParameter="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type ComboBoxItem}},Path=Tag}"
- PassEventArgsToCommand="True" />
- </i:EventTrigger>
- </i:Interaction.Triggers>
- </ComboBoxItem>
- </ComboBox>
- <Button Grid.Column="1" Grid.Row="5" Content="Clear" HorizontalAlignment="Right" VerticalAlignment="Bottom" Width="80" Height="32" Style="{StaticResource btn.sec}" Command="{Binding ClearCommand}"/>
- <StackPanel Grid.Column="2" Grid.RowSpan="2" Grid.Row="4" HorizontalAlignment="Center" VerticalAlignment="Bottom">
- <Button x:Name="BtnMerge" Content="Merge" Width="80" Height="32" Style="{StaticResource Btn.cta}" Command="{Binding MergeCommand}" IsEnabled="{Binding ElementName=NoFileStackPanel,Path=Visibility,Converter={StaticResource UnVisibleToBoolConvert}}"/>
- <Button Content="Cancel" Width="80" Height="32" Style="{StaticResource btn.sec}" Command="{Binding CancelCommand}"/>
- </StackPanel>
- </Grid>
- </UserControl>
|