Browse Source

Merge branch 'dev' of http://git.kdan.cc:8865/Windows/PDFOffice_Windows_exe into dev

# Conflicts:
#	PDF Office/SDKLisence.xml
ZhouJieSheng 2 years ago
parent
commit
e4bff24bf7
29 changed files with 4174 additions and 2997 deletions
  1. 12 0
      PDF Office/CustomControl/BatchStatus.xaml
  2. 28 0
      PDF Office/CustomControl/BatchStatus.xaml.cs
  3. 1 1
      PDF Office/Helper/ToolMethod.cs
  4. 2321 2321
      PDF Office/PDF Office.csproj
  5. 2 2
      PDF Office/Styles/ButtonStyle.xaml
  6. 377 0
      PDF Office/Styles/ToggleButton.xaml
  7. 18 0
      PDF Office/Styles/WindowsStyle.xaml
  8. 3 0
      PDF Office/ViewModels/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageBates/HomePageBatesCreateContentViewModel.cs
  9. 567 562
      PDF Office/ViewModels/Dialog/HomePageToolsDialogs/HomePagePrinter/HomePagePrinterDocumentContentViewModel.cs
  10. 2 3
      PDF Office/ViewModels/EditTools/Background/BackgroundCreateColorContentViewModel.cs
  11. 10 4
      PDF Office/ViewModels/EditTools/Background/BackgroundCreateFileContentViewModel.cs
  12. 2 0
      PDF Office/ViewModels/EditTools/Background/BackgroundDocumentContentViewModel.cs
  13. 11 6
      PDF Office/ViewModels/EditTools/Bates/BatesCreateContentViewModel.cs
  14. 2 3
      PDF Office/ViewModels/EditTools/HeaderFooter/HeaderFooterCreateContentViewModel.cs
  15. 2 3
      PDF Office/ViewModels/EditTools/Watermark/WatermarkCreateFileContentViewModel.cs
  16. 2 3
      PDF Office/ViewModels/EditTools/Watermark/WatermarkCreateTextContentViewModel.cs
  17. 8 6
      PDF Office/ViewModels/ViewContentViewModel.cs
  18. 737 77
      PDF Office/Views/Dialog/InfoDialog.xaml
  19. 23 1
      PDF Office/Views/Dialog/InfoDialog.xaml.cs
  20. 7 1
      PDF Office/Views/EditTools/Background/BackgroundTemplateListColorContent.xaml
  21. 1 1
      PDF Office/Views/EditTools/Background/BackgroundTemplateListColorContent.xaml.cs
  22. 7 0
      PDF Office/Views/EditTools/Background/BackgroundTemplateListFileContent.xaml
  23. 1 1
      PDF Office/Views/EditTools/Background/BackgroundTemplateListFileContent.xaml.cs
  24. 7 0
      PDF Office/Views/EditTools/Bates/BatesTemplateListContent.xaml
  25. 7 0
      PDF Office/Views/EditTools/HeaderFooter/HeaderFooterTemplateListContent.xaml
  26. 7 0
      PDF Office/Views/EditTools/Watermark/WatermarkTemplateListFileContent.xaml
  27. 1 1
      PDF Office/Views/EditTools/Watermark/WatermarkTemplateListFileContent.xaml.cs
  28. 7 0
      PDF Office/Views/EditTools/Watermark/WatermarkTemplateListTextContent.xaml
  29. 1 1
      PDF Office/Views/EditTools/Watermark/WatermarkTemplateListTextContent.xaml.cs

+ 12 - 0
PDF Office/CustomControl/BatchStatus.xaml

@@ -0,0 +1,12 @@
+<UserControl x:Class="PDF_Office.CustomControl.BatchStatus"
+             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.CustomControl"
+             mc:Ignorable="d" 
+             d:DesignHeight="450" d:DesignWidth="800">
+    <Grid>
+            
+    </Grid>
+</UserControl>

+ 28 - 0
PDF Office/CustomControl/BatchStatus.xaml.cs

@@ -0,0 +1,28 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Data;
+using System.Windows.Documents;
+using System.Windows.Input;
+using System.Windows.Media;
+using System.Windows.Media.Imaging;
+using System.Windows.Navigation;
+using System.Windows.Shapes;
+
+namespace PDF_Office.CustomControl
+{
+    /// <summary>
+    /// BatchStatus.xaml 的交互逻辑
+    /// </summary>
+    public partial class BatchStatus : UserControl
+    {
+        public BatchStatus()
+        {
+            InitializeComponent();
+        }
+    }
+}

+ 1 - 1
PDF Office/Helper/ToolMethod.cs

@@ -55,7 +55,7 @@ namespace PDF_Office.Helper
                 return null;
             }
 
