Browse Source

阅读模式-bota初版(不上了)

OYXH\oyxh 1 year ago
parent
commit
7964521a16

+ 5 - 0
PDF Office/ViewModels/Tools/AnnotToolContentViewModel.Command.cs

@@ -1262,9 +1262,14 @@ namespace PDF_Master.ViewModels.Tools
                 //空白处 右键菜单 添加注释   为单次添加,不连续添加
                 if (IsNoSelectMenu && PropertyPanel.IsAddLink == false)
                 {
+                    viewContentViewModel.ReadModeIsShowProperty = false;
                     IsNoSelectMenu = false;
                     ExitAnnotationTool();
                 }
+                if (viewContentViewModel.IsRightMenuSelectedTextAddLink == false)
+                {
+                    viewContentViewModel.ReadModeIsShowProperty = false;
+                }
             }
         }
 

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

@@ -207,7 +207,7 @@ namespace PDF_Master.ViewModels
 
         public OpenFileInfo OpenFileInfo = null;
         public CPDFViewer PDFViewer { get; set; }
-
+        public bool ReadModeIsShowProperty { get; set; } = false;
         public MainContentViewModel mainViewModel { get; set; }
 
         public IRegionManager region;

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

@@ -500,7 +500,10 @@
                         </ColumnDefinition.Style>
                     </ColumnDefinition>
                 </Grid.ColumnDefinitions>
-                <ContentControl prism:RegionManager.RegionName="{Binding BOTARegionName}" SizeChanged="ContentControl_SizeChanged" />
+                <ContentControl
+                    x:Name="BOTAContent"
+                    prism:RegionManager.RegionName="{Binding BOTARegionName}"
+                    SizeChanged="ContentControl_SizeChanged" />
                 <GridSplitter
                     Name="BOTASplitter"
                     Grid.Column="1"
@@ -605,6 +608,16 @@
         </Border>
         <cus:LoadingControl Grid.RowSpan="3" Visibility="{Binding IsLoading}" />
 
+        <Rectangle
+            x:Name="RectangleBota"
+            Grid.Row="2"
+            Width="10"
+            Height="{Binding ActualHeight, ElementName=GridViewer, Mode=OneWay}"
+            Margin="0,0,0,0"
+            HorizontalAlignment="Left"
+            VerticalAlignment="Bottom"
+            Fill="Red"
+            Visibility="Collapsed" />
         <!--  阅读模式下的页面控件  -->
         <Border
             x:Name="ReadModeContent"

+ 93 - 4
PDF Office/Views/ViewContent.xaml.cs

@@ -6,6 +6,7 @@ using PDF_Master.Model;
 using PDF_Master.ViewModels;
 using PDF_Master.ViewModels.PropertyPanel.ViewModular;
 using PDF_Master.ViewModels.Tools;
+using PDF_Master.Views.BOTA;
 using PDF_Master.Views.Dialog;
 using PDF_Master.Views.PropertyPanel.ViewModular;
 using PDF_Master.Views.Tools;
@@ -36,6 +37,7 @@ namespace PDF_Master.Views
         /// 是否是展开工具栏
         /// </summary>
         private bool expandToolRow = true;
