Forráskód Böngészése

新手引导-补充新手引导弹窗

ZhouJieSheng 2 éve
szülő
commit
acce8cc865

+ 3 - 0
PDF Office/App.config

@@ -33,6 +33,9 @@
       <setting name="UpdateSettings" serializeAs="String">
         <value>True</value>
       </setting>
+      <setting name="IsNewUser" serializeAs="String">
+        <value>True</value>
+      </setting>
     </PDF_Office.Properties.Settings>
   </userSettings>
 </configuration>

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

@@ -416,6 +416,8 @@ namespace PDF_Office
             containerRegistry.RegisterDialog<LoginDialog>(DialogNames.LoginDialog);
             containerRegistry.RegisterDialog<UserDialog>(DialogNames.UserDialog);
 
+            //新手引导弹窗
+            containerRegistry.RegisterDialog<NoviceGuidDialog>(DialogNames.GuidDialog);
             #endregion 注册弹窗
         }
 

+ 47 - 0
PDF Office/Model/Dialog/GuidItemModel.cs

@@ -0,0 +1,47 @@
+using Prism.Mvvm;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace PDF_Office.Model.Dialog
+{
+    public class GuidItemModel:BindableBase
+    {
+        private string title;
+
+        public string Title
+        {
+            get { return title; }
+            set
+            {
+                SetProperty(ref title, value);
+            }
+        }
+
+        private string content;
+        /// <summary>
+        /// 文案内容
+        /// </summary>
+        public string Content
+        {
+            get { return content; }
+            set
+            {
+                SetProperty(ref content, value);
+            }
+        }
+
+        private string imageSource;
+        //图片路径
+        public string ImageSource
+        {
+            get { return imageSource; }
+            set
+            {
+                SetProperty(ref imageSource, value);
+            }
+        }
+    }
+}

+ 5 - 1
PDF Office/Model/DialogNames.cs