-            Bitmap bitmap = new Bitmap((int)width, (int)height, PixelFormat.Format32bppArgb);
+            Bitmap bitmap = new Bitmap(width, height, PixelFormat.Format32bppArgb);
             BitmapData bitmapData = bitmap.LockBits(new Rectangle(0, 0, (int)width, (int)height), ImageLockMode.ReadWrite, bitmap.PixelFormat);
             try
             {

File diff suppressed because it is too large
+ 2321 - 2321
PDF Office/PDF Office.csproj


+ 2 - 2
PDF Office/Styles/ButtonStyle.xaml

@@ -390,8 +390,8 @@
     </ControlTemplate>
 
     <!--
-        Style for Btn.cta
-        样式里仅设置了背景色和文字颜色变化,字体大小和控件宽度需要调用时设置
+    Style for Btn.cta
+    样式里仅设置了背景色和文字颜色变化,字体大小和控件宽度需要调用时设置
     -->
     <Style x:Key="Btn.cta" TargetType="{x:Type Button}">
         <Setter Property="FocusVisualStyle" Value="{x:Null}" />

+ 377 - 0
PDF Office/Styles/ToggleButton.xaml

@@ -46,4 +46,381 @@
             </Setter.Value>
         </Setter>
     </Style>
+    <Style x:Key="infoText1" TargetType="{x:Type ToggleButton}">
+        <Setter Property="Background" Value="{StaticResource color.btn.sec.bg.norm}" />
+        <Setter Property="Foreground" Value="{StaticResource color.btn.sec.text.def}" />
+        <Setter Property="BorderBrush" Value="{StaticResource color.btn.sec.border-color}" />
+        <Setter Property="BorderThickness" Value="0" />
+        <Setter Property="Template">
+            <Setter.Value>
+                <ControlTemplate TargetType="{x:Type ToggleButton}">
+                    <Border
+                        x:Name="border"
+                        Background="{TemplateBinding Panel.Background}"
+                        BorderBrush="{TemplateBinding Border.BorderBrush}"
+                        BorderThickness="{TemplateBinding Border.BorderThickness}"
+                        CornerRadius="{StaticResource border-radius.4}"
+                        SnapsToDevicePixels="True">
+                        <Grid x:Name="grid" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="Center" HorizontalAlignment="Center">
+                            <StackPanel x:Name="state1" Visibility="Collapsed">
+                                <Rectangle
+                                    Width="14"
+                                    Height="1.5"
+                                    HorizontalAlignment="Left"
+                                    Fill="#252629" />
+                                <Rectangle
+                                    Width="8"
+                                    Height="1.5"
+                                    Margin="0,2.5"
+                                    HorizontalAlignment="Left"
+                                    Fill="#252629" />
+                                <Rectangle
+                                    Width="14"
+                                    Height="1.5"
+                                    Margin="0,0,0,2.5"
+                                    HorizontalAlignment="Left"
+                                    Fill="#252629" />
+                                <Rectangle
+                                    Width="8"
+                                    Height="1.5"
+                                    HorizontalAlignment="Left"
+                                    Fill="#252629" />
+                            </StackPanel>
+                            <StackPanel
+                                x:Name="state2"
+                                HorizontalAlignment="Center"
+                                VerticalAlignment="Center">
+                                <Rectangle
+                                    Width="14"
+                                    Height="1.5"
+                                    HorizontalAlignment="Left"
+                                    Fill="#616469" />
+                                <Rectangle
+                                    Width="8"
+                                    Height="1.5"
+                                    Margin="0,2.5"
+                                    HorizontalAlignment="Left"
+                                    Fill="#616469" />
+                                <Rectangle
+                                    Width="14"
+                                    Height="1.5"
+                                    Margin="0,0,0,2.5"
+                                    HorizontalAlignment="Left"
+                                    Fill="#616469" />
+                                <Rectangle
+                                    Width="8"
+                                    Height="1.5"
+                                    HorizontalAlignment="Left"
+                                    Fill="#616469" />
+                            </StackPanel>
+                        </Grid>
+                    </Border>
+                    <ControlTemplate.Triggers>
+                        <Trigger Property="IsMouseOver" Value="True">
+                            <Setter TargetName="state2" Property="Visibility" Value="Visible" />
+                            <Setter TargetName="state1" Property="Visibility" Value="Collapsed" />
+                            <Setter TargetName="border" Property="Background" Value="#EDEEF0" />
+                        </Trigger>
+                        <Trigger Property="IsChecked" Value="True">
+                            <Setter TargetName="state1" Property="Visibility" Value="Visible" />
+                            <Setter TargetName="state2" Property="Visibility" Value="Collapsed" />
+                            <Setter TargetName="border" Property="Background" Value="#CED0D4" />
+                            <!--<Setter TargetName="border" Property="BorderBrush" Value="{StaticResource color.btn.sec.border-color}" />
+                            <Setter TargetName="border" Property="BorderThickness" Value="{StaticResource border-width.1}" />-->
+                        </Trigger>
+                        <Trigger Property="IsEnabled" Value="False">
+                            <Setter TargetName="state1" Property="Visibility" Value="Collapsed" />
+                        </Trigger>
+                    </ControlTemplate.Triggers>
+                </ControlTemplate>
+            </Setter.Value>
+        </Setter>
+    </Style>
+
+    <Style x:Key="infoText2" TargetType="{x:Type ToggleButton}">
+        <Setter Property="Background" Value="{StaticResource color.btn.sec.bg.norm}" />
+        <Setter Property="Foreground" Value="{StaticResource color.btn.sec.text.def}" />
+        <Setter Property="BorderBrush" Value="{StaticResource color.btn.sec.border-color}" />
+        <Setter Property="BorderThickness" Value="0" />
+        <Setter Property="Template">
+            <Setter.Value>
+                <ControlTemplate TargetType="{x:Type ToggleButton}">
+                    <Border
+                        x:Name="border"
+                        Background="{TemplateBinding Panel.Background}"
+                        BorderBrush="{TemplateBinding Border.BorderBrush}"
+                        BorderThickness="{TemplateBinding Border.BorderThickness}"
+                        CornerRadius="{StaticResource border-radius.4}"
+                        SnapsToDevicePixels="True">
+                        <Grid
+                            x:Name="grid"
+                            SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="Center" HorizontalAlignment="Center">
+                            <StackPanel
+                                x:Name="state1"
+                                Visibility="Collapsed">
+                                <Rectangle
+                                    Width="14"
+                                    Height="1.5"
+                                    HorizontalAlignment="Center"
+                                    Fill="#252629" />
+                                <Rectangle
+                                    Width="8"
+                                    Height="1.5"
+                                    Margin="0,2.5"
+                                    HorizontalAlignment="Center"
+                                    Fill="#252629" />
+                                <Rectangle
+                                    Width="14"
+                                    Height="1.5"
+                                    Margin="0,0,0,2.5"
+                                    HorizontalAlignment="Center"
+                                    Fill="#252629" />
+                                <Rectangle
+                                    Width="8"
+                                    Height="1.5"
+                                    HorizontalAlignment="Center"
+                                    Fill="#252629" />
+                            </StackPanel>
+                            <StackPanel
+                                x:Name="state2"
+                                HorizontalAlignment="Center"
+                                VerticalAlignment="Center">
+                                <Rectangle
+                                    Width="14"
+                                    Height="1.5"
+                                    HorizontalAlignment="Center"
+                                    Fill="#616469" />
+                                <Rectangle
+                                    Width="8"
+                                    Height="1.5"
+                                    Margin="0,2.5"
+                                    HorizontalAlignment="Center"
+                                    Fill="#616469" />
+                                <Rectangle
+                                    Width="14"
+                                    Height="1.5"
+                                    Margin="0,0,0,2.5"
+                                    HorizontalAlignment="Center"
+                                    Fill="#616469" />
+                                <Rectangle
+                                    Width="8"
+                                    Height="1.5"
+                                    HorizontalAlignment="Center"
+                                    Fill="#616469" />
+                            </StackPanel>
+                        </Grid>
+                    </Border>
+                    <ControlTemplate.Triggers>
+                        <Trigger Property="IsMouseOver" Value="True">
+                            <Setter TargetName="state2" Property="Visibility" Value="Visible" />
+                            <Setter TargetName="state1" Property="Visibility" Value="Collapsed" />
+                            <Setter TargetName="border" Property="Background" Value="#EDEEF0" />
+                        </Trigger>
+                        <Trigger Property="IsChecked" Value="True">
+                            <Setter TargetName="state1" Property="Visibility" Value="Visible" />
+                            <Setter TargetName="state2" Property="Visibility" Value="Collapsed" />
+                            <Setter TargetName="border" Property="Background" Value="#CED0D4" />
+                            <!--<Setter TargetName="border" Property="BorderBrush" Value="{StaticResource color.btn.sec.border-color}" />
+                            <Setter TargetName="border" Property="BorderThickness" Value="{StaticResource border-width.1}" />-->
+                        </Trigger>
+                        <Trigger Property="IsEnabled" Value="False">
+                            <Setter TargetName="state1" Property="Visibility" Value="Collapsed" />
+                        </Trigger>
+                    </ControlTemplate.Triggers>
+                </ControlTemplate>
+            </Setter.Value>
+        </Setter>
+    </Style>
+
+    <Style x:Key="infoText3" TargetType="{x:Type ToggleButton}">
+        <Setter Property="Background" Value="{StaticResource color.btn.sec.bg.norm}" />
+        <Setter Property="Foreground" Value="{StaticResource color.btn.sec.text.def}" />
+        <Setter Property="BorderBrush" Value="{StaticResource color.btn.sec.border-color}" />
+        <Setter Property="BorderThickness" Value="0" />
+        <Setter Property="VerticalAlignment" Value="Center" />
+        <Setter Property="HorizontalAlignment" Value="Center" />
+        <Setter Property="Template">
+            <Setter.Value>
+                <ControlTemplate TargetType="{x:Type ToggleButton}">
+                    <Border
+                        x:Name="border"
+                        Background="{TemplateBinding Panel.Background}"
+                        BorderBrush="{TemplateBinding Border.BorderBrush}"
+                        BorderThickness="{TemplateBinding Border.BorderThickness}"
+                        CornerRadius="{StaticResource border-radius.4}"
+                        SnapsToDevicePixels="True">
+                        <Grid
+                            x:Name="grid"
+                            HorizontalAlignment="Center"
+                            VerticalAlignment="Center"
+                            SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}">
+                            <StackPanel
+                                x:Name="state1"
+                                HorizontalAlignment="Center"
+                                VerticalAlignment="Center"
+                                Visibility="Collapsed">
+                                <Rectangle
+                                    Width="14"
+                                    Height="1.5"
+                                    HorizontalAlignment="Right"
+                                    Fill="#252629" />
+                                <Rectangle
+                                    Width="8"
+                                    Height="1.5"
+                                    Margin="0,2.5"
+                                    HorizontalAlignment="Right"
+                                    Fill="#252629" />
+                                <Rectangle
+                                    Width="14"
+                                    Height="1.5"
+                                    Margin="0,0,0,2.5"
+                                    HorizontalAlignment="Right"
+                                    Fill="#252629" />
+                                <Rectangle
+                                    Width="8"
+                                    Height="1.5"
+                                    HorizontalAlignment="Right"
+                                    Fill="#252629" />
+                            </StackPanel>
+                            <StackPanel
+                                x:Name="state2"
+                                HorizontalAlignment="Center"
+                                VerticalAlignment="Center">
+                                <Rectangle
+                                    Width="14"
+                                    Height="1.5"
+                                    HorizontalAlignment="Right"
+                                    Fill="#616469" />
+                                <Rectangle
+                                    Width="8"
+                                    Height="1.5"
+                                    Margin="0,2.5"
+                                    HorizontalAlignment="Right"
+                                    Fill="#616469" />
+                                <Rectangle
+                                    Width="14"
+                                    Height="1.5"
+                                    Margin="0,0,0,2.5"
+                                    HorizontalAlignment="Right"
+                                    Fill="#616469" />
+                                <Rectangle
+                                    Width="8"
+                                    Height="1.5"
+                                    HorizontalAlignment="Right"
+                                    Fill="#616469" />
+                            </StackPanel>
+                        </Grid>
+                    </Border>
+                    <ControlTemplate.Triggers>
+                        <Trigger Property="IsMouseOver" Value="True">
+                            <Setter TargetName="state2" Property="Visibility" Value="Visible" />
+                            <Setter TargetName="state1" Property="Visibility" Value="Collapsed" />
+                            <Setter TargetName="border" Property="Background" Value="#EDEEF0" />
+                        </Trigger>
+                        <Trigger Property="IsChecked" Value="True">
+                            <Setter TargetName="state1" Property="Visibility" Value="Visible" />
+                            <Setter TargetName="state2" Property="Visibility" Value="Collapsed" />
+                            <Setter TargetName="border" Property="Background" Value="#CED0D4" />
+                            <!--<Setter TargetName="border" Property="BorderBrush" Value="{StaticResource color.btn.sec.border-color}" />
+                            <Setter TargetName="border" Property="BorderThickness" Value="{StaticResource border-width.1}" />-->
+                        </Trigger>
+                        <Trigger Property="IsEnabled" Value="False">
+                            <Setter TargetName="state1" Property="Visibility" Value="Collapsed" />
+                        </Trigger>
+                    </ControlTemplate.Triggers>
+                </ControlTemplate>
+            </Setter.Value>
+        </Setter>
+    </Style>
+
+    <Style x:Key="infoText4" TargetType="{x:Type ToggleButton}">
+        <Setter Property="Background" Value="{StaticResource color.btn.sec.bg.norm}" />
+        <Setter Property="Foreground" Value="{StaticResource color.btn.sec.text.def}" />
+        <Setter Property="BorderBrush" Value="{StaticResource color.btn.sec.border-color}" />
+        <Setter Property="BorderThickness" Value="0" />
+        <Setter Property="Template">
+            <Setter.Value>
+                <ControlTemplate TargetType="{x:Type ToggleButton}">
+                    <Border
+                        x:Name="border"
+                        Background="{TemplateBinding Panel.Background}"
+                        BorderBrush="{TemplateBinding Border.BorderBrush}"
+                        BorderThickness="{TemplateBinding Border.BorderThickness}"
+                        CornerRadius="{StaticResource border-radius.4}"
+                        SnapsToDevicePixels="True">
+                        <Grid x:Name="grid" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="Center" HorizontalAlignment="Center">
+                            <StackPanel x:Name="state1" Visibility="Collapsed">
+                                <Rectangle
+                                    Width="14"
+                                    Height="1.5"
+                                    HorizontalAlignment="Center"
+                                    Fill="#252629" />
+                                <Rectangle
+                                    Width="14"
+                                    Height="1.5"
+                                    Margin="0,2.5"
+                                    HorizontalAlignment="Center"
+                                    Fill="#252629" />
+                                <Rectangle
+                                    Width="14"
+                                    Height="1.5"
+                                    Margin="0,0,0,2.5"
+                                    HorizontalAlignment="Center"
+                                    Fill="#252629" />
+                                <Rectangle
+                                    Width="14"
+                                    Height="1.5"
+                                    HorizontalAlignment="Center"
+                                    Fill="#252629" />
+                            </StackPanel>
+                            <StackPanel
+                                x:Name="state2"
+                                HorizontalAlignment="Center"
+                                VerticalAlignment="Center">
+                                <Rectangle
+                                    Width="14"
+                                    Height="1.5"
+                                    HorizontalAlignment="Center"
+                                    Fill="#616469" />
+                                <Rectangle
+                                    Width="14"
+                                    Height="1.5"
+                                    Margin="0,2.5"
+                                    HorizontalAlignment="Center"
+                                    Fill="#616469" />
+                                <Rectangle
+                                    Width="14"
+                                    Height="1.5"
+                                    Margin="0,0,0,2.5"
+                                    HorizontalAlignment="Center"
+                                    Fill="#616469" />
+                                <Rectangle
+                                    Width="14"
+                                    Height="1.5"
+                                    HorizontalAlignment="Center"
+                                    Fill="#616469" />
+                            </StackPanel>
+                        </Grid>
+                    </Border>
+                    <ControlTemplate.Triggers>
+                        <Trigger Property="IsMouseOver" Value="True">
+                            <Setter TargetName="state2" Property="Visibility" Value="Visible" />
+                            <Setter TargetName="state1" Property="Visibility" Value="Collapsed" />
+                            <Setter TargetName="border" Property="Background" Value="#EDEEF0" />
+                        </Trigger>
+                        <Trigger Property="IsChecked" Value="True">
+                            <Setter TargetName="state1" Property="Visibility" Value="Visible" />
+                            <Setter TargetName="state2" Property="Visibility" Value="Collapsed" />
+                            <Setter TargetName="border" Property="Background" Value="#CED0D4" />
+                            <!--<Setter TargetName="border" Property="BorderBrush" Value="{StaticResource color.btn.sec.border-color}" />
+                            <Setter TargetName="border" Property="BorderThickness" Value="{StaticResource border-width.1}" />-->
+                        </Trigger>
+                        <Trigger Property="IsEnabled" Value="False">
+                            <Setter TargetName="state1" Property="Visibility" Value="Collapsed" />
+                        </Trigger>
+                    </ControlTemplate.Triggers>
+                </ControlTemplate>
+            </Setter.Value>
+        </Setter>
+    </Style>
 </ResourceDictionary>

