Просмотр исходного кода

页面编辑-补充删除、旋转、页面大小缩放功能

ZhouJieSheng 2 лет назад
Родитель
Сommit
3aff92026c

+ 17 - 0
PDF Office/Model/PageEdit/PageEditItem.cs

@@ -106,11 +106,28 @@ namespace PDF_Office.Model.PageEdit
         }
 
 
+        private Size itemSize = new Size(208, 294);
+        /// <summary>
+        /// 控件大小
+        /// 直接修改Listbox 容器的项大小,会导致间距有问题,所有采用动态绑定大小的方式来实现Item大小更新
+        /// </summary>
+        public Size ItemSize
+        {
+            get { return itemSize; }
+            set
+            {
+                SetProperty(ref itemSize, value);
+            }
+        }
 
         /// <summary>
         /// 此次打开中是否已经获取图片,避免重复拿图
         /// </summary>
         public bool IsGetImage = false;
 
+        /// <summary>
+        /// 是否是竖直的图
+        /// </summary>
+        public bool isVertical = true;
     }
 }

+ 24 - 0
PDF Office/PDF Office.csproj

@@ -138,6 +138,9 @@
     <Compile Include="ViewModels\BOTA\BOTAContentViewModel.cs" />
     <Compile Include="ViewModels\BottomToolContentViewModel.cs" />
     <Compile Include="ViewModels\Dialog\FullScreenWindowViewModel.cs" />
+    <Compile Include="ViewModels\Dialog\PageEditDialogs\ExtractDialogViewModel.cs" />
+    <Compile Include="ViewModels\Dialog\PageEditDialogs\InsertDialogViewModel.cs" />
+    <Compile Include="ViewModels\Dialog\PageEditDialogs\SplitDialogViewModel.cs" />
     <Compile Include="ViewModels\Dialog\VerifyPassWordDialogViewModel.cs" />
     <Compile Include="ViewModels\HomePanel\HomeCloudContentViewModel.cs" />
     <Compile Include="ViewModels\HomePanel\HomeGuidContentViewModel.cs" />
@@ -153,6 +156,15 @@
     <Compile Include="Views\Dialog\FullScreenWindow.xaml.cs">
       <DependentUpon>FullScreenWindow.xaml</DependentUpon>
     </Compile>
+    <Compile Include="Views\Dialog\PageEditDialogs\ExtractDialog.xaml.cs">
+      <DependentUpon>ExtractDialog.xaml</DependentUpon>
+    </Compile>
+    <Compile Include="Views\Dialog\PageEditDialogs\InsertDialog.xaml.cs">
+      <DependentUpon>InsertDialog.xaml</DependentUpon>
+    </Compile>
+    <Compile Include="Views\Dialog\PageEditDialogs\SplitDialog.xaml.cs">
+      <DependentUpon>SplitDialog.xaml</DependentUpon>
+    </Compile>
     <Compile Include="Views\Dialog\VerifyPassWordDialog.xaml.cs">
       <DependentUpon>VerifyPassWordDialog.xaml</DependentUpon>
     </Compile>
@@ -239,6 +251,18 @@
       <SubType>Designer</SubType>
       <Generator>MSBuild:Compile</Generator>
     </Page>
+    <Page Include="Views\Dialog\PageEditDialogs\ExtractDialog.xaml">
+      <Generator>MSBuild:Compile</Generator>
+      <SubType>Designer</SubType>
+    </Page>
+    <Page Include="Views\Dialog\PageEditDialogs\InsertDialog.xaml">
+      <Generator>MSBuild:Compile</Generator>
+      <SubType>Designer</SubType>
+    </Page>
+    <Page Include="Views\Dialog\PageEditDialogs\SplitDialog.xaml">
+      <Generator>MSBuild:Compile</Generator>
+      <SubType>Designer</SubType>
+    </Page>
     <Page Include="Views\Dialog\VerifyPassWordDialog.xaml">
       <SubType>Designer</SubType>
       <Generator>MSBuild:Compile</Generator>

