Browse Source

页面编辑-补充自定义插入、拆分、提取的UI界面

ZhouJieSheng 2 years ago
parent
commit
a79b63bcfd

+ 76 - 11
PDF Office/Views/Dialog/PageEditDialogs/ExtractDialog.xaml

@@ -1,12 +1,77 @@
-<UserControl x:Class="PDF_Office.Views.Dialog.PageEditDialogs.ExtractDialog"
-             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" 
-             d:DesignHeight="450" d:DesignWidth="800">
-    <Grid>
-            
-    </Grid>
+<UserControl
+    x:Class="PDF_Office.Views.Dialog.PageEditDialogs.ExtractDialog"
+    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
+    xmlns:local="clr-namespace:PDF_Office.Views.Dialog.PageEditDialogs"
+    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
+    xmlns:prism="http://prismlibrary.com/"
+    Width="320"
+    Height="208"
+    d:DesignHeight="450"
+    d:DesignWidth="800"
+    prism:ViewModelLocator.AutoWireViewModel="True"
+    mc:Ignorable="d">
+    <prism:Dialog.WindowStyle>
+        <Style TargetType="{x:Type Window}">
+            <Setter Property="WindowStyle" Value="None" />
+            <Setter Property="prism:Dialog.WindowStartupLocation" Value="CenterOwner" />
+        </Style>
+    </prism:Dialog.WindowStyle>
+    <Border Background="White" CornerRadius="8">
+        <Grid>
+            <Grid.RowDefinitions>
+                <RowDefinition Height="48" />
+                <RowDefinition />
+                <RowDefinition Height="64" />
+            </Grid.RowDefinitions>
+
+            <Border
+                Height="48"
+                VerticalAlignment="Center"
+                BorderThickness="0,0,0,1">
+                <Border.BorderBrush>
+                    <SolidColorBrush Opacity="0.8" Color="White" />
+                </Border.BorderBrush>
+                <TextBlock
+                    Margin="16,0"
+                    VerticalAlignment="Center"
+                    FontSize="16"
+                    FontWeight="SemiBold"
+                    Text="提取页面" />
+            </Border>
+
+            <StackPanel
+                Grid.Row="1"
+                Margin="16,0"
+                HorizontalAlignment="Center">
+                <CheckBox
+                    Margin="0,18"
+                    VerticalAlignment="Center"
+                    Content="每个页面作为单独页面"
+                    FontSize="14" />
+                <CheckBox Content="提取后删除页面" FontSize="14" />
+            </StackPanel>
+            <Border Grid.Row="2" BorderThickness="0,1,0,0">
+                <Border.BorderBrush>
+                    <SolidColorBrush Opacity="0.8" Color="White" />
+                </Border.BorderBrush>
+                <Grid>
+                    <Button
+                        Width="98"
+                        Height="32"
+                        Margin="0,0,124,0"
+                        HorizontalAlignment="Right"
+                        Content="取消"
+                        Visibility="Visible" />
+                    <Button
+                        Width="98"
+                        Height="32"
+                        Margin="16,0"
+                        HorizontalAlignment="Right"
+                        Content="插入" />
+                </Grid>
+            </Border>
+        </Grid>
+    </Border>
 </UserControl>

+ 103 - 11
PDF Office/Views/Dialog/PageEditDialogs/InsertDialog.xaml

