OYXH\oyxh 2 anni fa
parent
commit
dbdac72a6c

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

@@ -271,11 +271,12 @@ namespace PDF_Office
             containerRegistry.RegisterForNavigation<ComboxProperty>();
             containerRegistry.RegisterForNavigation<RadioButtonProperty>();
             containerRegistry.RegisterForNavigation<SignProperty>();
-            containerRegistry.RegisterForNavigation<LinkAnnotTip>();
 
             //Tip
             containerRegistry.RegisterForNavigation<SetPasswordSuccessfullyTip>();
             containerRegistry.RegisterForNavigation<FileRestrictedTip>();
+            containerRegistry.RegisterForNavigation<LinkAnnotTip>();
+            containerRegistry.RegisterForNavigation<ReadModelTip>();
 
             #endregion 注册内容组件
 

+ 7 - 0
PDF Office/PDF Office.csproj

@@ -1084,6 +1084,9 @@
     <Compile Include="Views\TipContent\LinkAnnotTip.xaml.cs">
       <DependentUpon>LinkAnnotTip.xaml</DependentUpon>
     </Compile>
+    <Compile Include="Views\TipContent\ReadModelTip.xaml.cs">
+      <DependentUpon>ReadModelTip.xaml</DependentUpon>
+    </Compile>
     <Compile Include="Views\TipContent\SetPasswordSuccessfullyTip.xaml.cs">
       <DependentUpon>SetPasswordSuccessfullyTip.xaml</DependentUpon>
     </Compile>
@@ -1968,6 +1971,10 @@
       <Generator>MSBuild:Compile</Generator>
       <SubType>Designer</SubType>
     </Page>
+    <Page Include="Views\TipContent\ReadModelTip.xaml">
+      <SubType>Designer</SubType>
+      <Generator>MSBuild:Compile</Generator>
+    </Page>
     <Page Include="Views\TipContent\SetPasswordSuccessfullyTip.xaml">
       <SubType>Designer</SubType>
       <Generator>MSBuild:Compile</Generator>

+ 26 - 10
PDF Office/ViewModels/ViewContentViewModel.cs

@@ -22,7 +22,6 @@ using PDFSettings.Settings;
 using PDF_Office.Model.Dialog.ToolsDialogs.SaftyDialogs;
 using static PDF_Office.Model.Dialog.ToolsDialogs.SaftyDialogs.SetPasswordDialogModel;
 
-
 namespace PDF_Office.ViewModels
 {
     public class ViewContentViewModel : BindableBase, INavigationAware
@@ -98,6 +97,7 @@ namespace PDF_Office.ViewModels
         }
 
         private Visibility leftTipVisible = Visibility.Collapsed;
+
         public Visibility LeftTipVisible
         {
             get { return leftTipVisible; }
@@ -394,7 +394,6 @@ namespace PDF_Office.ViewModels
             }
         }
 
-
         private int selectedIndex;
 
         /// <summary>
@@ -572,8 +571,6 @@ namespace PDF_Office.ViewModels
             EnterSelectedBar("TabItemAnnotation");
         }
 
-
-
         /// <summary>
         /// 设置Tip状态栏的显示状态
         /// </summary>
@@ -616,6 +613,7 @@ namespace PDF_Office.ViewModels
                 region.RequestNavigate(LeftTipContentRegionName, "FileRestrictedTip", param);
             }
         }
+
         public void ShowSelectedTip(ShowTipEventArgs showTipEventArgs)
         {
             switch (showTipEventArgs.enumTipKind)
@@ -623,10 +621,12 @@ namespace PDF_Office.ViewModels
                 case EnumTipKind.StatusNone:
                     ShowLeftTip(false);
                     break;
+
                 case EnumTipKind.StatusSetPasswordSuccessfully:
                     ShowLeftTip(true);
                     region.RequestNavigate(LeftTipContentRegionName, "SetPasswordSuccessfullyTip");
                     break;
+
                 default: break;
             }
         }
@@ -929,15 +929,30 @@ namespace PDF_Office.ViewModels
             {
                 EnterSelectedBar(CurrentBar);
             }
-
-            //isInPageEdit = false;
-            //ShowContent(CurrentBar, false);
-            //isInPageEdit = false;
+            bool isExist = false;
+            if (region.Regions.ContainsRegionWithName(TipContentRegionName))
+            {
+                var views = region.Regions[TipContentRegionName].Views;
+                foreach (var item in views)
+                {
+                    if (item is Views.TipContent.ReadModelTip readModelTip)
+                    {
+                        isExist = true;
+                        break;
+                    }
+                }
+            }
+            if (isExist == false)
+            {
+                region.RequestNavigate(TipContentRegionName, "ReadModelTip");
+            }
 
             IsLoading = Visibility.Collapsed;
-            ReadModelTip = Visibility.Visible;
+            //ReadModelTip = Visibility.Visible;
+            ShowTip(true);
             await Task.Delay(3000);
-            ReadModelTip = Visibility.Collapsed;
+            //ReadModelTip = Visibility.Collapsed;
+            TipVisible = Visibility.Collapsed;
         }
 
         #region PDFViewer鼠标滚轮缩放事件
@@ -1478,6 +1493,7 @@ namespace PDF_Office.ViewModels
                 isInPageEdit = false;
             }
         }
+
         #endregion 方法
     }
 }

+ 28 - 0
PDF Office/Views/TipContent/ReadModelTip.xaml

@@ -0,0 +1,28 @@
+<UserControl
+    x:Class="PDF_Office.Views.TipContent.ReadModelTip"
+    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
+    xmlns:local="clr-namespace:PDF_Office.Views.TipContent"
+    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
+    xmlns:prism="http://prismlibrary.com/"
+    d:DesignHeight="450"
+    d:DesignWidth="800"
+    prism:ViewModelLocator.AutoWireViewModel="True"
+    mc:Ignorable="d">
+    <Grid>
+        <Border
+            Width="145"
+            Height="40"
+            VerticalAlignment="Top"
+            Background="{StaticResource color.sys.layout.dark.bg}"
+            CornerRadius="4">
+            <TextBlock
+                x:Name="ReadModelTip1"
+                Padding="11"
+                Foreground="#FFFFFFFF"
+                Text="Exit reading mode"
+                TextAlignment="Center" />
+        </Border>
+    </Grid>
+</UserControl>

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

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

@@ -382,21 +382,6 @@
                 VerticalAlignment="Top"
                 prism:RegionManager.RegionName="{Binding LeftTipContentRegionName}"
                 Visibility="{Binding LeftTipVisible}" />
-            <Border
-                Grid.Column="2"
-                Width="145"
-                Height="40"
-                VerticalAlignment="Top"
-                Background="{StaticResource color.sys.layout.dark.bg}"
-                CornerRadius="4"
-                Visibility="{Binding ReadModelTip}">
-                <TextBlock
-                    x:Name="ReadModelTip"
-                    Padding="11"
-                    Foreground="#FFFFFFFF"
-                    Text="Exit reading mode"
-                    TextAlignment="Center" />
-            </Border>
         </Grid>
 
         <!--  用于显示页面编辑、水印、背景、标记密文等功能的区域  -->