+ 18 - 0
PDF Office/Styles/WindowsStyle.xaml

@@ -99,4 +99,22 @@
         </Setter>
         <Setter Property="Background" Value="Transparent" />
     </Style>
+    <Style
+        x:Key="InfoDialogWindowStyle"
+        BasedOn="{StaticResource WindowWithCorderStyle}"
+        TargetType="{x:Type Window}">
+        <Setter Property="WindowStyle" Value="ThreeDBorderWindow" />
+        <Setter Property="prism:Dialog.WindowStartupLocation" Value="CenterOwner" />
+        <Setter Property="SizeToContent" Value="WidthAndHeight" />
+        <Setter Property="ShowInTaskbar" Value="True" />
+        <Setter Property="ResizeMode" Value="NoResize" />
+        <Setter Property="Padding" Value="0" />
+        <Setter Property="BorderThickness" Value="1" />
+        <Setter Property="BorderBrush">
+            <Setter.Value>
+                <SolidColorBrush Opacity="0.3" Color="Gray" />
+            </Setter.Value>
+        </Setter>
+        <Setter Property="Background" Value="Transparent" />
+    </Style>
 </ResourceDictionary>

+ 3 - 0
PDF Office/ViewModels/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageBates/HomePageBatesCreateContentViewModel.cs