+ 12 - 0
PDF Office/ViewModels/Dialog/PageEditDialogs/ExtractDialogViewModel.cs

@@ -0,0 +1,12 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace PDF_Office.ViewModels.Dialog.PageEditDialogs
+{
+    class ExtractDialogViewModel
+    {
+    }
+}

+ 12 - 0
PDF Office/ViewModels/Dialog/PageEditDialogs/InsertDialogViewModel.cs

@@ -0,0 +1,12 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace PDF_Office.ViewModels.Dialog.PageEditDialogs
+{
+    class InsertDialogViewModel
+    {
+    }
+}

+ 12 - 0
PDF Office/ViewModels/Dialog/PageEditDialogs/SplitDialogViewModel.cs

@@ -0,0 +1,12 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace PDF_Office.ViewModels.Dialog.PageEditDialogs
+{
+    class SplitDialogViewModel
+    {
+    }
+}

+ 1 - 4
PDF Office/ViewModels/Dialog/VerifyPassWordDialogViewModel.cs

@@ -85,10 +85,7 @@ namespace PDF_Office.ViewModels.Dialog
 
         public void OnDialogClosed()
         {
-            if(document!=null)
-            {
-                document.Release();
-            }
+            //引用类型的Doc对象 不能释放,会导致报错
         }
 
         public void OnDialogOpened(IDialogParameters parameters)

+ 126 - 4
PDF Office/ViewModels/PageEdit/PageEditContentViewModel.cs

@@ -141,6 +141,25 @@ namespace PDF_Office.ViewModels.PageEdit
             }
         }
 
+        /// <summary>
+        /// 控件原始大小
+        /// </summary>
+        private Size itemSize = new Size(208,294);
+
+        /// <summary>
+        /// 页面缩放状态,-1 为最小值,1为最大值
+        /// </summary>
+        private int zoomIndex = 0;
+
+        public int ZoomIndex
+        {
+            get { return zoomIndex; }
+            set
+            {
+                SetProperty(ref zoomIndex, value);
+            }
+        }
+
         #endregion
 
         #region 命令
@@ -195,6 +214,16 @@ namespace PDF_Office.ViewModels.PageEdit
         /// 倒序
         /// </summary>
         public DelegateCommand ReverseCommand { get; set; }
+
+        /// <summary>
+        /// 放大
+        /// </summary>
+        public DelegateCommand ZoomInCommand { get; set; }
+
+        /// <summary>
+        /// 缩小
+        /// </summary>
+        public DelegateCommand ZoomOutCommand { get; set; }
         #endregion
 
         public PageEditContentViewModel(IDialogService dialogService, IEventAggregator eventAggregator)
@@ -219,6 +248,8 @@ namespace PDF_Office.ViewModels.PageEdit
             LeftRotateCommand = new DelegateCommand(LeftRotateCommandEvent, CanFileCommandExcute).ObservesProperty(() => ListSelectedIndex);
             RightRotateCommand = new DelegateCommand(RightRotateCommandEvent, CanFileCommandExcute).ObservesProperty(() => ListSelectedIndex);
             ReverseCommand = new DelegateCommand(ReverseCommandEvent,CanFileCommandExcute).ObservesProperty(() => ListSelectedIndex);
+            ZoomInCommand = new DelegateCommand(ZoomInCommandEvent,CanZoomIn).ObservesProperty(()=>ZoomIndex);
+            ZoomOutCommand = new DelegateCommand(ZoomOutCommandEvent, CanZoomOut).ObservesProperty(()=> ZoomIndex);
 
             //订阅页面刷新事件
             eventAggregator.GetEvent<PageEditRefreshEvent>().Subscribe(OnPageEditRefreshEvent, e => e.Unicode == unicode);