@@ -11,6 +11,11 @@ namespace PDF_Office.Model
     /// </summary>
     public static class DialogNames
     {
+        /// <summary>
+        /// 新手引导弹窗
+        /// </summary>
+        public static string GuidDialog = "GuidDialog";
+
         /// <summary>
         /// 注册弹窗
         /// </summary>
@@ -26,7 +31,6 @@ namespace PDF_Office.Model
         /// </summary>
         public static string UserDialog = "UserDialog";
 
-
         /// <summary>
         /// 文档属性
         /// </summary>

+ 24 - 0
PDF Office/PDF Office.csproj

@@ -377,6 +377,7 @@
     <Compile Include="Model\Dialog\ConverterDialogs\ConverterRTFDialogModel.cs" />
     <Compile Include="Model\Dialog\ConverterDialogs\ConverterTextDialogModel.cs" />
     <Compile Include="Model\Dialog\ConverterDialogs\ConverterWordDialogModel.cs" />
+    <Compile Include="Model\Dialog\GuidItemModel.cs" />
     <Compile Include="Model\Dialog\HomePageToolsDialogs\HomePageBatchProcessing\HomePageBatchProcessingDialogModel.cs" />
     <Compile Include="Model\Dialog\HomePageToolsDialogs\HomePageBatchProcessing\HomePageCompressDialogModel.cs" />
     <Compile Include="Model\Dialog\HomePageToolsDialogs\HomePageBatchProcessing\HomePageConverter\HomePageConverterCSVModel.cs" />
@@ -448,6 +449,7 @@
     </Compile>
     <Compile Include="ViewModels\Dialog\HomePageToolsDialogs\CreateFromHtmlDialogViewModel.cs" />
     <Compile Include="ViewModels\Dialog\HomePageToolsDialogs\CreateFromScannerDialogsViewModel.cs" />
+    <Compile Include="ViewModels\Dialog\NoviceGuidDialogViewModel.cs" />
     <Compile Include="ViewModels\Dialog\PropertiesDialogViewModel.cs" />
     <Compile Include="ViewModels\Dialog\Redaction\MarkSettingDialogViewModel.cs" />
     <Compile Include="ViewModels\Dialog\Redaction\PageMarkDialogViewModel.cs" />
@@ -815,6 +817,9 @@
     <Compile Include="Views\Dialog\HomePageToolsDialogs\HomePageSplitDialog.xaml.cs">
       <DependentUpon>HomePageSplitDialog.xaml</DependentUpon>
     </Compile>
+    <Compile Include="Views\Dialog\NoviceGuidDialog.xaml.cs">
+      <DependentUpon>NoviceGuidDialog.xaml</DependentUpon>
+    </Compile>
     <Compile Include="Views\Dialog\PageEditDialogs\ExtractDialog.xaml.cs">
       <DependentUpon>ExtractDialog.xaml</DependentUpon>
     </Compile>
@@ -1555,6 +1560,10 @@
       <SubType>Designer</SubType>
       <Generator>MSBuild:Compile</Generator>
     </Page>
+    <Page Include="Views\Dialog\NoviceGuidDialog.xaml">
+      <SubType>Designer</SubType>
+      <Generator>MSBuild:Compile</Generator>
+    </Page>
     <Page Include="Views\Dialog\PageEditDialogs\SplitDialog.xaml">
       <SubType>Designer</SubType>
       <Generator>MSBuild:Compile</Generator>
@@ -2158,6 +2167,21 @@
     <Resource Include="Resources\Dialog\password.png" />
     <Resource Include="Resources\BOTA\no search.png" />
     <Resource Include="Resources\Dialog\helphover.png" />
+    <Content Include="Resources\GuidItems\Guid_Annote.png">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </Content>
+    <Content Include="Resources\GuidItems\Guid_Convert.png">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </Content>
+    <Content Include="Resources\GuidItems\Guid_FillAndSign.png">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </Content>
+    <Content Include="Resources\GuidItems\Guid_Office.png">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </Content>
+    <Content Include="Resources\GuidItems\Guid_SignUp.png">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </Content>
     <Content Include="source\AnalysisWord\Res\word\_rels\document.xml.rels">
       <CopyToOutputDirectory>Always</CopyToOutputDirectory>
     </Content>

+ 13 - 1
PDF Office/Properties/Settings.Designer.cs

@@ -12,7 +12,7 @@ namespace PDF_Office.Properties {
     
     
     [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
-    [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "17.1.0.0")]
+    [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "16.10.0.0")]
     internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
         
         private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
@@ -236,5 +236,17 @@ namespace PDF_Office.Properties {
                 this["ColorSelectors"] = value;
             }
         }
+        
+        [global::System.Configuration.UserScopedSettingAttribute()]
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        [global::System.Configuration.DefaultSettingValueAttribute("True")]
+        public bool IsNewUser {
+            get {
+                return ((bool)(this["IsNewUser"]));
+            }
+            set {
+                this["IsNewUser"] = value;
+            }
+        }
     }
 }

+ 3 - 0
PDF Office/Properties/Settings.settings

@@ -59,5 +59,8 @@
     <Setting Name="ColorSelectors" Type="PDFSettings.ColorSelectorList" Scope="User">
       <Value Profile="(Default)" />
     </Setting>
+    <Setting Name="IsNewUser" Type="System.Boolean" Scope="User">
+      <Value Profile="(Default)">True</Value>
+    </Setting>
   </Settings>
 </SettingsFile>

BIN
PDF Office/Resources/GuidItems/Guid_Annote.png


BIN
PDF Office/Resources/GuidItems/Guid_Convert.png


BIN
PDF Office/Resources/GuidItems/Guid_FillAndSign.png


BIN
PDF Office/Resources/GuidItems/Guid_Office.png


BIN
PDF Office/Resources/GuidItems/Guid_SignUp.png


+ 3 - 0
PDF Office/Styles/ButtonStyle.xaml

@@ -495,12 +495,15 @@
         <Style.Triggers>
             <Trigger Property="IsMouseOver" Value="true">
                 <Setter Property="Foreground" Value="{StaticResource color.btn.link.text.hov}" />
+                <Setter Property="Background" Value="Transparent" />
             </Trigger>
             <Trigger Property="IsPressed" Value="true">
                 <Setter Property="Foreground" Value="{StaticResource color.btn.link.text.act}" />