@@ -706,6 +706,7 @@ namespace PDF_Office.ViewModels.Dialog.HomePageToolsDialogs.HomePageBatchProcess
             StringColor = EditToolsHelper.ConvertColor(BatesInfo.TextData[0].Color);
             SolidColorBrush = new SolidColorBrush(StringColor);
             PageRangeSelectIndex = BatesInfo.PageRangeIndex;
+            PageRangeText = BatesInfo.PageRange;
         }
         public bool IsNavigationTarget(NavigationContext navigationContext)
         {
@@ -726,10 +727,12 @@ namespace PDF_Office.ViewModels.Dialog.HomePageToolsDialogs.HomePageBatchProcess
             {
                 CreateOrEdit = EnumCreateOrEdit.StatusEdit;
                 InitComponentBySelectedInfo();
+                
             }
             else
             {
                 CreateOrEdit = EnumCreateOrEdit.StatusCreate;
+                BatesInfo.PageRange = "";
             }
         }
 

File diff suppressed because it is too large
+ 567 - 562
PDF Office/ViewModels/Dialog/HomePageToolsDialogs/HomePagePrinter/HomePagePrinterDocumentContentViewModel.cs


+ 2 - 3
PDF Office/ViewModels/EditTools/Background/BackgroundCreateColorContentViewModel.cs

