Browse Source

综合-补充新手引导下次再看功能

ZhouJieSheng 1 year ago
parent
commit
15cbb279be

+ 14 - 19
PDF Office/CustomControl/AlertsMessage.xaml

@@ -2,6 +2,7 @@
     x:Class="PDF_Office.CustomControl.AlertsMessage"
     xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
     xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+    xmlns:Themes="clr-namespace:Microsoft.Windows.Themes;assembly=PresentationFramework.Aero2"
     xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
     xmlns:local="clr-namespace:PDF_Office.CustomControl"
     xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
@@ -12,39 +13,33 @@
     ResizeMode="NoResize"
     ShowInTaskbar="False"
     SizeToContent="Height"
+    Style="{StaticResource DialogWindowStyle}"
     WindowStartupLocation="CenterScreen"
-    WindowStyle="None"
     mc:Ignorable="d">
     <Border
         Height="auto"
         Background="White"
-        BorderBrush="Gray"
-        BorderThickness="1"
         CornerRadius="6"
         MouseLeftButtonDown="Border_PreviewMouseLeftButtonDown">
-        <Grid Margin="20,24,20,0">
+        <Grid Margin="16,0">
             <Grid.RowDefinitions>
-                <RowDefinition Height="auto" />
-                <RowDefinition />
+                <RowDefinition Height="*" />
+                <RowDefinition Height="auto " />
             </Grid.RowDefinitions>
-            <Grid.ColumnDefinitions>
-                <ColumnDefinition Width="Auto" />
-                <ColumnDefinition />
-            </Grid.ColumnDefinitions>
-            <StackPanel
-                Grid.Column="0"
-                Grid.ColumnSpan="2"
-                VerticalAlignment="Center">
+            <StackPanel VerticalAlignment="Center">
                 <TextBlock
                     x:Name="TitleText"
-                    FontSize="14"
+                    Margin="0,16,0,0"
+                    FontSize="16"
                     FontWeight="SemiBold"
+                    Foreground="{StaticResource color.sys.text.neutral.lv1}"
                     Text="Make sure to delete the selected material?"
                     TextWrapping="Wrap" />
                 <TextBlock
                     x:Name="ContentText"
-                    Margin="0,4,0,0"
-                    FontSize="12"
+                    Margin="0,16"
+                    FontSize="14"
+                    Foreground="{StaticResource color.sys.text.neutral.lv1}"
                     Text="Make sure to delete the selected material?"
                     TextWrapping="Wrap" />
             </StackPanel>
@@ -52,7 +47,7 @@
             <Grid
                 x:Name="BtnGrid"
                 Grid.Row="1"
-                Grid.ColumnSpan="2">
+                Height="64">
                 <Grid.ColumnDefinitions>
                     <ColumnDefinition />
                     <ColumnDefinition />
@@ -96,6 +91,6 @@
                     Style="{StaticResource Btn.cta}" />
             </Grid>
         </Grid>
-    </Border>
 
+    </Border>
 </Window>

+ 7 - 0
PDF Office/ViewModels/Dialog/NoviceGuidDialogViewModel.cs

@@ -97,10 +97,17 @@ namespace PDF_Office.ViewModels.Dialog
             NextPageCommand = new DelegateCommand(NextPage,CanNextPageExcute).ObservesProperty(()=>SelectedIndex);
             PrePageCommand = new DelegateCommand(PrePage,CanPrePageExcute).ObservesProperty(()=>SelectedIndex);
             SignUpCommand = new DelegateCommand(SignUp);
+            NextTimeCommand = new DelegateCommand(nexttime);
 
             InitItemSource();
         }
 
+        private void nexttime()
+        {
+            //忽略,下次再看
+            this.RequestClose(new DialogResult(ButtonResult.Ignore));
+        }
+
         private void InitItemSource()
         {
             ItemSource = new ObservableCollection<GuidItemModel>();

+ 13 - 4
PDF Office/ViewModels/MainWindowViewModel.cs

@@ -276,9 +276,12 @@ namespace PDF_Office.ViewModels
                         //新用户弹出引导弹窗
                         if (Settings.Default.IsNewUser)
                         {
-                            ShowGuidDialog();
-                            Settings.Default.IsNewUser = false;
-                            Settings.Default.Save();
+                            if (ShowGuidDialog())
+                            {
+                                //未点击下次再看时,下次启动窗体不再显示
+                                Settings.Default.IsNewUser = false;
+                                Settings.Default.Save();
+                            }
                         }
                     }
                     catch { }