@@ -1,12 +1,104 @@
-<UserControl x:Class="PDF_Office.Views.Dialog.PageEditDialogs.InsertDialog"
-             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" 
-             d:DesignHeight="450" d:DesignWidth="800">
-    <Grid>
-            
-    </Grid>
+<UserControl
+    x:Class="PDF_Office.Views.Dialog.PageEditDialogs.InsertDialog"
+    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
+    xmlns:local="clr-namespace:PDF_Office.Views.Dialog.PageEditDialogs"
+    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
+    xmlns:prism="http://prismlibrary.com/"
+    Width="480"
+    Height="472"
+    d:DesignHeight="450"
+    d:DesignWidth="800"
+    prism:ViewModelLocator.AutoWireViewModel="True"
+    mc:Ignorable="d">
+    <prism:Dialog.WindowStyle>
+        <Style TargetType="{x:Type Window}">
+            <Setter Property="WindowStyle" Value="None" />
+            <Setter Property="prism:Dialog.WindowStartupLocation" Value="CenterOwner" />
+        </Style>
+    </prism:Dialog.WindowStyle>
+    <Border Background="White" CornerRadius="8">
+        <Grid>
+            <Grid.RowDefinitions>
+                <RowDefinition Height="48" />
+                <RowDefinition />
+                <RowDefinition Height="auto" />
+                <RowDefinition Height="auto" />
+                <RowDefinition Height="64" />
+            </Grid.RowDefinitions>
+
+            <Border
+                VerticalAlignment="Center"
+                BorderThickness="0,0,0,1"
+                MouseMove="Border_MouseMove">
+                <Border.BorderBrush>
+                    <SolidColorBrush Opacity="0.8" Color="White" />
+                </Border.BorderBrush>
+                <TextBlock
+                    Margin="16,0"
+                    FontSize="16"
+                    FontWeight="SemiBold"
+                    Text="插入自定义页面" />
+            </Border>
+
+            <ListBox Grid.Row="1" />
+
+            <StackPanel Grid.Row="2" Margin="16,0">
+                <TextBlock
+                    FontSize="14"
+                    FontWeight="SemiBold"
+                    Text="页面大小" />
+                <RadioButton Margin="0,12,0,0" Content="当前页" />
+                <StackPanel Margin="0,12" Orientation="Horizontal">
+                    <RadioButton VerticalAlignment="Center" Content="标准" />
+                    <ComboBox Margin="8,0" />
+                </StackPanel>
+                <StackPanel Margin="0,0,0,12" Orientation="Horizontal">
+                    <RadioButton VerticalAlignment="Center" Content="自定义" />
+                    <TextBox
+                        Width="80"
+                        Height="32"
+                        Margin="8,0"
+                        VerticalAlignment="Center" />
+                    <TextBlock VerticalAlignment="Center" Text="X" />
+                    <TextBox
+                        Width="80"
+                        Height="32"
+                        Margin="8,0"
+                        VerticalAlignment="Center" />
+                    <ComboBox Width="80" />
+                </StackPanel>
+            </StackPanel>
+            <StackPanel Grid.Row="3" Margin="16,0">
+                <TextBlock
+                    FontSize="14"
+                    FontWeight="SemiBold"
+                    Text="方向" />
+                <StackPanel Orientation="Horizontal">
+                    <RadioButton Margin="0,12,0,16" Content="纵向页面" />
+                    <RadioButton Margin="24,12,0,16" Content="横向页面" />
+                </StackPanel>
+            </StackPanel>
+            <Border Grid.Row="4" BorderThickness="0,1,0,0">
+                <Border.BorderBrush>
+                    <SolidColorBrush Opacity="0.8" Color="White" />
+                </Border.BorderBrush>
+                <Grid>
+                    <Button
+                        Width="98"
+                        Height="32"
+                        Margin="124,0"
+                        HorizontalAlignment="Right"
+                        Content="取消" />
+                    <Button
+                        Width="98"
+                        Height="32"
+                        Margin="16,0"
+                        HorizontalAlignment="Right"
+                        Content="插入" />
+                </Grid>
+            </Border>
+        </Grid>
+    </Border>
 </UserControl>

+ 8 - 0
PDF Office/Views/Dialog/PageEditDialogs/InsertDialog.xaml.cs

@@ -24,5 +24,13 @@ namespace PDF_Office.Views.Dialog.PageEditDialogs
         {
             InitializeComponent();
         }
+
+        private void Border_MouseMove(object sender, MouseEventArgs e)
+        {
+            if(e.LeftButton== MouseButtonState.Pressed)
+            {
+                Window.GetWindow(this).DragMove();
+            }
+        }
     }
 }

+ 123 - 11
PDF Office/Views/Dialog/PageEditDialogs/SplitDialog.xaml