@@ -209,7 +209,7 @@ namespace PDF_Office.ViewModels.EditTools.Background
             set
             {
                 _pageRangeText = value;
-                EditToolsHelper.GetPageRange(PageRangeSelectIndex, PDFViewer.Document, ref BackgroundInfo.PageRange, PageRangeText);
+                BackgroundInfo.PageRange = PageRangeText;
                 eventAggregator.GetEvent<SetBackgroundEvent>().Publish(new BackgroundInfoUnicode
                 {
                     Unicode = Unicode,
@@ -229,7 +229,6 @@ namespace PDF_Office.ViewModels.EditTools.Background
             {
                 SetProperty(ref _pageRangeSelectIndex, value);
                 BackgroundInfo.PageRangeIndex = PageRangeSelectIndex;
-                EditToolsHelper.GetPageRange(PageRangeSelectIndex, PDFViewer.Document, ref BackgroundInfo.PageRange, PageRangeText);
                 eventAggregator.GetEvent<SetBackgroundEvent>().Publish(new BackgroundInfoUnicode
                 {
                     Unicode = Unicode,
@@ -383,7 +382,7 @@ namespace PDF_Office.ViewModels.EditTools.Background
                 backgroundItem.opacity = backgroundInfo.Opacity;
                 backgroundItem.rotation = backgroundInfo.Rotation;
                 backgroundItem.PageRangeIndex = backgroundInfo.PageRangeIndex;
-                backgroundItem.pageRange = backgroundInfo.PageRange;
+                backgroundItem.pageRange = PageRangeText;
                 backgroundItem.isRelativeScale = backgroundInfo.IsRelativeScale;
                 backgroundItem.scale = backgroundInfo.Scale;
             }

+ 10 - 4
PDF Office/ViewModels/EditTools/Background/BackgroundCreateFileContentViewModel.cs

@@ -256,7 +256,7 @@ namespace PDF_Office.ViewModels.EditTools.Background
             set
             {
                 _pageRangeText = value;
-                EditToolsHelper.GetPageRange(PageRangeSelectIndex, PDFViewer.Document, ref BackgroundInfo.PageRange, PageRangeText);
+                BackgroundInfo.PageRange=PageRangeText;
                 eventAggregator.GetEvent<SetBackgroundEvent>().Publish(new BackgroundInfoUnicode { Unicode=Unicode,Status=BackgroundInfo});
             }
         }
@@ -277,8 +277,13 @@ namespace PDF_Office.ViewModels.EditTools.Background
             get { return _pageRangeSelectIndex; }
             set
             {
-                SetProperty(ref _pageRangeSelectIndex, value);
-                EditToolsHelper.GetPageRange(PageRangeSelectIndex, PDFViewer.Document, ref BackgroundInfo.PageRange, PageRangeText);
+                SetProperty(ref _pageRangeSelectIndex, value);
+                BackgroundInfo.PageRangeIndex = PageRangeSelectIndex;
+                eventAggregator.GetEvent<SetBackgroundEvent>().Publish(new BackgroundInfoUnicode
+                {
+                    Unicode = Unicode,
+                    Status = BackgroundInfo
+                });
             }
         }
 
@@ -417,7 +422,6 @@ namespace PDF_Office.ViewModels.EditTools.Background
                 backgroundInfo.Opacity = backgroundItem.opacity;
                 backgroundInfo.Rotation = backgroundItem.rotation;
                 backgroundInfo.IsRelativeScale = backgroundItem.isRelativeScale;
-
                 backgroundInfo.Scale = backgroundItem.scale;
                 backgroundInfo.PageRangeIndex = backgroundItem.PageRangeIndex;
                 backgroundInfo.PageRange = backgroundItem.pageRange;
@@ -437,6 +441,8 @@ namespace PDF_Office.ViewModels.EditTools.Background
             backgroundItem.rotation = backgroundInfo.Rotation;
             backgroundItem.isRelativeScale = backgroundInfo.IsRelativeScale;
             backgroundItem.scale = backgroundInfo.Scale;
+            backgroundItem.pageRange = PageRangeText;
+            backgroundItem.PageRangeIndex = backgroundInfo.PageRangeIndex;
             //backgroundItem.pagRangeMode = backgroundInfo.PageRange;
         }
 

+ 2 - 0
PDF Office/ViewModels/EditTools/Background/BackgroundDocumentContentViewModel.cs

@@ -7,6 +7,7 @@ using PDF_Office.EventAggregators;
 using PDF_Office.Helper;
 using PDF_Office.Model;
 using PDF_Office.Model.EditTools.Background;
+using PDF_Office.Model.EditTools.Bates;
 using PDF_Office.Model.EditTools.Watermark;
 using Prism.Commands;
 using Prism.Events;
@@ -153,6 +154,7 @@ namespace PDF_Office.ViewModels.EditTools.Background
         {
             EnumDelete = EnumDelete.StatusCreate;
             BackgroundInfo backgroundInfo = backgroundInfounicode.Status;
+            EditToolsHelper.GetPageRange(backgroundInfo.PageRangeIndex, PDFViewer.Document, ref backgroundInfo.PageRange, backgroundInfo.PageRange);
             this.backgroundInfo = backgroundInfo;
             PDFViewer.InvalidChildVisual(false);
         }

+ 11 - 6
PDF Office/ViewModels/EditTools/Bates/BatesCreateContentViewModel.cs

@@ -154,7 +154,8 @@ namespace PDF_Office.ViewModels.EditTools.Bates
             set
             {
                 _pageRangeText = value;
-                EditToolsHelper.GetPageRange(PageRangeSelectIndex, PDFViewer.Document, ref BatesInfo.PageRange, PageRangeText);
+                BatesInfo.PageRange = PageRangeText;
+                //EditToolsHelper.GetPageRange(PageRangeSelectIndex, PDFViewer.Document, ref BatesInfo.PageRange, PageRangeText);
                 eventAggregator.GetEvent<SetBatesEvent>().Publish(new BatesInfoUnicode
                 {
                     Unicode = Unicode,
@@ -171,7 +172,7 @@ namespace PDF_Office.ViewModels.EditTools.Bates
             {
                 SetProperty(ref _pageRangeSelectIndex, value);
                 BatesInfo.PageRangeIndex = PageRangeSelectIndex;
-                EditToolsHelper.GetPageRange(PageRangeSelectIndex, PDFViewer.Document, ref BatesInfo.PageRange, PageRangeText);
+                //EditToolsHelper.GetPageRange(PageRangeSelectIndex, PDFViewer.Document, ref BatesInfo.PageRange, PageRangeText);
                 eventAggregator.GetEvent<SetBatesEvent>().Publish(new BatesInfoUnicode
                 {
                     Unicode = Unicode,
@@ -633,7 +634,7 @@ namespace PDF_Office.ViewModels.EditTools.Bates
             batesItem.Suffix = batesInfo.Suffix;
             batesItem.StarPagetNumber = batesInfo.StarPagetNumber;
             batesItem.margin = batesInfo.margin;
-            batesItem.PageRange = batesInfo.PageRange;
+            batesItem.PageRange = PageRangeText;
             batesItem.PageRangeIndex = batesInfo.PageRangeIndex;
 
         }
@@ -648,7 +649,8 @@ namespace PDF_Office.ViewModels.EditTools.Bates
             batesInfo.StarPagetNumber = batesItem.StarPagetNumber;
             batesInfo.margin = batesItem.margin;
             batesInfo.PageRangeIndex = batesItem.PageRangeIndex;
-            EditToolsHelper.GetPageRange(batesInfo.PageRangeIndex, PDFViewer.Document, ref batesInfo.PageRange, batesItem.PageRange);
+            batesInfo.PageRange=batesItem.PageRange;
+            //EditToolsHelper.GetPageRange(batesInfo.PageRangeIndex, PDFViewer.Document, ref batesInfo.PageRange, batesItem.PageRange);
 
         }
 
@@ -747,6 +749,7 @@ namespace PDF_Office.ViewModels.EditTools.Bates
             StringColor = EditToolsHelper.ConvertColor(BatesInfo.TextData[0].Color);
             SolidColorBrush = new SolidColorBrush(StringColor);
             PageRangeSelectIndex = BatesInfo.PageRangeIndex;
+            PageRangeText=BatesInfo.PageRange;
         }
         public bool IsNavigationTarget(NavigationContext navigationContext)
         {
@@ -762,16 +765,18 @@ namespace PDF_Office.ViewModels.EditTools.Bates
 
             navigationContext.Parameters.TryGetValue<CPDFViewer>(ParameterNames.PDFViewer, out PDFViewer);
             MaxPageRange = PDFViewer.Document.PageCount;
-            EditToolsHelper.GetPageRange(PageRangeSelectIndex, PDFViewer.Document, ref BatesInfo.PageRange, PageRangeText);
-
+            
             if (navigationContext.Parameters.TryGetValue<BatesHeaderFooterItem>("BatesItem", out TemplateBatesItem))
             {
                 CreateOrEdit = EnumCreateOrEdit.StatusEdit;
+                BatesInfo.PageRange = TemplateBatesItem.PageRange;
                 InitComponentBySelectedInfo();
+                
             }
             else
             {
                 CreateOrEdit = EnumCreateOrEdit.StatusCreate;
+                EditToolsHelper.GetPageRange(PageRangeSelectIndex, PDFViewer.Document, ref BatesInfo.PageRange, PageRangeText);
             }
         }
 

+ 2 - 3
PDF Office/ViewModels/EditTools/HeaderFooter/HeaderFooterCreateContentViewModel.cs

@@ -250,7 +250,7 @@ namespace PDF_Office.ViewModels.EditTools.HeaderFooter
             set
             {
                 _pageRangeText = value;
-                EditToolsHelper.GetPageRange(PageRangeSelectIndex, PDFViewer.Document, ref HeaderFooterInfo.PageRange, PageRangeText);
+                HeaderFooterInfo.PageRange = PageRangeText;
                 eventAggregator.GetEvent<SetHeaderFooterEvent>().Publish(new HeaderFooterInfoUnicode
                 {
                     Unicode = Unicode,
@@ -267,7 +267,6 @@ namespace PDF_Office.ViewModels.EditTools.HeaderFooter
             {
                 SetProperty(ref _pageRangeSelectIndex, value);
                 HeaderFooterInfo.PageRangeIndex = PageRangeSelectIndex;
-                EditToolsHelper.GetPageRange(PageRangeSelectIndex, PDFViewer.Document, ref HeaderFooterInfo.PageRange, PageRangeText);
                 eventAggregator.GetEvent<SetHeaderFooterEvent>().Publish(new HeaderFooterInfoUnicode
                 {
                     Unicode = Unicode,
@@ -657,7 +656,7 @@ namespace PDF_Office.ViewModels.EditTools.HeaderFooter
             headerFooterItem.StarPagetNumber = headerFooterInfo.StarPagetNumber;
             headerFooterItem.PageNumberFormat = headerFooterInfo.PageNumberFormat;
             headerFooterItem.margin = headerFooterInfo.margin;
-            headerFooterItem.PageRange = headerFooterInfo.PageRange;
+            headerFooterItem.PageRange = PageRangeText;
             headerFooterItem.PageRangeIndex = headerFooterInfo.PageRangeIndex;
         }
 

+ 2 - 3
PDF Office/ViewModels/EditTools/Watermark/WatermarkCreateFileContentViewModel.cs

@@ -273,7 +273,7 @@ namespace PDF_Office.ViewModels.EditTools.Watermark
             set
             {
                 _pageRangeText = value;
-                EditToolsHelper.GetPageRange(PageRangeSelectIndex, PDFViewer.Document, ref WatermarkInfo.PageRange, PageRangeText);
+                WatermarkInfo.PageRange = PageRangeText;
                 eventAggregator.GetEvent<SetWatermarkEvent>().Publish(new WatermarkInfoUnicode
                 {
                     Unicode = Unicode,
@@ -322,7 +322,6 @@ namespace PDF_Office.ViewModels.EditTools.Watermark
             {
                 SetProperty(ref _pageRangeSelectIndex, value);
                 WatermarkInfo.PageRangeIndex = PageRangeSelectIndex;
-                EditToolsHelper.GetPageRange(PageRangeSelectIndex, PDFViewer.Document, ref WatermarkInfo.PageRange, PageRangeText);
                 eventAggregator.GetEvent<SetWatermarkEvent>().Publish(new WatermarkInfoUnicode
                 {
                     Unicode = Unicode,
@@ -424,7 +423,7 @@ namespace PDF_Office.ViewModels.EditTools.Watermark
                 watermarkItem.verticalSpacing = watermarkInfo.VerticalSpacing;
                 watermarkItem.horizontalSpacing = watermarkInfo.HorizontalSpacing;
                 watermarkItem.pageRangeIndex = watermarkInfo.PageRangeIndex;
-                watermarkItem.pageRange = watermarkInfo.PageRange;
+                watermarkItem.pageRange = PageRangeText;
             }
         }
 

+ 2 - 3
PDF Office/ViewModels/EditTools/Watermark/WatermarkCreateTextContentViewModel.cs

@@ -436,7 +436,7 @@ namespace PDF_Office.ViewModels.EditTools.Watermark
             set
             {
                 _pageRangeText = value;
-                EditToolsHelper.GetPageRange(PageRangeSelectIndex, PDFViewer.Document, ref WatermarkInfo.PageRange, PageRangeText);
+                WatermarkInfo.PageRange = PageRangeText;
                 eventAggregator.GetEvent<SetWatermarkEvent>().Publish(new WatermarkInfoUnicode
                 {
                     Unicode = Unicode,
@@ -453,7 +453,6 @@ namespace PDF_Office.ViewModels.EditTools.Watermark
             {
                 SetProperty(ref _pageRangeSelectIndex, value);
                 WatermarkInfo.PageRangeIndex = PageRangeSelectIndex;
-                EditToolsHelper.GetPageRange(PageRangeSelectIndex, PDFViewer.Document, ref WatermarkInfo.PageRange, PageRangeText);
                 eventAggregator.GetEvent<SetWatermarkEvent>().Publish(new WatermarkInfoUnicode
                 {
                     Unicode = Unicode,
@@ -523,7 +522,7 @@ namespace PDF_Office.ViewModels.EditTools.Watermark
                 watermarkItem.verticalSpacing = watermarkInfo.VerticalSpacing;
                 watermarkItem.horizontalSpacing = watermarkInfo.HorizontalSpacing;
                 watermarkItem.pageRangeIndex = watermarkInfo.PageRangeIndex;
-                watermarkItem.pageRange = watermarkInfo.PageRange;
+                watermarkItem.pageRange = PageRangeText;
             }
         }
 

+ 8 - 6
PDF Office/ViewModels/ViewContentViewModel.cs

@@ -23,6 +23,7 @@ using PDF_Office.Views;
 using Prism.Events;
 using PDF_Office.EventAggregators;
 using PDF_Office.Views.EditTools.Background;
+using PDF_Office.Views.Dialog;
 
 namespace PDF_Office.ViewModels
 {
@@ -515,12 +516,13 @@ namespace PDF_Office.ViewModels
         }
         private void SettingsEvent()
         {
-            DialogParameters value = new DialogParameters();
-            value.Add(ParameterNames.PDFViewer, PDFViewer);
-            value.Add(ParameterNames.ViewContentViewModel, this);
-            dialogs.ShowDialog(DialogNames.InfoDialog, value, e =>
-            {
-            });
+            new InfoDialog().ShowDialog();
+            //DialogParameters value = new DialogParameters();
+            //value.Add(ParameterNames.PDFViewer, PDFViewer);
+            //value.Add(ParameterNames.ViewContentViewModel, this);
+            //dialogs.ShowDialog(DialogNames.InfoDialog, value, e =>
+            //{
+            //});
         }
 
         private bool CanSaveExcute()

File diff suppressed because it is too large
+ 737 - 77
PDF Office/Views/Dialog/InfoDialog.xaml


+ 23 - 1
PDF Office/Views/Dialog/InfoDialog.xaml.cs

@@ -18,11 +18,33 @@ namespace PDF_Office.Views.Dialog
     /// <summary>
     /// InfoDialog.xaml 的交互逻辑
     /// </summary>
-    public partial class InfoDialog : UserControl
+    public partial class InfoDialog : Window
     {
         public InfoDialog()
         {
             InitializeComponent();
         }
+
+        private void BtnMiniSize_Click(object sender, RoutedEventArgs e)
+        {
+            System.Windows.SystemCommands.MinimizeWindow(this);
+        }
+
+        private void BtnClose_Click(object sender, RoutedEventArgs e)
+        {
+            System.Windows.SystemCommands.CloseWindow(this);
+        }
+
+        private void BtnReStore_Click(object sender, RoutedEventArgs e)
+        {
+            if (this.WindowState == WindowState.Maximized)
+            {
+                System.Windows.SystemCommands.RestoreWindow(this);
+            }
+            else
+            {
+                System.Windows.SystemCommands.MaximizeWindow(this);
+            }
+        }
     }
 }

+ 7 - 1
PDF Office/Views/EditTools/Background/BackgroundTemplateListColorContent.xaml

@@ -56,7 +56,7 @@
                             <Grid Height="160" Width=" 128" Margin="1">
 
                                 <Image  Name="BackgroundPreview" Stretch="Fill" RenderOptions.BitmapScalingMode="HighQuality"/>
-
+                                <CheckBox Name="IsSelectedCheckBox" Height="14" Width="14" HorizontalAlignment="Right" VerticalAlignment="Top" Panel.ZIndex="1" IsChecked="True" IsEnabled="False"/>
                                 <Button Name="EditTemplateBtn" Height="43" Width="64" Margin="0" HorizontalAlignment="Left" VerticalAlignment="Bottom" Click="EditTemplateBtn_Click"></Button>
                                 <Button Name="DeleteTemplateBtn"  Height="43" Width="64" Margin="0" HorizontalAlignment="Right" VerticalAlignment="Bottom" Click="DeleteTemplateBtn_Click" >
                                 </Button>
@@ -64,6 +64,12 @@
                         </Border>
                     </StackPanel>
                     <DataTemplate.Triggers>
+                        <DataTrigger Binding="{Binding Path=IsSelected, RelativeSource={RelativeSource FindAncestor, AncestorType=ListBoxItem}}" Value="True">
+                            <Setter TargetName="IsSelectedCheckBox" Property="Visibility" Value="Visible"/>
+                        </DataTrigger>
+                        <DataTrigger Binding="{Binding Path=IsSelected, RelativeSource={RelativeSource FindAncestor, AncestorType=ListBoxItem}}" Value="False">
+                            <Setter TargetName="IsSelectedCheckBox" Property="Visibility" Value="Collapsed"/>
+                        </DataTrigger>
                         <Trigger Property="IsMouseOver" Value="True">
                             <Setter TargetName="EditTemplateBtn" Property="Visibility" Value="Visible"/>
                             <Setter TargetName="DeleteTemplateBtn" Property="Visibility" Value="Visible"/>

+ 1 - 1
PDF Office/Views/EditTools/Background/BackgroundTemplateListColorContent.xaml.cs

@@ -33,7 +33,7 @@ namespace PDF_Office.Views.EditTools.Background
         {
             var listBox = sender as ListBox;
             viewModel.SelectTemplateItemCommand?.Execute(sender);
-            listBox.SelectedIndex = -1;
+            //listBox.SelectedIndex = -1;
         }
 
         private void MenuEdit_Click(object sender, RoutedEventArgs e)

+ 7 - 0
PDF Office/Views/EditTools/Background/BackgroundTemplateListFileContent.xaml

@@ -57,6 +57,7 @@
                         <Border BorderThickness="1" BorderBrush="#A0A2AE">
                             <Grid Height="160" Width=" 128" >
                                 <Image  Name="BackgroundPreview" Stretch="Fill" RenderOptions.BitmapScalingMode="HighQuality"/>
+                                <CheckBox Name="IsSelectedCheckBox" Height="14" Width="14" HorizontalAlignment="Right" VerticalAlignment="Top" Panel.ZIndex="1" IsChecked="True" IsEnabled="False"/>
                                 <Button Name="EditTemplateBtn" Height="43" Width="63" HorizontalAlignment="Left" VerticalAlignment="Bottom" Click="EditTemplateBtn_Click"></Button>
                                 <Button Name="DeleteTemplateBtn"  Height="43" Width="63" HorizontalAlignment="Right" VerticalAlignment="Bottom" Click="DeleteTemplateBtn_Click">
                                 </Button>
@@ -64,6 +65,12 @@
                         </Border>
                     </StackPanel>
                     <DataTemplate.Triggers>
+                        <DataTrigger Binding="{Binding Path=IsSelected, RelativeSource={RelativeSource FindAncestor, AncestorType=ListBoxItem}}" Value="True">
+                            <Setter TargetName="IsSelectedCheckBox" Property="Visibility" Value="Visible"/>
+                        </DataTrigger>
+                        <DataTrigger Binding="{Binding Path=IsSelected, RelativeSource={RelativeSource FindAncestor, AncestorType=ListBoxItem}}" Value="False">
+                            <Setter TargetName="IsSelectedCheckBox" Property="Visibility" Value="Collapsed"/>
+                        </DataTrigger>
                         <Trigger Property="IsMouseOver" Value="True">
                             <Setter TargetName="EditTemplateBtn" Property="Visibility" Value="Visible"/>
                             <Setter TargetName="DeleteTemplateBtn" Property="Visibility" Value="Visible"/>

+ 1 - 1
PDF Office/Views/EditTools/Background/BackgroundTemplateListFileContent.xaml.cs

@@ -32,7 +32,7 @@ namespace PDF_Office.Views.EditTools.Background
         {
             var listBox = sender as ListBox;
             viewModel.SelectTemplateItemCommand?.Execute(sender);
-            listBox.SelectedIndex = -1;
+            //listBox.SelectedIndex = -1;
         }
 
         private void MenuEdit_Click(object sender, RoutedEventArgs e)

+ 7 - 0
PDF Office/Views/EditTools/Bates/BatesTemplateListContent.xaml

@@ -97,6 +97,7 @@
                                         </StackPanel>
 
                                     </StackPanel>
+                                    <CheckBox Name="IsSelectedCheckBox" Height="14" Width="14" HorizontalAlignment="Right" VerticalAlignment="Top" Panel.ZIndex="1" IsChecked="True" IsEnabled="False"/>
                                     <Button Name="EditTemplateBtn" Height="43" Width="63" HorizontalAlignment="Left" VerticalAlignment="Bottom" Click="EditTemplateBtn_Click"></Button>
                                     <Button Name="DeleteTemplateBtn"  Height="43" Width="63" HorizontalAlignment="Right" VerticalAlignment="Bottom" Click="DeleteTemplateBtn_Click">
                                     </Button>
@@ -104,6 +105,12 @@
                             </Border>
                         </StackPanel>
                         <DataTemplate.Triggers>
+                            <DataTrigger Binding="{Binding Path=IsSelected, RelativeSource={RelativeSource FindAncestor, AncestorType=ListBoxItem}}" Value="True">
+                                <Setter TargetName="IsSelectedCheckBox" Property="Visibility" Value="Visible"/>
+                            </DataTrigger>
+                            <DataTrigger Binding="{Binding Path=IsSelected, RelativeSource={RelativeSource FindAncestor, AncestorType=ListBoxItem}}" Value="False">
+                                <Setter TargetName="IsSelectedCheckBox" Property="Visibility" Value="Collapsed"/>
+                            </DataTrigger>
                             <Trigger Property="IsMouseOver" Value="True">
                                 <Setter TargetName="EditTemplateBtn" Property="Visibility" Value="Visible"/>
                                 <Setter TargetName="DeleteTemplateBtn" Property="Visibility" Value="Visible"/>

+ 7 - 0
PDF Office/Views/EditTools/HeaderFooter/HeaderFooterTemplateListContent.xaml

@@ -97,6 +97,7 @@
                                         </StackPanel>
 
                                     </StackPanel>
+                                    <CheckBox Name="IsSelectedCheckBox" Height="14" Width="14" HorizontalAlignment="Right" VerticalAlignment="Top" Panel.ZIndex="1" IsChecked="True" IsEnabled="False"/>
                                     <Button Name="EditTemplateBtn" Height="43" Width="63" HorizontalAlignment="Left" VerticalAlignment="Bottom" Click="EditTemplateBtn_Click"></Button>
                                     <Button Name="DeleteTemplateBtn"  Height="43" Width="63" HorizontalAlignment="Right" VerticalAlignment="Bottom" Click="DeleteTemplateBtn_Click">
                                     </Button>
@@ -104,6 +105,12 @@
                             </Border>
                         </StackPanel>
                         <DataTemplate.Triggers>
+                            <DataTrigger Binding="{Binding Path=IsSelected, RelativeSource={RelativeSource FindAncestor, AncestorType=ListBoxItem}}" Value="True">
+                                <Setter TargetName="IsSelectedCheckBox" Property="Visibility" Value="Visible"/>
+                            </DataTrigger>
+                            <DataTrigger Binding="{Binding Path=IsSelected, RelativeSource={RelativeSource FindAncestor, AncestorType=ListBoxItem}}" Value="False">
+                                <Setter TargetName="IsSelectedCheckBox" Property="Visibility" Value="Collapsed"/>
+                            </DataTrigger>
                             <Trigger Property="IsMouseOver" Value="True">
                                 <Setter TargetName="EditTemplateBtn" Property="Visibility" Value="Visible"/>
                                 <Setter TargetName="DeleteTemplateBtn" Property="Visibility" Value="Visible"/>

+ 7 - 0
PDF Office/Views/EditTools/Watermark/WatermarkTemplateListFileContent.xaml

@@ -56,12 +56,19 @@
                     <StackPanel Name="itemPanel" Loaded="itemPanel_Loaded">
                         <Grid Height="160" Width=" 128" >
                             <Image  Name="WatermarkPreview" Stretch="Fill" RenderOptions.BitmapScalingMode="HighQuality" />
+                            <CheckBox Name="IsSelectedCheckBox" Height="14" Width="14" HorizontalAlignment="Right" VerticalAlignment="Top" Panel.ZIndex="1" IsChecked="True" IsEnabled="False"/>
                             <Button Name="EditTemplateBtn" Height="43" Width="63" HorizontalAlignment="Left" VerticalAlignment="Bottom" Click="EditTemplateBtn_Click"></Button>
                             <Button Name="DeleteTemplateBtn"  Height="43" Width="63" HorizontalAlignment="Right" VerticalAlignment="Bottom" Click="DeleteTemplateBtn_Click" >
                             </Button>
                         </Grid>
                     </StackPanel>
                     <DataTemplate.Triggers>
+                        <DataTrigger Binding="{Binding Path=IsSelected, RelativeSource={RelativeSource FindAncestor, AncestorType=ListBoxItem}}" Value="True">
+                            <Setter TargetName="IsSelectedCheckBox" Property="Visibility" Value="Visible"/>
+                        </DataTrigger>
+                        <DataTrigger Binding="{Binding Path=IsSelected, RelativeSource={RelativeSource FindAncestor, AncestorType=ListBoxItem}}" Value="False">
+                            <Setter TargetName="IsSelectedCheckBox" Property="Visibility" Value="Collapsed"/>
+                        </DataTrigger>
                         <Trigger Property="IsMouseOver" Value="True">
                             <Setter TargetName="EditTemplateBtn" Property="Visibility" Value="Visible"/>
                             <Setter TargetName="DeleteTemplateBtn" Property="Visibility" Value="Visible"/>

+ 1 - 1
PDF Office/Views/EditTools/Watermark/WatermarkTemplateListFileContent.xaml.cs

@@ -40,7 +40,7 @@ namespace PDF_Office.Views.EditTools.Watermark
                Trace.WriteLine( lists.IndexOf(item));
             }
             viewModel.SelectTemplateItemCommand?.Execute(sender);
-            FileWatermarkListbox.SelectedIndex = -1;
+            //FileWatermarkListbox.SelectedIndex = -1;
         }
 
         private void MenuEdit_Click(object sender, RoutedEventArgs e)

+ 7 - 0
PDF Office/Views/EditTools/Watermark/WatermarkTemplateListTextContent.xaml

@@ -56,12 +56,19 @@
                     <StackPanel Name="itemPanel" Loaded="itemPanel_Loaded">
                         <Grid Height="160" Width=" 128">
                             <Image  Name="WatermarkPreview" Stretch="Fill" RenderOptions.BitmapScalingMode="HighQuality"/>
+                            <CheckBox Name="IsSelectedCheckBox" Height="14" Width="14" HorizontalAlignment="Right" VerticalAlignment="Top" Panel.ZIndex="1" IsChecked="True" IsEnabled="False"/>
                             <Button Name="EditTemplateBtn" Height="43" Width="63" HorizontalAlignment="Left" VerticalAlignment="Bottom" Click="EditTemplateBtn_Click"></Button>
                             <Button Name="DeleteTemplateBtn"  Height="43" Width="63" HorizontalAlignment="Right" VerticalAlignment="Bottom" Click="DeleteTemplateBtn_Click" >
                             </Button>
                         </Grid>
                     </StackPanel>
                     <DataTemplate.Triggers>
+                        <DataTrigger Binding="{Binding Path=IsSelected, RelativeSource={RelativeSource FindAncestor, AncestorType=ListBoxItem}}" Value="True">
+                            <Setter TargetName="IsSelectedCheckBox" Property="Visibility" Value="Visible"/>
+                        </DataTrigger>
+                        <DataTrigger Binding="{Binding Path=IsSelected, RelativeSource={RelativeSource FindAncestor, AncestorType=ListBoxItem}}" Value="False">
+                            <Setter TargetName="IsSelectedCheckBox" Property="Visibility" Value="Collapsed"/>
+                        </DataTrigger>
                         <Trigger Property="IsMouseOver" Value="True">
                             <Setter TargetName="EditTemplateBtn" Property="Visibility" Value="Visible"/>
                             <Setter TargetName="DeleteTemplateBtn" Property="Visibility" Value="Visible"/>

+ 1 - 1
PDF Office/Views/EditTools/Watermark/WatermarkTemplateListTextContent.xaml.cs

@@ -32,7 +32,7 @@ namespace PDF_Office.Views.EditTools.Watermark
         {
             viewModel.SelectTemplateItemCommand?.Execute(sender);
 
-            TextWatermarkListbox.SelectedIndex = -1;
+            //TextWatermarkListbox.SelectedIndex = -1;
         }
 
         private void MenuEdit_Click(object sender, RoutedEventArgs e)