@@ -326,11 +329,17 @@ namespace PDF_Office.ViewModels
         }
 
         //显示新手引导弹窗
-        private void ShowGuidDialog()
+        private bool ShowGuidDialog()
         {
+            bool result = true;
             dialogs.ShowDialog(DialogNames.GuidDialog, null, r =>
             {
+                if(r.Result == ButtonResult.Ignore)
+                {
+                    result = false;
+                }
             });
+            return result;
         }
 
         //打开注册弹窗

+ 1 - 0
PDF Office/Views/Dialog/HomePageToolsDialogs/HomePagePictureToPDFDialog.xaml

@@ -13,6 +13,7 @@
     d:DataContext="{d:DesignInstance Type=homepagetoolsdialogs:HomePagePictureToPDFDialogViewModel}"
     prism:Dialog.WindowStyle="{StaticResource stlWindowEx}"
     d:DesignHeight="640"
+    SizeChanged="userControl_SizeChanged"
     d:DesignWidth="1024"
     prism:ViewModelLocator.AutoWireViewModel="True"
     mc:Ignorable="d">

+ 12 - 2
PDF Office/Views/Dialog/HomePageToolsDialogs/HomePagePictureToPDFDialog.xaml.cs

@@ -207,12 +207,10 @@ namespace PDF_Office.Views.Dialog.HomePageToolsDialogs
         {
             if (Window.GetWindow(this).WindowState == WindowState.Maximized)
             {
-                ico_max.Visibility = Visibility.Collapsed;
                 System.Windows.SystemCommands.RestoreWindow(Window.GetWindow(this));
             }
             else
             {
-                ico_max.Visibility = Visibility.Visible;
                 System.Windows.SystemCommands.MaximizeWindow(Window.GetWindow(this));
             }
         }
@@ -233,5 +231,17 @@ namespace PDF_Office.Views.Dialog.HomePageToolsDialogs
             }
 
         }
+
+        private void userControl_SizeChanged(object sender, SizeChangedEventArgs e)
+        {
+            if (Window.GetWindow(this).WindowState == WindowState.Maximized)
+            {
+                ico_max.Visibility = Visibility.Collapsed;
+            }
+            else
+            {
+                ico_max.Visibility = Visibility.Visible;
+            }
+        }
     }
 }

+ 1 - 0
PDF Office/Views/Dialog/NoviceGuidDialog.xaml

@@ -224,6 +224,7 @@
                 Height="22"
                 Margin="0,8,0,0"
                 HorizontalAlignment="Center"
+                Command="{Binding NextTimeCommand}"
                 Content="Next Time"
                 Style="{StaticResource btn.link}"
                 Visibility="{Binding NextTimeVisible}" />

+ 1 - 1
PDF Office/Views/HomePanel/RecentFiles/DocItemControl.xaml.cs

@@ -53,7 +53,7 @@ namespace PDF_Office.Views.HomePanel.RecentFiles
                     }
                     else
                     CoverImage.Source = ToolMethod.GetFileThumbImg("pack://application:,,,/Resources//FilesType/ic_propertybar_file_png_Large.png");
-                    tempdoc.Release();
+                    tempdoc?.Release();
                 }
             }
         }

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

@@ -127,11 +127,11 @@ namespace PDF_Office.Views
 
             if (this.WindowState == WindowState.Maximized)
             {
-                ico_max.Visibility = Visibility.Visible;
+                ico_max.Visibility = Visibility.Collapsed;
             }
             else
             {
-                ico_max.Visibility = Visibility.Collapsed;
+                ico_max.Visibility = Visibility.Visible;
             }
         }
 

+ 4 - 2
PDF Office/Views/ViewContent.xaml

@@ -191,7 +191,8 @@
                                 <MenuItem
                                     Command="{Binding HelpCommand}"
                                     CommandParameter="Online"
-                                    Header="在线帮助" />
+                                    Header="在线帮助"
+                                    Visibility="Collapsed" />
                                 <MenuItem
                                     Command="{Binding HelpCommand}"
                                     CommandParameter="More"
@@ -203,7 +204,8 @@
                                 <MenuItem
                                     Command="{Binding HelpCommand}"
                                     CommandParameter="Blog"
-                                    Header="订阅电子报" />
+                                    Header="订阅电子报"
+                                    Visibility="Collapsed" />
                                 <MenuItem
                                     Command="{Binding HelpCommand}"
                                     CommandParameter="ComPDF"