@@ -301,7 +332,7 @@ namespace PDF_Office.ViewModels.PageEdit
         /// </summary>
         private void LeftRotateCommandEvent()
         {
-
+            RotateSelectedPages(false);
         }
 
         /// <summary>
@@ -309,7 +340,7 @@ namespace PDF_Office.ViewModels.PageEdit
         /// </summary>
         private void RightRotateCommandEvent()
         {
-
+            RotateSelectedPages();
         }
 
         /// <summary>
@@ -336,6 +367,54 @@ namespace PDF_Office.ViewModels.PageEdit
             }
         }
 
+        /// <summary>
+        /// 放大页面
+        /// </summary>
+        private void ZoomInCommandEvent()
+        {
+            for(int i=0;i<PageEditItems.Count;i++)
+            {
+                PageEditItems[i].ItemSize = new Size(PageEditItems[i].ItemSize.Width * 2, PageEditItems[i].ItemSize.Height * 2);
+            }
+            ZoomIndex++;
+        }
+
+        /// <summary>
+        /// 缩小页面
+        /// </summary>
+        private void ZoomOutCommandEvent()
+        {
+            for (int i = 0; i < PageEditItems.Count; i++)
+            {
+                PageEditItems[i].ItemSize = new Size(PageEditItems[i].ItemSize.Width /2, PageEditItems[i].ItemSize.Height /2);
+            }
+            ZoomIndex--;
+        }
+
+        private bool CanZoomIn()
+        {
+            if(ZoomIndex>=1)
+            {
+                return false;
+            }
+            else
+            {
+                return true;
+            }
+        }
+
+        private bool CanZoomOut()
+        {
+            if (ZoomIndex <=-1)
+            {
+                return false;
+            }
+            else
+            {
+                return true;
+            }
+        }
+
 
         /// <summary>
         /// 响应UI发送刷新图片的事件
@@ -448,6 +527,32 @@ namespace PDF_Office.ViewModels.PageEdit
         #endregion
 
         #region 方法
+        /// <summary>
+        /// 旋转所有选中页面
+        /// </summary>
+        /// <param name="rightRotate"></param>
+        private void RotateSelectedPages(bool rightRotate = true)
+        {
+            for (int i = 0; i < PageEditItems.Count; i++)
+            {
+                if (PageEditItems[i].Selected)
+                {
+                    //逆时针旋转传-1  顺时针旋转传1
+                    PDFViewer.Document.RotatePage(i, rightRotate?1:-1);
+                    PDFViewer.Document.ReleasePages(i);
+
+                    //重新拿图
+                    PageEditItems[i].isVertical = !PageEditItems[i].isVertical;
+                    PageEditItems[i].IsGetImage = false;
+                    RefreshItemImage(i, i);
+
+                    PDFViewer.UndoManager.ClearHistory();
+                    PDFViewer.UndoManager.CanSave = true;
+                    //需要ReloadDocument 才能刷新阅读页图片
+                    PDFViewer.ReloadDocument();
+                }
+            }
+        }
 
         /// <summary>
         /// 刷新页码
@@ -491,6 +596,7 @@ namespace PDF_Office.ViewModels.PageEdit
                     break;
 
                 case 1:
+                    //奇数页
                     for (int i = 0; i < PageEditItems.Count; i++)
                     {
                         if (i % 2 == 0)
@@ -504,6 +610,7 @@ namespace PDF_Office.ViewModels.PageEdit
                     }
                     break;
                 case 2:
+                    //偶数页
                     for (int i = 0; i < PageEditItems.Count; i++)
                     {
                         if (i % 2 == 0)
@@ -576,8 +683,13 @@ namespace PDF_Office.ViewModels.PageEdit
             {
                 PageEditItem item = new PageEditItem();
                 item.PageNumber = i + 1;
-                var pagesize = PDFViewer.Document.GetPageSize(i);
 
+                if(PDFViewer.Document.PageAtIndex(i).Rotation % 2 != 0)
+                {
+                    ///标记为横向页面
+                    PageEditItems[i].isVertical = false;
+                }
+                var pagesize = PDFViewer.Document.GetPageSize(i);
                 item.PageSize = $"{pagesize.Width}mm*{pagesize.Height} mm";
                 PageEditItems.Add(item);
             }
@@ -625,7 +737,15 @@ namespace PDF_Office.ViewModels.PageEdit
                 if (i <= PDFViewer.Document.PageCount - 1&&i>=0)
                 {
                     //宽高为样式中图片控件宽高
-                    await PDFViewer.GetThumbnail(i, 208, 294);
+                    if (PageEditItems[i].isVertical)
+                    {
+                        await PDFViewer.GetThumbnail(i, 208, 294);
+                    }
+                    else
+                    {
+                        //获取横图
+                        await PDFViewer.GetThumbnail(i, 294, 208);
+                    }
                 }
             }
         }
@@ -685,6 +805,8 @@ namespace PDF_Office.ViewModels.PageEdit
 
                 ListSelectedIndex = PDFViewer.CurrentIndex;
 
+                ZoomIndex = 0;
+
                 RefreshBookMarkList();
             }
         }

+ 0 - 2
PDF Office/ViewModels/ViewContentViewModel.cs

@@ -107,8 +107,6 @@ namespace PDF_Office.ViewModels
             ToolContentVisible = Visibility.Visible;
             ToolContentRegionName = Guid.NewGuid().ToString();
             ToolContentVisible = Visibility.Collapsed;
-
-
         }
 
         private void LoadControl()

+ 12 - 0
PDF Office/Views/Dialog/PageEditDialogs/ExtractDialog.xaml

@@ -0,0 +1,12 @@
+<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>

+ 28 - 0
PDF Office/Views/Dialog/PageEditDialogs/ExtractDialog.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.Views.Dialog.PageEditDialogs
+{
+    /// <summary>
+    /// ExtractDialog.xaml 的交互逻辑
+    /// </summary>
+    public partial class ExtractDialog : UserControl
+    {
+        public ExtractDialog()
+        {
+            InitializeComponent();
+        }
+    }
+}

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

@@ -0,0 +1,12 @@
+<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>

+ 28 - 0
PDF Office/Views/Dialog/PageEditDialogs/InsertDialog.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.Views.Dialog.PageEditDialogs
+{
+    /// <summary>
+    /// InsertDialog.xaml 的交互逻辑
+    /// </summary>
+    public partial class InsertDialog : UserControl
+    {
+        public InsertDialog()
+        {
+            InitializeComponent();
+        }
+    }
+}

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

@@ -0,0 +1,12 @@
+<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>

+ 28 - 0
PDF Office/Views/Dialog/PageEditDialogs/SplitDialog.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.Views.Dialog.PageEditDialogs
+{
+    /// <summary>
+    /// SplitDialog.xaml 的交互逻辑
+    /// </summary>
+    public partial class SplitDialog : UserControl
+    {
+        public SplitDialog()
+        {
+            InitializeComponent();
+        }
+    }
+}

+ 16 - 6
PDF Office/Views/Dialog/VerifyPassWordDialog.xaml

@@ -8,7 +8,7 @@
     xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
     xmlns:prism="http://prismlibrary.com/"
     Width="600"
-    Height="400"
+    Height="250"
     d:DataContext="{d:DesignInstance Type=dialog:VerifyPassWordDialogViewModel}"
     prism:ViewModelLocator.AutoWireViewModel="True"
     mc:Ignorable="d">
@@ -18,12 +18,19 @@
             <Setter Property="prism:Dialog.WindowStartupLocation" Value="CenterScreen" />
             <Setter Property="ShowInTaskbar" Value="False" />
             <Setter Property="SizeToContent" Value="WidthAndHeight" />