+
         public ViewContent()
         {
             InitializeComponent();
@@ -75,6 +77,7 @@ namespace PDF_Master.Views
 
         private void ChangeReadModePropertyOpenUI(ReadModePropertyOpenArgs obj)
         {
+            viewModel.ReadModeIsShowProperty = true;
             Grid.SetColumnSpan(GridViewer, 3);
             Grid.SetColumn(GridViewer, 0);
             Grid.SetColumn(Scroller, 4);
@@ -92,6 +95,15 @@ namespace PDF_Master.Views
                 Grid.SetRow(DocumentView, 0);
                 Grid.SetColumnSpan(GridViewer, 4);
                 Grid.SetColumn(GridViewer, 0);
+
+                #region to do
+
+                //Grid.SetRowSpan(RectangleBota, 4);
+                //Grid.SetRow(RectangleBota, 0);
+
+                //RectangleBota.Visibility = Visibility.Visible;
+
+                #endregion to do
             }
             else
             {
@@ -103,6 +115,83 @@ namespace PDF_Master.Views
                 Grid.SetColumn(GridViewer, 2);
                 Grid.SetColumnSpan(GridViewer, 1);
 
+                #region to do
+
+                //Grid.SetRowSpan(RectangleBota, 1);
+                //Grid.SetRow(RectangleBota, 2);
+
+                //RectangleBota.Visibility = Visibility.Visible;
+
+                //Panel.SetZIndex(BOTAContent, 0);
+                //Panel.SetZIndex(BOTASplitter, 0);
+
+                #endregion to do
+            }
+        }
+
+        private void RectangleBota_MouseEnter(object sender, MouseEventArgs e)
+        {
+            if (viewModel.mainViewModel.IsBookMode)
+            {
+                RectangleBota.Visibility = Visibility.Collapsed;
+
+                BOTAContent.Visibility = Visibility.Visible;
+                Panel.SetZIndex(BOTAContent, 2);
+                Panel.SetZIndex(BOTASplitter, 2);
+
+                ReadModeContent.Visibility = Visibility.Visible;
+                RectangleReadMode.Visibility = Visibility.Collapsed;
+                //因为ispropertyOpen 属性改成了单向控制  因此这里的语句不再适用
+                //this.TbtnProperty.IsChecked = false;
+                Grid.SetRowSpan(DocumentView, 4);
+                Grid.SetRow(DocumentView, 0);
+                Grid.SetColumnSpan(GridViewer, 1);
+                Grid.SetColumn(GridViewer, 2);
+
+                Grid.SetColumnSpan(BOTAContent, 1);
+                Grid.SetColumn(BOTAContent, 0);
+
+                Grid.SetColumnSpan(BOTASplitter, 1);
+                Grid.SetColumn(BOTASplitter, 1);
+
+                Grid.SetRowSpan(RectangleBota, 4);
+                Grid.SetRow(RectangleBota, 0);
+            }
+            else
+            {
+            }
+        }
+
+        private void GridViewer_MouseEnter(object sender, MouseEventArgs e)
+        {
+            if (viewModel.mainViewModel.IsBookMode)
+            {
+                ReadModeContent.Visibility = Visibility.Visible;
+                RectangleReadMode.Visibility = Visibility.Collapsed;
+                //因为ispropertyOpen 属性改成了单向控制  因此这里的语句不再适用
+                //this.TbtnProperty.IsChecked = false;
+                Grid.SetRowSpan(DocumentView, 4);
+                Grid.SetRow(DocumentView, 0);
+
+                Grid.SetRowSpan(RectangleBota, 4);
+                Grid.SetRow(RectangleBota, 0);
+
+                Panel.SetZIndex(BOTAContent, 0);
+                Panel.SetZIndex(BOTASplitter, 0);
+
+                RectangleBota.Visibility = Visibility.Visible;
+
+                if (viewModel.ReadModeIsShowProperty)
+                {
+                    Grid.SetColumnSpan(GridViewer, 3);
+                    Grid.SetColumn(GridViewer, 0);
+                    Grid.SetColumn(Scroller, 4);
+                }
+                else
+                {
+                    Grid.SetColumnSpan(GridViewer, 4);
+                    Grid.SetColumn(GridViewer, 0);
+                }
             }
         }
 
@@ -372,7 +461,7 @@ namespace PDF_Master.Views
 
         private void UserControl_IsVisibleChanged(object sender, DependencyPropertyChangedEventArgs e)
         {
-            if((bool)e.NewValue)
+            if ((bool)e.NewValue)
             {
                 //显示后自动聚焦,解决切换页签或者刚打开后直接按快捷键没响应的问题
                 System.Windows.Application.Current.Dispatcher.BeginInvoke(System.Windows.Threading.DispatcherPriority.Send, new Action(() =>
@@ -395,14 +484,14 @@ namespace PDF_Master.Views
         private void UserControl_MouseDown(object sender, MouseButtonEventArgs e)
         {
             //鼠标侧键无法在Xaml里绑定  因此写在后台代码里
-            if(e.ChangedButton == MouseButton.XButton2)
+            if (e.ChangedButton == MouseButton.XButton2)
             {
-                if(GlobalCommands.PreViewCommand.CanExecute(null))
+                if (GlobalCommands.PreViewCommand.CanExecute(null))
                 {
                     GlobalCommands.PreViewCommand.Execute(null);
                 }
             }
-            else if(e.ChangedButton == MouseButton.XButton1)
+            else if (e.ChangedButton == MouseButton.XButton1)
             {
                 if (GlobalCommands.NextViewCommand.CanExecute(null))
                 {