Browse Source

工具栏 - 添加注释工具UI

chenrongqian 2 years ago
parent
commit
0e87f196ca

+ 1 - 0
PDF Office/App.xaml.cs

@@ -100,6 +100,7 @@ namespace PDF_Office
             containerRegistry.RegisterForNavigation<BOTAContent>();
             containerRegistry.RegisterForNavigation<PageEditContent>();
             containerRegistry.RegisterForNavigation<ToolsBarContent>();
+            containerRegistry.RegisterForNavigation<AnnotToolContent>();
 
             //注册弹窗
             containerRegistry.RegisterDialog<VerifyPassWordDialog>(DialogNames.VerifyPassWordDialog);

+ 24 - 0
PDF Office/PDF Office.csproj

@@ -340,6 +340,9 @@
     <Compile Include="Views\PageEdit\PageEditContent.xaml.cs">
       <DependentUpon>PageEditContent.xaml</DependentUpon>
     </Compile>
+    <Compile Include="Views\Tools\AnnotToolContent.xaml.cs">
+      <DependentUpon>AnnotToolContent.xaml</DependentUpon>
+    </Compile>
     <Compile Include="Views\Tools\ToolsBarContent.xaml.cs">
       <DependentUpon>ToolsBarContent.xaml</DependentUpon>
     </Compile>
@@ -528,6 +531,10 @@
       <Generator>MSBuild:Compile</Generator>
       <SubType>Designer</SubType>
     </Page>
+    <Page Include="Views\Tools\AnnotToolContent.xaml">
+      <SubType>Designer</SubType>
+      <Generator>MSBuild:Compile</Generator>
+    </Page>
     <Page Include="Views\Tools\ToolsBarContent.xaml">
       <SubType>Designer</SubType>
       <Generator>MSBuild:Compile</Generator>
@@ -603,6 +610,23 @@
     <Content Include="index.html">
       <CopyToOutputDirectory>Always</CopyToOutputDirectory>
     </Content>
+    <Resource Include="Resources\ToolBarIcon\MyTools\Arrow.png" />
+    <Resource Include="Resources\ToolBarIcon\MyTools\Bookmark.png" />
+    <Resource Include="Resources\ToolBarIcon\MyTools\Circle.png" />
+    <Resource Include="Resources\ToolBarIcon\MyTools\Freehande.png" />
+    <Resource Include="Resources\ToolBarIcon\MyTools\Freehande2.png" />
+    <Resource Include="Resources\ToolBarIcon\MyTools\Hand.png" />
+    <Resource Include="Resources\ToolBarIcon\MyTools\Highlight.png" />
+    <Resource Include="Resources\ToolBarIcon\MyTools\Hyperlink.png" />
+    <Resource Include="Resources\ToolBarIcon\MyTools\Image.png" />
+    <Resource Include="Resources\ToolBarIcon\MyTools\Line.png" />
+    <Resource Include="Resources\ToolBarIcon\MyTools\Note.png" />
+    <Resource Include="Resources\ToolBarIcon\MyTools\Point.png" />
+    <Resource Include="Resources\ToolBarIcon\MyTools\Rectangle.png" />
+    <Resource Include="Resources\ToolBarIcon\MyTools\Selecttool.png" />
+    <Resource Include="Resources\ToolBarIcon\MyTools\Stamp.png" />
+    <Resource Include="Resources\ToolBarIcon\MyTools\Textbox.png" />
+    <Resource Include="Resources\ToolBarIcon\MyTools\wavyline2.png" />
     <Content Include="SystemService\PreviewHandler.dll">
       <CopyToOutputDirectory>Always</CopyToOutputDirectory>
     </Content>

BIN
PDF Office/Resources/ToolBarIcon/MyTools/Arrow.png


BIN
PDF Office/Resources/ToolBarIcon/MyTools/Bookmark.png


BIN
PDF Office/Resources/ToolBarIcon/MyTools/Circle.png


BIN
PDF Office/Resources/ToolBarIcon/MyTools/Freehande.png


BIN
PDF Office/Resources/ToolBarIcon/MyTools/Freehande2.png


BIN
PDF Office/Resources/ToolBarIcon/MyTools/Hand.png


BIN
PDF Office/Resources/ToolBarIcon/MyTools/Highlight.png


BIN
PDF Office/Resources/ToolBarIcon/MyTools/Hyperlink.png


BIN
PDF Office/Resources/ToolBarIcon/MyTools/Image.png


BIN
PDF Office/Resources/ToolBarIcon/MyTools/Line.png


BIN
PDF Office/Resources/ToolBarIcon/MyTools/Note.png


BIN
PDF Office/Resources/ToolBarIcon/MyTools/Point.png


BIN
PDF Office/Resources/ToolBarIcon/MyTools/Rectangle.png


BIN
PDF Office/Resources/ToolBarIcon/MyTools/Selecttool.png


BIN
PDF Office/Resources/ToolBarIcon/MyTools/Stamp.png


BIN
PDF Office/Resources/ToolBarIcon/MyTools/Textbox.png


BIN
PDF Office/Resources/ToolBarIcon/MyTools/wavyline2.png


+ 1 - 1
PDF Office/ViewModels/ViewContentViewModel.cs

@@ -237,7 +237,7 @@ namespace PDF_Office.ViewModels
         {
             dictionary.Add("TabItemPageEdit", "PageEditContent");
             dictionary.Add("TabItemTool", "ToolsBarContent");
-            dictionary.Add("TabItemAnnotation", "");
+            dictionary.Add("TabItemAnnotation", "AnnotToolContent");
             dictionary.Add("TabItemConvert", "");
             dictionary.Add("TabItemScan", "");
             dictionary.Add("TabItemEdit", "");

File diff suppressed because it is too large
+ 139 - 0
PDF Office/Views/Tools/AnnotToolContent.xaml


+ 61 - 0
PDF Office/Views/Tools/AnnotToolContent.xaml.cs

@@ -0,0 +1,61 @@
+using PDF_Office.CustomControl;
+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.Tools
+{
+    /// <summary>
+    /// AnnotToolContent.xaml 的交互逻辑
+    /// </summary>
+    public partial class AnnotToolContent : UserControl
+    {
+        public AnnotToolContent()
+        {
+            InitializeComponent();
+        }
+
+        private void BtnHand_Click(object sender, RoutedEventArgs e)
+        {
+
+        }
+
+        private void BtnTool_Click(object sender, RoutedEventArgs e)
+        {
+            CustomIconToggleBtn keepBtn = sender as CustomIconToggleBtn;
+
+            if (keepBtn != null)
+            {
+                ClearSelectedToolPanel(keepBtn);
+            }
+        }
+
+        private void ClearSelectedToolPanel(CustomIconToggleBtn keepBtn = null)
+        {
+            foreach (var item in ToolPanel.Children)
+            {
+                CustomIconToggleBtn checkBtn = item as CustomIconToggleBtn;
+                if (checkBtn != null && checkBtn != keepBtn)
+                {
+                    checkBtn.IsChecked = false;
+                }
+            }
+        }
+
+        private void BtnBookMark_Click(object sender, RoutedEventArgs e)
+        {
+
+        }
+    }
+}