MergeDialog.xaml 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151
  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. DragOver="MergeView_DragOver"
  38. DragLeave="MergeView_DragLeave"
  39. PreviewMouseMove="MergeView_PreviewMouseMove"
  40. ItemsSource="{Binding MergeObjectlist}"
  41. ScrollViewer.HorizontalScrollBarVisibility="Disabled"
  42. HorizontalContentAlignment="Stretch">
  43. <ListView.ItemTemplate>
  44. <DataTemplate >
  45. <Grid x:Name="ContentPanel" >
  46. <Grid.ColumnDefinitions>
  47. <ColumnDefinition Width="*"/>
  48. <ColumnDefinition Width="*"/>
  49. <ColumnDefinition Width="*"/>
  50. <ColumnDefinition Width="*"/>
  51. <ColumnDefinition Width="*"/>
  52. </Grid.ColumnDefinitions>
  53. <TextBlock Text="{Binding RelativeSource={RelativeSource FindAncestor,
  54. AncestorType={x:Type ListViewItem}},
  55. Converter={StaticResource IndexConverter}}"
  56. VerticalAlignment="Center" HorizontalAlignment="Center"/>
  57. <Image Grid.Column="1" Width="50" Height="50" HorizontalAlignment="Center" VerticalAlignment="Center" Source="pack://application:,,,/PDF Office;component/Resources/Dialog/AddImage.png" />
  58. <StackPanel Grid.Column="2">
  59. <TextBlock Text="{Binding DocName}" HorizontalAlignment="Left" VerticalAlignment="Top"/>
  60. <TextBlock Text="{Binding DocSize}" HorizontalAlignment="Left" VerticalAlignment="Top"/>
  61. <TextBlock Text="{Binding DocPageCount}" HorizontalAlignment="Left" VerticalAlignment="Top"/>
  62. </StackPanel>
  63. <StackPanel Grid.Column="3" HorizontalAlignment="Center" VerticalAlignment="Center">
  64. <customcontrol:WritableComboBox SelectedIndex="0"/>
  65. </StackPanel>
  66. <StackPanel Grid.Column="4" VerticalAlignment="Center">
  67. <Button Content="删除" Click="Delete_Click"/>
  68. </StackPanel>
  69. <StackPanel Grid.ColumnSpan="5" Visibility="{Binding IsForward, Converter={StaticResource BoolToVisible}}" Orientation="Horizontal" HorizontalAlignment="Stretch" VerticalAlignment="Bottom">
  70. <Line Margin="0,0,0,0" X1="0" X2="{Binding ElementName=ContentPanel,Path=ActualWidth}" HorizontalAlignment="Stretch" StrokeThickness="1.5" Stroke="#FF0078D7" VerticalAlignment="Bottom"/>
  71. </StackPanel>
  72. <StackPanel Grid.ColumnSpan="5" Visibility="{Binding IsBackwards, Converter={StaticResource BoolToVisible}}" Orientation="Horizontal" HorizontalAlignment="Stretch" VerticalAlignment="Top">
  73. <Line X1="0" X2="{Binding ElementName=ContentPanel,Path=ActualWidth}" HorizontalAlignment="Stretch" StrokeThickness="1.5" Stroke="Red" VerticalAlignment="Bottom"/>
  74. </StackPanel>
  75. </Grid>
  76. </DataTemplate>
  77. </ListView.ItemTemplate>
  78. </ListView>
  79. </Grid>
  80. </Border>
  81. <Border Grid.Column="3" Grid.Row="3">
  82. <Grid>
  83. <Grid.RowDefinitions>
  84. <RowDefinition Height="20"/>
  85. <RowDefinition Height="*"/>
  86. </Grid.RowDefinitions>
  87. <TextBlock Text=" Page Size"/>
  88. <StackPanel Grid.Row="1">
  89. <RadioButton Content="Original page size" Tag="0">
  90. <i:Interaction.Triggers>
  91. <i:EventTrigger EventName="Checked">
  92. <i:InvokeCommandAction Command="{Binding SetPageSizeTypeCommand}" CommandParameter="{Binding RelativeSource={RelativeSource AncestorType=RadioButton}}" PassEventArgsToCommand="True" />
  93. </i:EventTrigger>
  94. </i:Interaction.Triggers>
  95. </RadioButton>
  96. <RadioButton Content="A4" Tag="1">
  97. <i:Interaction.Triggers>
  98. <i:EventTrigger EventName="Checked">
  99. <i:InvokeCommandAction Command="{Binding SetPageSizeTypeCommand}" CommandParameter="{Binding RelativeSource={RelativeSource AncestorType=RadioButton}}" PassEventArgsToCommand="True" />
  100. </i:EventTrigger>
  101. </i:Interaction.Triggers>
  102. </RadioButton>
  103. <RadioButton Content="A3" Tag="2">
  104. <i:Interaction.Triggers>
  105. <i:EventTrigger EventName="Checked">
  106. <i:InvokeCommandAction Command="{Binding SetPageSizeTypeCommand}" CommandParameter="{Binding RelativeSource={RelativeSource AncestorType=RadioButton}}" PassEventArgsToCommand="True" />
  107. </i:EventTrigger>
  108. </i:Interaction.Triggers>
  109. </RadioButton>
  110. <RadioButton Content="U.S.Letter" Tag="3">
  111. <i:Interaction.Triggers>
  112. <i:EventTrigger EventName="Checked">
  113. <i:InvokeCommandAction Command="{Binding SetPageSizeTypeCommand}" CommandParameter="{Binding RelativeSource={RelativeSource AncestorType=RadioButton}}" PassEventArgsToCommand="True" />
  114. </i:EventTrigger>
  115. </i:Interaction.Triggers>
  116. </RadioButton>
  117. <RadioButton Content="U.S.Legal" Tag="4">
  118. <i:Interaction.Triggers>
  119. <i:EventTrigger EventName="Checked">
  120. <i:InvokeCommandAction Command="{Binding SetPageSizeTypeCommand}" CommandParameter="{Binding RelativeSource={RelativeSource AncestorType=RadioButton}}" PassEventArgsToCommand="True" />
  121. </i:EventTrigger>
  122. </i:Interaction.Triggers>
  123. </RadioButton>
  124. <RadioButton x:Name="Customized" Content="Customized" Tag="5">
  125. <i:Interaction.Triggers>
  126. <i:EventTrigger EventName="Checked">
  127. <i:InvokeCommandAction Command="{Binding SetPageSizeTypeCommand}" CommandParameter="{Binding RelativeSource={RelativeSource AncestorType=RadioButton}}" PassEventArgsToCommand="True" />
  128. </i:EventTrigger>
  129. </i:Interaction.Triggers>
  130. </RadioButton>
  131. <Grid IsEnabled="{Binding ElementName=Customized, Path=IsChecked}">
  132. <Grid.ColumnDefinitions>
  133. <ColumnDefinition Width="*"/>
  134. <ColumnDefinition Width="20"/>
  135. <ColumnDefinition Width="*"/>
  136. </Grid.ColumnDefinitions>
  137. <customcontrol:TextBoxEx PlaceholderText="595"/>
  138. <TextBlock Text="X" Grid.Column="1" HorizontalAlignment="Center" VerticalAlignment="Center"/>
  139. <customcontrol:TextBoxEx PlaceholderText="841" Grid.Column="2"/>
  140. </Grid>
  141. </StackPanel>
  142. </Grid>
  143. </Border>
  144. <Button Grid.Column="3" Grid.Row="5" Content="Clear" HorizontalAlignment="Left" VerticalAlignment="Bottom" Width="80" Height="32" Style="{StaticResource btn.sec}" Command="{Binding ClearCommand}"/>
  145. <StackPanel Grid.Column="3" Grid.Row="5" Orientation="Horizontal" HorizontalAlignment="Right" VerticalAlignment="Bottom">
  146. <Button Content="Cancel" Width="80" Height="32" Style="{StaticResource btn.sec}" Command="{Binding CancelCommand}"/>
  147. <Button Content="Add" Width="80" Height="32" Margin="16,0,0,0" Style="{StaticResource Btn.cta}" Command="{Binding MergeCommand}"/>
  148. </StackPanel>
  149. </Grid>
  150. </UserControl>