+            <Setter Property="Icon">
+                <Setter.Value>
+                    <!--  去除系统图片  -->
+                    <DrawingImage />
+                </Setter.Value>
+            </Setter>
         </Style>
     </prism:Dialog.WindowStyle>
     <StackPanel VerticalAlignment="Center">
         <TextBlock
-            Margin="0,15"
-            FontSize="14"
+            Margin="20,15"
+            FontSize="18"
+            FontWeight="Bold"
             Text="Please enter the password to unpass the file" />
         <TextBox
             Height="32"
@@ -44,13 +51,16 @@
         <Grid>
             <TextBlock
                 Name="TxtInput"
-                Margin="20,0"
+                Margin="20,10"
                 HorizontalAlignment="Left"
                 FontSize="14"
                 Foreground="Red"
                 Text="{Binding WarningText}"
                 Visibility="{Binding ShowWarning}" />
-            <StackPanel HorizontalAlignment="Right" Orientation="Horizontal">
+            <StackPanel
+                Margin="20,0"
+                HorizontalAlignment="Right"
+                Orientation="Horizontal">
                 <Button
                     Name="BtnOK"
                     Width="120"
@@ -62,7 +72,7 @@
                     Name="BtnCancel"
                     Width="120"
                     Height="32"
-                    Margin="10,0"
+                    Margin="10,0,0,0"
                     Command="{Binding CancelCommand}"
                     Content="Cancel" />
             </StackPanel>

+ 2 - 2
PDF Office/Views/MainWindow.xaml

@@ -12,8 +12,8 @@
     xmlns:viewmodels="clr-namespace:PDF_Office.ViewModels"
     Width="1280"
     Height="800"
-    MinWidth="800"
-    MinHeight="800"
+    MinWidth="540"
+    MinHeight="460"
     prism:ViewModelLocator.AutoWireViewModel="True"
     Activated="Window_Activated"
     Closed="Window_Closed"

+ 39 - 21
PDF Office/Views/PageEdit/PageEditContent.xaml

@@ -3,6 +3,7 @@
     xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
     xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
     xmlns:convert="clr-namespace:PDF_Office.DataConvert"
+    xmlns:cus="clr-namespace:PDF_Office.CustomControl"
     xmlns:cussys="clr-namespace:PDF_Office.CustomControl.SystemControl"
     xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
     xmlns:i="http://schemas.microsoft.com/xaml/behaviors"
@@ -10,7 +11,6 @@
     xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
     xmlns:pageedit="clr-namespace:PDF_Office.Model.PageEdit"
     xmlns:pageedit1="clr-namespace:PDF_Office.ViewModels.PageEdit"
-    xmlns:cus="clr-namespace:PDF_Office.CustomControl"
     xmlns:prism="http://prismlibrary.com/"
     xmlns:wpftk="clr-namespace:WpfToolkit.Controls;assembly=VirtualizingWrapPanel"
     Name="PageEdit"
@@ -24,19 +24,19 @@
         <ResourceDictionary>
             <convert:BoolToVisible x:Key="BoolToVisibleConvert" />
             <DataTemplate x:Key="PageEditListBoxItemTemplate" DataType="{x:Type pageedit:PageEditItem}">
-                <StackPanel MinHeight="320">
+                <StackPanel>
                     <Border
                         Name="BdBorder"
-                        Height="auto"
                         VerticalAlignment="Top"
                         BorderBrush="Transparent"
                         BorderThickness="2"
                         CornerRadius="0">
                         <Grid
-                            Width="208"
-                            Height="294"
-                            Margin="1">
-                            <Image Source="{Binding Image}" />
+                            Width="{Binding ItemSize.Width}"
+                            Height="{Binding ItemSize.Height}"
+                            Margin="1"
+                            Background="Gray">
+                            <Image Source="{Binding Image}" Stretch="Uniform" />
                             <Border
                                 Width="10"
                                 Height="10"