@@ -1,12 +1,124 @@
-<UserControl x:Class="PDF_Office.Views.Dialog.PageEditDialogs.SplitDialog"
-             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" 
-             d:DesignHeight="450" d:DesignWidth="800">
-    <Grid>
-            
-    </Grid>
+<UserControl
+    x:Class="PDF_Office.Views.Dialog.PageEditDialogs.SplitDialog"
+    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
+    xmlns:local="clr-namespace:PDF_Office.Views.Dialog.PageEditDialogs"
+    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
+    xmlns:prism="http://prismlibrary.com/"
+    Width="480"
+    Height="481"
+    d:DesignHeight="450"
+    d:DesignWidth="800"
+    prism:ViewModelLocator.AutoWireViewModel="True"
+    mc:Ignorable="d">
+    <prism:Dialog.WindowStyle>
+        <Style TargetType="{x:Type Window}">
+            <Setter Property="WindowStyle" Value="None" />
+            <Setter Property="prism:Dialog.WindowStartupLocation" Value="CenterOwner" />
+        </Style>
+    </prism:Dialog.WindowStyle>
+    <Border Background="White" CornerRadius="8">
+        <Grid>
+            <Grid.RowDefinitions>
+                <RowDefinition Height="48" />
+                <RowDefinition Height="*" />
+                <RowDefinition Height="auto" />
+                <RowDefinition Height="64" />
+            </Grid.RowDefinitions>
+
+            <Border VerticalAlignment="Center" BorderThickness="0,0,0,1">
+                <Border.BorderBrush>
+                    <SolidColorBrush Opacity="0.8" Color="White" />
+                </Border.BorderBrush>
+                <TextBlock
+                    Margin="16,0"
+                    FontSize="16"
+                    FontWeight="SemiBold"
+                    Text="拆分页面" />
+            </Border>
+
+            <StackPanel Grid.Row="1" Margin="16,0">
+                <TextBlock
+                    FontSize="14"
+                    FontWeight="SemiBold"
+                    Text="拆分方式" />
+                <StackPanel Orientation="Horizontal">
+                    <RadioButton Margin="0,12,0,0" Content="平均每" />
+                    <TextBox
+                        Width="110"
+                        Height="32"
+                        Margin="8,0" />
+                    <TextBlock VerticalAlignment="Center" Text="页拆分为一个PDF文件" />
+                </StackPanel>
+                <StackPanel Margin="0,12" Orientation="Horizontal">
+                    <RadioButton VerticalAlignment="Center" Content="平均拆分为" />
+                    <ComboBox Width="110" Margin="8,0" />
+                    <TextBlock VerticalAlignment="Center" Text="个PDF文件" />
+                </StackPanel>
+                <StackPanel Margin="0,0,0,12" Orientation="Horizontal">
+                    <RadioButton VerticalAlignment="Center" Content="按页面范围拆分" />
+                    <ComboBox Width="110" Margin="8,0" />
+                </StackPanel>
+            </StackPanel>
+            <StackPanel Grid.Row="2" Margin="16,0">
+                <TextBlock
+                    FontSize="14"
+                    FontWeight="SemiBold"
+                    Text="文档命名" />
+                <TextBox
+                    Width="346"
+                    Height="32"
+                    HorizontalAlignment="Left" />
+                <CheckBox Margin="0,6" Content="将原始文档名前置" />
+
+
+                <StackPanel Orientation="Horizontal">
+                    <CheckBox
+                        Width="{Binding ElementName=ChkSeparator, Path=ActualWidth}"
+                        Margin="0,6"
+                        Content="标签" />
+                    <TextBox
+                        Width="110"
+                        Height="32"
+                        Margin="16,0" />
+                </StackPanel>
+                <StackPanel Orientation="Horizontal">
+                    <CheckBox
+                        Name="ChkSeparator"
+                        Margin="0,6"
+                        Content="分隔符" />
+                    <TextBox
+                        Width="110"
+                        Height="32"
+                        Margin="16,0" />
+                </StackPanel>
+
+
+                <StackPanel Orientation="Horizontal">
+                    <RadioButton Margin="0,12,0,16" Content="纵向页面" />
+                    <RadioButton Margin="24,12,0,16" Content="横向页面" />
+                </StackPanel>
+            </StackPanel>
+            <Border Grid.Row="3" BorderThickness="0,1,0,0">
+                <Border.BorderBrush>
+                    <SolidColorBrush Opacity="0.8" Color="White" />
+                </Border.BorderBrush>
+                <Grid>
+                    <Button
+                        Width="98"
+                        Height="32"
+                        Margin="124,0"
+                        HorizontalAlignment="Right"
+                        Content="取消" />
+                    <Button
+                        Width="98"
+                        Height="32"
+                        Margin="16,0"
+                        HorizontalAlignment="Right"
+                        Content="插入" />
+                </Grid>
+            </Border>
+        </Grid>
+    </Border>
 </UserControl>

+ 5 - 0
PDF Office/Views/Dialog/PageEditDialogs/SplitDialog.xaml.cs

@@ -24,5 +24,10 @@ namespace PDF_Office.Views.Dialog.PageEditDialogs
         {
             InitializeComponent();
         }
+
+        private void CheckBox_Checked(object sender, RoutedEventArgs e)
+        {
+
+        }
     }
 }