+                <Setter Property="Background" Value="Transparent" />
             </Trigger>
             <Trigger Property="IsEnabled" Value="false">
                 <Setter Property="Foreground" Value="{StaticResource color.btn.link.text.dis}" />
+                <Setter Property="Background" Value="Transparent" />
             </Trigger>
         </Style.Triggers>
     </Style>

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

@@ -0,0 +1,188 @@
+using PDF_Office.Model;
+using PDF_Office.Model.Dialog;
+using Prism.Commands;
+using Prism.Mvvm;
+using Prism.Services.Dialogs;
+using System;
+using System.Collections.Generic;
+using System.Collections.ObjectModel;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows;
+
+namespace PDF_Office.ViewModels.Dialog
+{
+    public class NoviceGuidDialogViewModel :BindableBase,IDialogAware
+    {
+        public string Title => "";
+
+        public event Action<IDialogResult> RequestClose;
+
+        private int selectedIndex;
+
+        /// <summary>
+        /// 选中索引
+        /// </summary>
+        public int SelectedIndex
+        {
+            get { return selectedIndex; }
+            set
+            {
+                SetProperty(ref selectedIndex, value);
+
+                if(SelectedIndex==ItemSource.Count-1)
+                {
+                    SignUpVisible = Visibility.Visible;
+                }
+                else
+                {
+                    SignUpVisible = Visibility.Collapsed;
+                }
+
+                if(SelectedIndex==0)
+                {
+                    NextTimeVisible = Visibility.Visible;
+                }
+                else
+                {
+                    NextTimeVisible = Visibility.Collapsed;
+                }
+            }
+        }
+
+        private Visibility signUpVisible = Visibility.Collapsed;
+
+        /// <summary>
+        /// 是否显示SignUp按钮
+        /// </summary>
+        public Visibility SignUpVisible
+        {
+            get { return signUpVisible; }
+            set
+            {
+                SetProperty(ref signUpVisible, value);
+            }
+        }   
+
+        private Visibility nexttimeVisible;
+
+        public Visibility NextTimeVisible
+        {
+            get { return nexttimeVisible; }
+            set
+            {
+                SetProperty(ref nexttimeVisible, value);
+            }
+        }
+
+
+
+        public DelegateCommand NextPageCommand { get; set; }
+
+        public DelegateCommand PrePageCommand { get; set; }
+
+        public DelegateCommand NextTimeCommand { get; set; }
+
+        public DelegateCommand SignUpCommand { get; set; }
+
+        public ObservableCollection<GuidItemModel> ItemSource { get; set; }
+
+        private IDialogService dialog;
+
+        public NoviceGuidDialogViewModel(IDialogService dialogService)
+        {
+            dialog = dialogService;
+
+            NextPageCommand = new DelegateCommand(NextPage,CanNextPageExcute).ObservesProperty(()=>SelectedIndex);
+            PrePageCommand = new DelegateCommand(PrePage,CanPrePageExcute).ObservesProperty(()=>SelectedIndex);
+            SignUpCommand = new DelegateCommand(SignUp);
+
+            InitItemSource();
+        }
+
+        private void InitItemSource()
+        {
+            ItemSource = new ObservableCollection<GuidItemModel>();
+            ItemSource.Add(new GuidItemModel() { ImageSource = "pack://application:,,,/PDF Office;component/Resources/GuidItems/Guid_Office.png", Title = "PDF Office 全新体验版", Content = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" });
+            ItemSource.Add(new GuidItemModel() { ImageSource = "pack://application:,,,/PDF Office;component/Resources/GuidItems/Guid_Annote.png", Title = "强大的PDF注释工具", Content = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" });
+            ItemSource.Add(new GuidItemModel() { ImageSource = "pack://application:,,,/PDF Office;component/Resources/GuidItems/Guid_Convert.png", Title = "将PDF转换为可编辑Office", Content = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" });
+            ItemSource.Add(new GuidItemModel() { ImageSource = "pack://application:,,,/PDF Office;component/Resources/GuidItems/Guid_FillAndSign.png", Title = "填写表格,签署商务文件", Content = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" });
+            ItemSource.Add(new GuidItemModel() { ImageSource = "pack://application:,,,/PDF Office;component/Resources/GuidItems/Guid_SignUp.png", Title = "注册账号享受全功能", Content = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" });
+        }
+
+        /// <summary>
+        /// 前一页
+        /// </summary>
+        private void NextPage()
+        {
+            SelectedIndex++;
+        }
+
+        /// <summary>
+        /// 下一页
+        /// </summary>
+        private void PrePage()
+        {
+            SelectedIndex--;
+        }
+
+        /// <summary>
+        /// 注册
+        /// </summary>
+        private void SignUp()
+        {
+            RequestClose.Invoke(new DialogResult());
+            dialog.ShowDialog(DialogNames.RegisterDialog);
+        }
+
+        /// <summary>
+        /// 下一次显示
+        /// </summary>
+        private void NextTime()
+        {
+            //Todo
+        }
+
+
+        //是否可以执行下一页
+        private bool CanNextPageExcute()
+        {
+            if(SelectedIndex>=ItemSource.Count-1)
+            {
+                return false;
+            }
+
+            return true;
+        }
+
+        /// <summary>
+        /// 是否可以执行上一页
+        /// </summary>
+        /// <returns></returns>
+        private bool CanPrePageExcute()
+        {
+            if (SelectedIndex <= 0)
+            {
+                return false;
+            }
+            return true;
+        }
+
+
+        public bool CanCloseDialog()
+        {
+            return true;
+        }
+
+        public void OnDialogClosed()
+        {
+          
+        }
+
+        public void OnDialogOpened(IDialogParameters parameters)
+        {
+           
+        }
+    }
+}

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

@@ -221,11 +221,24 @@ namespace PDF_Office.ViewModels
                 System.Windows.Application.Current.Dispatcher.BeginInvoke(System.Windows.Threading.DispatcherPriority.Send, new Action(() =>
                 {
                     region.RequestNavigate(RegionNames.MainRegion, "MainContent");
-                    if (App.IsShowRegist)
+
+                    try
                     {
-                        OpenRegister();
+                        //避免注册弹窗和新手引导弹窗一起弹出
+                        if (App.IsShowRegist && !Settings.Default.IsNewUser)
+                        {
+                            OpenRegister();
+                        }
+
+                        //新用户弹出引导弹窗
+                        if (Settings.Default.IsNewUser)
+                        {
+                            ShowGuidDialog();
+                            Settings.Default.IsNewUser = false;
+                            Settings.Default.Save();
+                        }
                     }
-
+                    catch { }
                 }
                 ));
                 App.IsFirstOpen = false;
@@ -237,11 +250,20 @@ namespace PDF_Office.ViewModels
                 {
                     LoginVis = Visibility.Visible;
                 }
-               
+
+
             }
             
         }
 
+        //显示新手引导弹窗
+        private void ShowGuidDialog()
+        {
+            dialogs.ShowDialog(DialogNames.GuidDialog, null, r =>
+            {
+            });
+        }
+
         //打开注册弹窗
         public void OpenRegister()
         {

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

@@ -1666,7 +1666,6 @@ namespace PDF_Office.ViewModels
             CanSave = PDFViewer.UndoManager.CanSave;
             CanUndo = PDFViewer.UndoManager.CanUndo;
             CanRedo = PDFViewer.UndoManager.CanRedo;
-            region.Regions[ViwerRegionName].RemoveAll();
 
             //OpenFileInfo 内容赋值给PDFViewer
             GetOpenFileInfo();
@@ -1674,6 +1673,9 @@ namespace PDF_Office.ViewModels
             region.AddToRegion(ViwerRegionName, PDFViewer);
         }
 
+        /// <summary>
+        /// 还原上一次浏览的视图相关设置
+        /// </summary>
         private void GetOpenFileInfo()
         {
             OpenFileInfo = SettingHelper.GetFileInfo(PDFViewer.Document.FilePath);

A különbségek nem kerülnek megjelenítésre, a fájl túl nagy
+ 232 - 0
PDF Office/Views/Dialog/NoviceGuidDialog.xaml


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