@@ -212,7 +212,25 @@
                         Command="{Binding DeleteCommand}"
                         Content="删除" />
                 </StackPanel>
-                <StackPanel Name="StkpnlRight" />
+                <StackPanel
+                    Name="StkpnlRight"
+                    HorizontalAlignment="Right"
+                    Orientation="Horizontal">
+                    <Button
+                        Width="25"
+                        Height="25"
+                        Margin="4"
+                        Command="{Binding ZoomInCommand}">
+                        <Path Data="M6.5 0C2.91015 0 0 2.91015 0 6.5C0 10.0899 2.91015 13 6.5 13C8.12212 13 9.60545 12.4058 10.7442 11.4232L14.821 15.5L15.5 14.821L11.4232 10.7442C12.4058 9.60545 13 8.12212 13 6.5C13 2.91015 10.0899 0 6.5 0ZM6.5 1C9.53757 1 12 3.46243 12 6.5C12 9.53757 9.53757 12 6.5 12C3.46243 12 1 9.53757 1 6.5C1 3.46243 3.46243 1 6.5 1ZM10 6H7V3H6V6H3V7H6V10H7V7H10V6Z" Fill="Black" />
+                    </Button>
+                    <Button
+                        Width="25"
+                        Height="25"
+                        Margin="4"
+                        Command="{Binding ZoomOutCommand}">
+                        <Path Data="M0 6.5C0 2.91015 2.91015 0 6.5 0C10.0899 0 13 2.91015 13 6.5C13 8.12212 12.4058 9.60545 11.4232 10.7442L15.5 14.821L14.821 15.5L10.7442 11.4232C9.60545 12.4058 8.12212 13 6.5 13C2.91015 13 0 10.0899 0 6.5ZM12 6.5C12 3.46243 9.53757 1 6.5 1C3.46243 1 1 3.46243 1 6.5C1 9.53757 3.46243 12 6.5 12C9.53757 12 12 9.53757 12 6.5ZM10 6V7H3V6H10Z" Fill="Black" />
+                    </Button>
+                </StackPanel>
             </Grid>
             <ListBox
                 Name="ListPageEdit"
@@ -229,7 +247,7 @@
                 VirtualizingPanel.CacheLengthUnit="Page"
                 VirtualizingPanel.ScrollUnit="Pixel"
                 VirtualizingPanel.VirtualizationMode="Recycling">
-                <!--  此处要用循环模式,否则滚动时容易误触发EndSscroll 从而拿图导致卡顿  -->
+                <!--  此处要用循环模式,否则滚动时容易误触发EndSscroll 从而频繁拿图导致卡顿  -->
                 <ListBox.ItemContainerStyle>
                     <Style TargetType="{x:Type ListBoxItem}">
                         <Setter Property="Template" Value="{StaticResource ListBoxItemControlTemplate}" />
@@ -251,18 +269,18 @@
                 </i:Interaction.Triggers>
             </ListBox>
             <cus:ToastControl
-            Width="auto"
-            Height="auto"
-            Margin="0,0,0,300"
-            VerticalAlignment="Bottom"
-            Background="#89000000"
-            BeginTime="0:0:0:3"
-            CornerRadius="4"
-            FontSize="14"
-            Foreground="White"
-            StringContent="Press Esc To Exit Full Mode"
-            Visibility="{Binding ShowTip}"
-            Duration="0:0:0:3" />
+                Width="auto"
+                Height="auto"
+                Margin="0,0,0,300"
+                VerticalAlignment="Bottom"
+                Background="#89000000"
+                BeginTime="0:0:0:3"
+                CornerRadius="4"
+                FontSize="14"
+                Foreground="White"
+                StringContent="Press Esc To Exit Full Mode"
+                Visibility="{Binding ShowTip}"
+                Duration="0:0:0:3" />
         </Grid>
     </Border>
 </UserControl>