Bladeren bron

综合-补充分享功能,调整底部工具栏状态

ZhouJieSheng 2 jaren geleden
bovenliggende
commit
c46d638e9d

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

@@ -170,7 +170,7 @@ namespace PDF_Office.ViewModels
             }
         }
 
-        private bool rightPanelEnable;
+        private bool rightPanelEnable = true;
 
         public bool RightPanelEnable
         {

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

@@ -441,6 +441,8 @@ namespace PDF_Office.ViewModels
 
         public DelegateCommand PrintCommand { get; set; }
 
+        public DelegateCommand ShareCommand { get; set; }
+
         #endregion 命令
 
         public ViewContentViewModel(IRegionManager regionManager, IDialogService dialogService, IEventAggregator eventAggregator)
@@ -456,6 +458,7 @@ namespace PDF_Office.ViewModels
             SaveAsFile = new DelegateCommand(() => { saveAsFile(); });
             UndoCommand = new DelegateCommand(Undo);
             RedoCommand = new DelegateCommand(Redo);
+            ShareCommand = new DelegateCommand(share);
             TabControlSelectionChangedCommand = new DelegateCommand<object>(TabControlSelectonChangedEvent);
 
             ViwerRegionName = RegionNames.ViwerRegionName;
@@ -493,6 +496,20 @@ namespace PDF_Office.ViewModels
             EnterSelectedBar("TabItemAnnotation");
         }
 
+        private void share()
+        {
+            try
+            {
+                var path = PDFViewer.Document.FilePath;
+                string subject = "分享至" + " " + PDFViewer.Document.FileName;
+                System.Diagnostics.Process.Start("outlook", "/a,\"" + path + "\"" + "/m \"" + "&subject=" + subject + "\"");
+            }
+            catch
+            {
+                AlertsMessage alertsMessage = new AlertsMessage();
+                alertsMessage.ShowDialog("","未检测到Ooutlook软件,请先安装Outlook","OK");
+            }
+        }
 
         private bool CanSaveExcute()
         {

+ 14 - 2
PDF Office/Views/BottomToolContent.xaml

@@ -122,8 +122,20 @@
             <Button
                 Width="24"
                 Height="24"
-                Margin="8,0" />
-            <Button Width="24" Height="24" />
+                Margin="8,0">
+                <Path
+                    Width="16"
+                    Height="16"
+                    Data="M2.56067 7.28028L5.7803 4.06066L4.71964 3L0.21967 7.49997C-0.0732233 7.79286 -0.0732233 8.26774 0.21967 8.56063L4.71964 13.0606L5.7803 11.9999L2.56065 8.78028L15.75 8.78029V7.28029L2.56067 7.28028Z"
+                    Fill="{StaticResource color.icon.base.neutral.norm.lv1}" />
+            </Button>
+            <Button Width="24" Height="24">
+                <Path
+                    Width="16"
+                    Height="16"
+                    Data="M13.1893 8.78026L9.9697 11.9999L11.0304 13.0605L15.5303 8.56058C15.8232 8.26768 15.8232 7.79281 15.5303 7.49992L11.0304 2.99995L9.9697 4.06061L13.1894 7.28026L0 7.28026V8.78026L13.1893 8.78026Z"
+                    Fill="{StaticResource color.icon.base.neutral.norm.lv1}" />
+            </Button>
         </StackPanel>
         <StackPanel
             x:Name="StkPnlRight"

+ 1 - 0
PDF Office/Views/ViewContent.xaml

@@ -157,6 +157,7 @@
                 </Button>
                 <Button
                     Margin="2,0"
+                    Command="{Binding ShareCommand}"
                     Style="{StaticResource subToolBar}"
                     ToolTip="Share">
                     <Path