MergeDialog.xaml 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152
  1. <UserControl x:Class="PDF_Office.Views.Dialog.ToolsDialogs.MergeDialog"
  2. xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  3. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  4. xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  5. xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  6. xmlns:local="clr-namespace:PDF_Office.Views.Dialog.PageEditDialogs"
  7. mc:Ignorable="d"
  8. 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}"
  9. prism:Dialog.WindowStyle="{StaticResource DialogWindowStyle}"
  10. Height="596" Width="947">
  11. <UserControl.Resources>
  12. <dataconvert:IndexConverter x:Key="IndexConverter"/>
  13. <dataconvert:BoolToVisible x:Key="BoolToVisible" />
  14. </UserControl.Resources>
  15. <Grid Background="#FFFFFF">
  16. <Grid.ColumnDefinitions>
  17. <ColumnDefinition Width="8"/>
  18. <ColumnDefinition Width="*"/>
  19. <ColumnDefinition Width="8"/>
  20. <ColumnDefinition Width="*"/>
  21. <ColumnDefinition Width="8"/>
  22. </Grid.ColumnDefinitions>
  23. <Grid.RowDefinitions>
  24. <RowDefinition Height="8"/>
  25. <RowDefinition Height="*"/>
  26. <RowDefinition Height="8"/>
  27. <RowDefinition Height="*"/>
  28. <RowDefinition Height="16"/>
  29. <RowDefinition Height="*"/>
  30. <RowDefinition Height="8"/>
  31. </Grid.RowDefinitions>
  32. <Button Grid.Column="1" Grid.Row="1" Content="Add Files" Width="80" Height="32" HorizontalAlignment="Center" VerticalAlignment="Center" Style="{StaticResource btn.sec}" Command="{Binding AddFilesCommand}"/>
  33. <Border Grid.Column="1" Grid.Row="3">
  34. <Grid >
  35. <ListView x:Name="MergeView" AllowDrop="True"
  36. Drop="MergeView_Drop"
  37. DragEnter="MergeView_DragEnter"
  38. DragOver="MergeView_DragOver"
  39. DragLeave="MergeView_DragLeave"
  40. PreviewMouseMove="MergeView_PreviewMouseMove"
  41. ItemsSource="{Binding MergeObjectlist}"
  42. ScrollViewer.HorizontalScrollBarVisibility="Disabled"
  43. HorizontalContentAlignment="Stretch">
  44. <ListView.ItemTemplate>
  45. <DataTemplate >
  46. <Grid x:Name="ContentPanel" >
  47. <Grid.ColumnDefinitions>
  48. <ColumnDefinition Width="*"/>
  49. <ColumnDefinition Width="*"/>
  50. <ColumnDefinition Width="*"/>
  51. <ColumnDefinition Width="*"/>
  52. <ColumnDefinition Width="*"/>
  53. </Grid.ColumnDefinitions>
  54. <TextBlock Text="{Binding RelativeSource={RelativeSource FindAncestor,
  55. AncestorType={x:Type ListViewItem}},
  56. Converter={StaticResource IndexConverter}}"
  57. VerticalAlignment="Center" HorizontalAlignment="Center"/>
  58. <Image Grid.Column="1" Width="50" Height="50" HorizontalAlignment="Center" VerticalAlignment="Center" Source="{Binding DocThumbnail}" Stretch="Uniform" />
  59. <StackPanel Grid.Column="2">
  60. <TextBlock Text="{Binding DocName}" HorizontalAlignment="Left" VerticalAlignment="Top"/>
  61. <TextBlock Text="{Binding DocSize}" HorizontalAlignment="Left" VerticalAlignment="Top"/>
  62. <TextBlock Text="{Binding DocPageCount}" HorizontalAlignment="Left" VerticalAlignment="Top"/>
  63. </StackPanel>
  64. <StackPanel Grid.Column="3" HorizontalAlignment="Center" VerticalAlignment="Center">
  65. <customcontrol:WritableComboBox SelectedIndex="0" MaxPageRange="{Binding SDKPageCount}" Text="{Binding SetPageRange,Mode=TwoWay}"/>
  66. </StackPanel>
  67. <StackPanel Grid.Column="4" VerticalAlignment="Center">
  68. <Button Content="删除" Click="Delete_Click"/>
  69. </StackPanel>
  70. <StackPanel Grid.ColumnSpan="5" Visibility="{Binding IsForward, Converter={StaticResource BoolToVisible}}" Orientation="Horizontal" HorizontalAlignment="Stretch" VerticalAlignment="Bottom">
  71. <Line Margin="0,0,0,0" X1="0" X2="{Binding ElementName=ContentPanel,Path=ActualWidth}" HorizontalAlignment="Stretch" StrokeThickness="1.5" Stroke="#FF0078D7" VerticalAlignment="Bottom"/>
  72. </StackPanel>
  73. <StackPanel Grid.ColumnSpan="5" Visibility="{Binding IsBackwards, Converter={StaticResource BoolToVisible}}" Orientation="Horizontal" HorizontalAlignment="Stretch" VerticalAlignment="Top">
  74. <Line X1="0" X2="{Binding ElementName=ContentPanel,Path=ActualWidth}" HorizontalAlignment="Stretch" StrokeThickness="1.5" Stroke="Red" VerticalAlignment="Bottom"/>
  75. </StackPanel>
  76. </Grid>
  77. </DataTemplate>
  78. </ListView.ItemTemplate>
  79. </ListView>
  80. </Grid>
  81. </Border>
  82. <Border Grid.Column="3" Grid.Row="3">
  83. <Grid>
  84. <Grid.RowDefinitions>
  85. <RowDefinition Height="20"/>
  86. <RowDefinition Height="*"/>
  87. </Grid.RowDefinitions>
  88. <TextBlock Text=" Page Size"/>
  89. <StackPanel Grid.Row="1">
  90. <RadioButton Content="Original page size" Tag="0">
  91. <i:Interaction.Triggers>
  92. <i:EventTrigger EventName="Checked">
  93. <i:InvokeCommandAction Command="{Binding SetPageSizeTypeCommand}" CommandParameter="{Binding RelativeSource={RelativeSource AncestorType=RadioButton}}" PassEventArgsToCommand="True" />
  94. </i:EventTrigger>
  95. </i:Interaction.Triggers>
  96. </RadioButton>
  97. <RadioButton Content="A4" Tag="1">
  98. <i:Interaction.Triggers>
  99. <i:EventTrigger EventName="Checked">
  100. <i:InvokeCommandAction Command="{Binding SetPageSizeTypeCommand}" CommandParameter="{Binding RelativeSource={RelativeSource AncestorType=RadioButton}}" PassEventArgsToCommand="True" />
  101. </i:EventTrigger>
  102. </i:Interaction.Triggers>
  103. </RadioButton>
  104. <RadioButton Content="A3" Tag="2">
  105. <i:Interaction.Triggers>
  106. <i:EventTrigger EventName="Checked">
  107. <i:InvokeCommandAction Command="{Binding SetPageSizeTypeCommand}" CommandParameter="{Binding RelativeSource={RelativeSource AncestorType=RadioButton}}" PassEventArgsToCommand="True" />
  108. </i:EventTrigger>
  109. </i:Interaction.Triggers>
  110. </RadioButton>
  111. <RadioButton Content="U.S.Letter" Tag="3">
  112. <i:Interaction.Triggers>
  113. <i:EventTrigger EventName="Checked">
  114. <i:InvokeCommandAction Command="{Binding SetPageSizeTypeCommand}" CommandParameter="{Binding RelativeSource={RelativeSource AncestorType=RadioButton}}" PassEventArgsToCommand="True" />
  115. </i:EventTrigger>
  116. </i:Interaction.Triggers>
  117. </RadioButton>
  118. <RadioButton Content="U.S.Legal" Tag="4">
  119. <i:Interaction.Triggers>
  120. <i:EventTrigger EventName="Checked">
  121. <i:InvokeCommandAction Command="{Binding SetPageSizeTypeCommand}" CommandParameter="{Binding RelativeSource={RelativeSource AncestorType=RadioButton}}" PassEventArgsToCommand="True" />
  122. </i:EventTrigger>
  123. </i:Interaction.Triggers>
  124. </RadioButton>
  125. <RadioButton x:Name="Customized" Content="Customized" Tag="5">
  126. <i:Interaction.Triggers>
  127. <i:EventTrigger EventName="Checked">
  128. <i:InvokeCommandAction Command="{Binding SetPageSizeTypeCommand}" CommandParameter="{Binding RelativeSource={RelativeSource AncestorType=RadioButton}}" PassEventArgsToCommand="True" />
  129. </i:EventTrigger>
  130. </i:Interaction.Triggers>
  131. </RadioButton>
  132. <Grid IsEnabled="{Binding ElementName=Customized, Path=IsChecked}">
  133. <Grid.ColumnDefinitions>
  134. <ColumnDefinition Width="*"/>
  135. <ColumnDefinition Width="20"/>
  136. <ColumnDefinition Width="*"/>
  137. </Grid.ColumnDefinitions>
  138. <customcontrol:TextBoxEx PreviewKeyDown="TextBoxEx_PreviewKeyDown" x:Name="TextWidth" PlaceholderText="595" Text="{Binding InputWidth,Mode=TwoWay}" PreviewTextInput="TextBox_PreviewTextInput" LostFocus="TextBoxEx_LostFocus"/>
  139. <TextBlock Text="X" Grid.Column="1" HorizontalAlignment="Center" VerticalAlignment="Center"/>
  140. <customcontrol:TextBoxEx PreviewKeyDown="TextBoxEx_PreviewKeyDown" x:Name="TextHeight" PlaceholderText="841" Grid.Column="2" Text="{Binding InputHeight,Mode=TwoWay}" PreviewTextInput="TextBox_PreviewTextInput" LostFocus="TextBoxEx_LostFocus"/>
  141. </Grid>
  142. </StackPanel>
  143. </Grid>
  144. </Border>
  145. <Button Grid.Column="3" Grid.Row="5" Content="Clear" HorizontalAlignment="Left" VerticalAlignment="Bottom" Width="80" Height="32" Style="{StaticResource btn.sec}" Command="{Binding ClearCommand}"/>
  146. <StackPanel Grid.Column="3" Grid.Row="5" Orientation="Horizontal" HorizontalAlignment="Right" VerticalAlignment="Bottom">
  147. <Button Content="Cancel" Width="80" Height="32" Style="{StaticResource btn.sec}" Command="{Binding CancelCommand}"/>
  148. <Button x:Name="BtnAdd" Content="Add" Width="80" Height="32" Margin="16,0,0,0" Style="{StaticResource Btn.cta}" Command="{Binding MergeCommand}"/>
  149. </StackPanel>
  150. </Grid>
  151. </UserControl>