Browse Source

综合-整合偏好设置部分逻辑,首页左边栏增加跳转链接

ZhouJieSheng 2 năm trước cách đây
mục cha
commit
820890e728

+ 0 - 2
PDF Office/Model/SettingsDialog/InitialVIewModel.cs

@@ -181,7 +181,6 @@ namespace PDF_Office.Model.SettingsDialog
             this.NotShowBOTA = view.NotShowBOTA;
             this.RememberBOTA = view.RememberBOTA;
             this.ShowOutLine = view.ShowOutLine;
-            this.IsBOTAOpen = view.IsBOTAOpen;
             this.AutoExpandProperty =view.AutoExpandProperty;
             this.ClickOpenProperty = view.ClickOpenProperty;
             this.BackGround = view.BackGround;
@@ -201,7 +200,6 @@ namespace PDF_Office.Model.SettingsDialog
             view.NotShowBOTA = this.NotShowBOTA;
             view.RememberBOTA = this.RememberBOTA;
             view.ShowOutLine = this.ShowOutLine;
-            view.IsBOTAOpen = this.IsBOTAOpen;
             view.AutoExpandProperty = this.AutoExpandProperty;
             view.ClickOpenProperty = this.ClickOpenProperty;
             view.BackGround = this.BackGround;

+ 2 - 0
PDF Office/PDF Office.csproj

@@ -433,6 +433,7 @@
       <DesignTime>True</DesignTime>
       <AutoGen>True</AutoGen>
     </Compile>
+    <Compile Include="Settings.cs" />
     <Compile Include="Strings\HomePage\HomePage.Designer.cs">
       <AutoGen>True</AutoGen>
       <DesignTime>True</DesignTime>
@@ -2187,6 +2188,7 @@
     <Content Include="Resources\GuidItems\Guid_SignUp.png">
       <CopyToOutputDirectory>Always</CopyToOutputDirectory>
     </Content>
+    <Resource Include="Resources\PromotionIcon\black_pdfreaderpro_home_en.png" />
     <Content Include="source\AnalysisWord\Res\word\_rels\document.xml.rels">
       <CopyToOutputDirectory>Always</CopyToOutputDirectory>
     </Content>

+ 8 - 5
PDF Office/Styles/ListViewStyle.xaml

@@ -320,15 +320,18 @@
         <Setter Property="VerticalContentAlignment" Value="Center" />
         <Setter Property="MinWidth" Value="88" />
         <Setter Property="MinHeight" Value="0" />
+        <Setter Property="Background" Value="Transparent" />
         <Setter Property="AllowDrop" Value="False" />
         <Setter Property="Template">
             <Setter.Value>
                 <ControlTemplate TargetType="ListViewItem">
-                    <ContentControl
-                        Width="{TemplateBinding Width}"
-                        HorizontalContentAlignment="Stretch"
-                        Content="{TemplateBinding Content}"
-                        ContentTemplate="{TemplateBinding ContentTemplate}" />
+                    <Border Background="{TemplateBinding Background}">
+                        <ContentControl
+                            Width="{TemplateBinding Width}"
+                            HorizontalContentAlignment="Stretch"
+                            Content="{TemplateBinding Content}"
+                            ContentTemplate="{TemplateBinding ContentTemplate}" />
+                    </Border>
                 </ControlTemplate>
             </Setter.Value>
         </Setter>

+ 15 - 1
PDF Office/ViewModels/BOTA/BOTAContentViewModel.cs

@@ -13,6 +13,7 @@ using DryIoc;
 using Prism.Services.Dialogs;
 using PDF_Office.Views.PageEdit;
 using PDF_Office.Properties;
+using PDF_Office.Helper;
 
 namespace PDF_Office.ViewModels.BOTA
 {
@@ -69,7 +70,7 @@ namespace PDF_Office.ViewModels.BOTA
         private void TabControlSelectionChangedEvent(object e)
         {
             var args = e as SelectionChangedEventArgs;
-            if (args != null)
+            if (args != null&&args.AddedItems.Count>0)
             {
                 if (!string.IsNullOrEmpty((args.AddedItems[0] as TabItem).Name))
                 {
@@ -109,6 +110,11 @@ namespace PDF_Office.ViewModels.BOTA
                 param.Add(ParameterNames.BOTAThumb, true);
             }
             regions.RequestNavigate(BOTAContentRegionName, viewNameByTabItem[currentBar], param);
+
+            var info =  SettingHelper.GetFileInfo(pdfViewer.Document.FilePath);
+            info.BOTASelectedTab = currentBar;
+            info.BOTASelectedInex = SelectedIndex;
+            SettingHelper.SetFileInfo(info);
         }
 
         #region Navigate
@@ -143,6 +149,14 @@ namespace PDF_Office.ViewModels.BOTA
                 viewContentViewModel.OpenBOTA = true;
             }
 
+            //记录上一次BOTA展开情况
+            if(Settings.Default.AppProperties.InitialVIew.RememberBOTA)
+            {
+                var info = SettingHelper.GetFileInfo(pdfview.Document.FilePath);
+                SelectedIndex = info.BOTASelectedInex;
+                EnterSelectedBar(info.BOTASelectedTab);
+                viewContentViewModel.OpenBOTA = true;
+            }
         }
 
         #endregion Navigate

+ 17 - 7
PDF Office/ViewModels/MainContentViewModel.cs

@@ -26,6 +26,7 @@ using System.Drawing.Imaging;
 using ComPDFKit.PDFDocument;
 using static PDF_Office.Model.Dialog.ToolsDialogs.SaftyDialogs.DeleteSafetySettintgsModel;
 using PDF_Office.Model.Dialog.ToolsDialogs.SaftyDialogs;
+using PDF_Office.Properties;
 
 namespace PDF_Office.ViewModels
 {
@@ -357,12 +358,17 @@ namespace PDF_Office.ViewModels
             }
 
             PDFViewer.Load();
+            PDFViewer.SetFormFieldHighlight(Settings.Default.AppProperties.InitialVIew.HighlightLink);
+            PDFViewer.SetBackgroundBrush(new System.Windows.Media.SolidColorBrush(Settings.Default.AppProperties.InitialVIew.BackGround));
 
             if (App.mainWindowViewModel != null)
             {
                 App.mainWindowViewModel.CurrentPDFViewer = PDFViewer;
             }
-            App.OpenedFileList.Add(path);
+            if (!App.OpenedFileList.Contains(path))
+            {
+                App.OpenedFileList.Add(path);
+            }
             return true;
         }
 
@@ -429,11 +435,11 @@ namespace PDF_Office.ViewModels
             }
 
             //设置背景色
-            ////PDFViewer.SetBackgroundBrush(new SolidColorBrush((Color)System.Windows.Media.ColorConverter.ConvertFromString(Settings.Default.AppProperties.InitialVIew.Background)));
+            PDFViewer.SetBackgroundBrush(new System.Windows.Media.SolidColorBrush(Settings.Default.AppProperties.InitialVIew.BackGround));
             PDFViewer.Load();
             PDFViewer.UndoManager.CanSave = true;
             FileChanged = Visibility.Visible;
-            PDFViewer.SetFormFieldHighlight(true);
+            PDFViewer.SetFormFieldHighlight(Settings.Default.AppProperties.InitialVIew.HighlightLink);
 
             NavigateToViewContent();
             return true;
@@ -571,11 +577,11 @@ namespace PDF_Office.ViewModels
 
                 PDFViewer.Document.ImportPages(tempdoc, "");
 
-                //PDFViewer.SetBackgroundBrush(new SolidColorBrush((Color)System.Windows.Media.ColorConverter.ConvertFromString(Settings.Default.AppProperties.InitialVIew.Background)));
+                PDFViewer.SetBackgroundBrush(new System.Windows.Media.SolidColorBrush(Settings.Default.AppProperties.InitialVIew.BackGround));
                 PDFViewer.Load();
                 PDFViewer.UndoManager.CanSave = true;
                 FileChanged = Visibility.Visible;
-                PDFViewer.SetFormFieldHighlight(true);
+                PDFViewer.SetFormFieldHighlight(Settings.Default.AppProperties.InitialVIew.HighlightLink);
 
                 await System.Windows.Application.Current.Dispatcher.BeginInvoke(System.Windows.Threading.DispatcherPriority.Send, new Action(() =>
                 {
@@ -644,6 +650,7 @@ namespace PDF_Office.ViewModels
         public async void OnNavigatedTo(NavigationContext navigationContext)
         {
             mainWindowViewModel = App.mainWindowViewModel;
+
             //因为是异步打开多个文件,需要先显示Home界面
             NavigationParameters parameters = new NavigationParameters();
             parameters.Add(ParameterNames.MainViewModel, this);
@@ -682,8 +689,11 @@ namespace PDF_Office.ViewModels
                     return;
                 }
 
-                //更新已打开的文件记录
-                App.OpenedFileList.Add(filepath);
+                if (!App.OpenedFileList.Contains(filepath))
+                {
+                    //更新已打开的文件记录
+                    App.OpenedFileList.Add(filepath);
+                }
             }
         }
 

+ 31 - 1
PDF Office/ViewModels/MainWindowViewModel.cs

@@ -220,7 +220,25 @@ namespace PDF_Office.ViewModels
             {
                 System.Windows.Application.Current.Dispatcher.BeginInvoke(System.Windows.Threading.DispatcherPriority.Send, new Action(() =>
                 {
-                    region.RequestNavigate(RegionNames.MainRegion, "MainContent");
+
+                    if (Settings.Default.AppProperties.NeedToOpenFileList != null && Settings.Default.AppProperties.NeedToOpenFileList.Count > 0)
+                    {
+                        List<string> files = Settings.Default.AppProperties.NeedToOpenFileList;
+
+
+                        foreach (var file in files)
+                        {
+                            this.AddTabItem(file);
+                        }
+
+                        Settings.Default.AppProperties.NeedToOpenFileList.Clear();
+                        Settings.Default.Save();
+                        return;
+                    }
+                    else
+                    {
+                        region.RequestNavigate(RegionNames.MainRegion, "MainContent");
+                    }
 
                     try
                     {
@@ -327,6 +345,13 @@ namespace PDF_Office.ViewModels
         /// </summary>
         public bool closeAllTabItem()
         {
+            //下一次重新打开未关闭的文档
+            if (Settings.Default.AppProperties.Description.OpenUnClosedFileWhenOpen)
+            {
+                Settings.Default.AppProperties.NeedToOpenFileList = App.OpenedFileList;
+                Settings.Default.Save();
+            }
+
             while (region.Regions[RegionNames.MainRegion].Views.Count() > 0)
             {
                 if (CurrentPDFViewer != null && CurrentPDFViewer.UndoManager.CanSave)
@@ -432,6 +457,11 @@ namespace PDF_Office.ViewModels
         /// <returns></returns>
         private ContentResult ShowSaveDialog(ViewContentViewModel viewContentViewModel)
         {
+            if(Settings.Default.AppProperties.Description.NotShowSaveWhenClose)
+            {
+                //偏好设置里选择自动保存时
+                return ContentResult.Ok;
+            }
             AlertsMessage alertsMessage = new AlertsMessage();
             alertsMessage.ShowDialog("关闭提示", "当前文档有为保存的操作,是否需要保存?", "Cancel", "No", "Ok");
             var result = alertsMessage.result;

+ 2 - 0
PDF Office/ViewModels/PropertyPanel/ViewModular/ReadViewContentViewModel.cs

@@ -1,5 +1,6 @@
 using ComPDFKitViewer.PdfViewer;
 using PDF_Office.Model;
+using PDF_Office.Properties;
 using Prism.Commands;
 using Prism.Mvvm;
 using Prism.Regions;
@@ -152,6 +153,7 @@ namespace PDF_Office.ViewModels.PropertyPanel.ViewModular
         public async void OnNavigatedTo(NavigationContext navigationContext)
         {
             var pdfview = navigationContext.Parameters[ParameterNames.PDFViewer] as CPDFViewer;
+            pdfview.SetBackgroundBrush(new System.Windows.Media.SolidColorBrush(Settings.Default.AppProperties.InitialVIew.BackGroundInFulWindow));
             ViewContentViewModel viewContentView = navigationContext.Parameters[ParameterNames.ViewContentViewModel] as ViewContentViewModel;
             if (pdfview != null)
             {

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

@@ -1222,6 +1222,10 @@ namespace PDF_Office.ViewModels
         private void SettingsEvent()
         {
             dialogs.ShowDialog(DialogNames.SettingsDialog, null, null);
+            if(PDFViewer!=null)
+            {
+                PDFViewer.SetBackgroundBrush(new System.Windows.Media.SolidColorBrush(Settings.Default.AppProperties.InitialVIew.BackGround));
+            }
         }
 
         private bool CanSaveExcute()
@@ -1452,6 +1456,8 @@ namespace PDF_Office.ViewModels
                     var contentRegion = region.Regions[ViwerRegionName];
                     contentRegion.Remove(PDFViewer);
                 }
+                //还原背景色
+                PDFViewer.SetBackgroundBrush(new System.Windows.Media.SolidColorBrush(Settings.Default.AppProperties.InitialVIew.BackGround));
                 region.AddToRegion(ViwerRegionName, PDFViewer);
             }
             if (string.IsNullOrEmpty(CurrentBar) || CurrentBar.Equals("TabItemPageEdit", StringComparison.OrdinalIgnoreCase))
@@ -1758,7 +1764,8 @@ namespace PDF_Office.ViewModels
         private void GetOpenFileInfo()
         {
             OpenFileInfo = SettingHelper.GetFileInfo(PDFViewer.Document.FilePath);
-            if (OpenFileInfo != null)
+            //偏好设置里设置了记录上次视图设置时
+            if (OpenFileInfo != null&&Settings.Default.AppProperties.Description.RecoveryViewWhenOpen)
             {
                 if (OpenFileInfo.LastViewMode != PDFViewer.ModeView)
                 {

+ 179 - 164
PDF Office/Views/Dialog/SettingsDialog.xaml

@@ -176,8 +176,11 @@
                                         Foreground="{StaticResource color.sys.text.neutral.lv3}"
                                         Text="10 to 50" />
                                 </StackPanel>
-                                <Rectangle Width="446" Height="1" Fill="{StaticResource color.sys.layout.divider}"></Rectangle>
-                                    <StackPanel Margin="8" Orientation="Horizontal">
+                                <Rectangle
+                                    Width="446"
+                                    Height="1"
+                                    Fill="{StaticResource color.sys.layout.divider}" />
+                                <StackPanel Margin="8" Orientation="Horizontal">
                                     <CheckBox
                                         Name="ChkAutoSave"
                                         Content="APP自动保存文件,频次为每"
@@ -235,25 +238,25 @@
                             </StackPanel>
                         </Border>
                         <Grid Visibility="Collapsed">
-                        <Label Content="打开图片文档" Style="{StaticResource Label}" />
-                        <Border
-                            Margin="0,10,0,18"
-                            Background="{StaticResource color.sys.layout.mg}"
-                            CornerRadius="6">
-                            <StackPanel>
-                                <RadioButton
-                                    Margin="9,12,0,0"
-                                    Content="自动扫描并识别文本"
-                                    IsChecked="{Binding Descript.AutoScanImageFile, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
-                                    Style="{DynamicResource RadioButtonStyle1}" />
-                                <RadioButton
-                                    Grid.Row="1"
-                                    Margin="9,10"
-                                    Content="提示扫描并识别文本"
-                                    IsChecked="{Binding Descript.TipScanImageFile, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
-                                    Style="{DynamicResource RadioButtonStyle1}" />
-                            </StackPanel>
-                        </Border>
+                            <Label Content="打开图片文档" Style="{StaticResource Label}" />
+                            <Border
+                                Margin="0,10,0,18"
+                                Background="{StaticResource color.sys.layout.mg}"
+                                CornerRadius="6">
+                                <StackPanel>
+                                    <RadioButton
+                                        Margin="9,12,0,0"
+                                        Content="自动扫描并识别文本"
+                                        IsChecked="{Binding Descript.AutoScanImageFile, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
+                                        Style="{DynamicResource RadioButtonStyle1}" />
+                                    <RadioButton
+                                        Grid.Row="1"
+                                        Margin="9,10"
+                                        Content="提示扫描并识别文本"
+                                        IsChecked="{Binding Descript.TipScanImageFile, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
+                                        Style="{DynamicResource RadioButtonStyle1}" />
+                                </StackPanel>
+                            </Border>
                         </Grid>
                         <WrapPanel>
                             <Label
@@ -346,11 +349,12 @@
                                     Content="打开APP记住上次选择"
                                     IsChecked="{Binding View.RememberBOTA, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
                                     Style="{DynamicResource RadioButtonStyle1}" />
-                                <CheckBox
+                                <RadioButton
                                     Margin="8,8,0,8"
                                     Content="有大纲时默认显示大纲列表"
                                     Foreground="{StaticResource color.sys.text.neutral.lv1}"
-                                    IsChecked="{Binding View.ShowOutLine}" />
+                                    IsChecked="{Binding View.ShowOutLine, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
+                                    Style="{DynamicResource RadioButtonStyle1}" />
                             </StackPanel>
                         </Border>
 
@@ -380,28 +384,33 @@
                         <WrapPanel Margin="0,8,0,16">
                             <Label Content="正常:" Style="{StaticResource Label2}" />
                             <compositecontrol:ColorContent SelectedColor="{Binding View.BackGround, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" ShowColorList="Collapsed" />
-                            <Label Content="全屏:" Style="{StaticResource Label}" Margin="16,0,0,0"/>
+                            <Label
+                                Margin="16,0,0,0"
+                                Content="全屏:"
+                                Style="{StaticResource Label}" />
                             <compositecontrol:ColorContent SelectedColor="{Binding View.BackGroundInFulWindow, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" ShowColorList="Collapsed" />
                         </WrapPanel>
-                        <CheckBox
+                        <!--<CheckBox
                             Margin="5,0,0,8"
                             Content="高亮表单"
                             Foreground="{StaticResource color.sys.text.neutral.lv1}"
                             IsChecked="{Binding View.HignlightForm, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" />
-                        <!--域高亮色-->
-                        <!--<WrapPanel>
+                        -->
+                        <!--  域高亮色  -->
+                        <!--
+                        <WrapPanel>
                             <Label Content="域高亮色:" Style="{StaticResource Label2}" />
                             <compositecontrol:ColorContent SelectedColor="{Binding View.FormHighLightColor, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" ShowColorList="Collapsed" />
                         </WrapPanel>
                         <WrapPanel>
                             <Label Content="必填栏高亮色:" Style="{StaticResource Label2}" />
                             <compositecontrol:ColorContent SelectedColor="{Binding View.RequiredFieldsColor, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" ShowColorList="Collapsed" />
-                        </WrapPanel>
+                        </WrapPanel>-->
                         <CheckBox
                             Margin="5,0,0,8"
                             Content="高亮链接"
                             Foreground="{StaticResource color.sys.text.neutral.lv1}"
-                            IsChecked="{Binding View.HighlightLink, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" />-->
+                            IsChecked="{Binding View.HighlightLink, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" />
                     </StackPanel>
                 </ScrollViewer>
             </TabItem>
@@ -427,10 +436,10 @@
                             CornerRadius="6">
                             <Grid Margin="8,4,8,4">
                                 <Grid.ColumnDefinitions>
-                                    <ColumnDefinition Width="148"/>
-                                    <ColumnDefinition Width="88"/>
-                                    <ColumnDefinition Width="*"/>
-                                    <ColumnDefinition Width="56"/>
+                                    <ColumnDefinition Width="148" />
+                                    <ColumnDefinition Width="88" />
+                                    <ColumnDefinition Width="*" />
+                                    <ColumnDefinition Width="56" />
                                 </Grid.ColumnDefinitions>
                                 <Grid.RowDefinitions>
                                     <RowDefinition />
@@ -445,8 +454,9 @@
                                 <compositecontrol:ColorContent
                                     Grid.Column="1"
                                     Height="40"
+                                    HorizontalAlignment="Left"
                                     SelectedColor="{Binding Annote.HighLightColor, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
-                                    ShowColorList="Collapsed" HorizontalAlignment="Left"/>
+                                    ShowColorList="Collapsed" />
 
                                 <Label
                                     Grid.Column="2"
@@ -465,8 +475,9 @@
                                     Grid.Row="1"
                                     Grid.Column="1"
                                     Height="40"
+                                    HorizontalAlignment="Left"
                                     SelectedColor="{Binding Annote.StrikethroughColor, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
-                                    ShowColorList="Collapsed"  HorizontalAlignment="Left"/>
+                                    ShowColorList="Collapsed" />
                                 <Label
                                     Grid.Row="1"
                                     Grid.Column="2"
@@ -486,8 +497,9 @@
                                     Grid.Row="2"
                                     Grid.Column="1"
                                     Height="40"
+                                    HorizontalAlignment="Left"
                                     SelectedColor="{Binding Annote.UnderLineColor, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
-                                    ShowColorList="Collapsed"  HorizontalAlignment="Left"/>
+                                    ShowColorList="Collapsed" />
                                 <Label
                                     Grid.Row="2"
                                     Grid.Column="2"
@@ -507,8 +519,9 @@
                                     Grid.Row="3"
                                     Grid.Column="1"
                                     Height="40"
+                                    HorizontalAlignment="Left"
                                     SelectedColor="{Binding Annote.FreeHandColor, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
-                                    ShowColorList="Collapsed"  HorizontalAlignment="Left"/>
+                                    ShowColorList="Collapsed" />
                                 <Label
                                     Grid.Row="3"
                                     Grid.Column="2"
@@ -528,8 +541,9 @@
                                     Grid.Row="4"
                                     Grid.Column="1"
                                     Height="40"
+                                    HorizontalAlignment="Left"
                                     SelectedColor="{Binding Annote.TextAnnoteColor, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
-                                    ShowColorList="Collapsed"  HorizontalAlignment="Left"/>
+                                    ShowColorList="Collapsed" />
                                 <Label
                                     Grid.Row="4"
                                     Grid.Column="2"
@@ -538,7 +552,7 @@
                                 <compositecontrol:ColorContent
                                     Grid.Row="4"
                                     Grid.Column="3"
-                                   Height="40"
+                                    Height="40"
                                     SelectedColor="{Binding Annote.CircleFillColor, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
                                     ShowColorList="Collapsed" />
                                 <Label
@@ -549,8 +563,9 @@
                                     Grid.Row="5"
                                     Grid.Column="1"
                                     Height="40"
+                                    HorizontalAlignment="Left"
                                     SelectedColor="{Binding Annote.NoteAnnoteColor, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
-                                    ShowColorList="Collapsed"  HorizontalAlignment="Left"/>
+                                    ShowColorList="Collapsed" />
                             </Grid>
                         </Border>
 
@@ -559,166 +574,166 @@
                             Margin="0,2,0,0"
                             Background="{StaticResource color.sys.layout.mg}"
                             CornerRadius="6">
-                            <WrapPanel >
+                            <WrapPanel>
                                 <WrapPanel>
                                     <Label Content="文本:" Style="{StaticResource Label2}" />
                                     <ComboBox
-                                    Width="228"
-                                    Height="30"
-                                    ItemsSource="{Binding AnnoteFamilyList}"
-                                    SelectedIndex="{Binding AnnoteSelectedIndex}" />
+                                        Width="228"
+                                        Height="30"
+                                        ItemsSource="{Binding AnnoteFamilyList}"
+                                        SelectedIndex="{Binding AnnoteSelectedIndex}" />
                                     <RadioButton
-                                    Name="RbtLeft"
-                                    Width="32"
-                                    Height="32"
-                                    Margin="8,8,0,8"
-                                    HorizontalAlignment="Center"
-                                    VerticalAlignment="Center"
-                                    IsChecked="{Binding LeftSelected}"
-                                    Style="{StaticResource GreyBgRadioBtnStyle}">
+                                        Name="RbtLeft"
+                                        Width="32"
+                                        Height="32"
+                                        Margin="8,8,0,8"
+                                        HorizontalAlignment="Center"
+                                        VerticalAlignment="Center"
+                                        IsChecked="{Binding LeftSelected}"
+                                        Style="{StaticResource GreyBgRadioBtnStyle}">
                                         <Grid Width="32" Height="32">
                                             <Canvas Margin="5,10,0,0">
                                                 <Rectangle
-                                                Canvas.Top="0.25"
-                                                Width="14"
-                                                Height="1.5"
-                                                Stroke="{Binding ElementName=RbtLeft, Path=Foreground}"
-                                                StrokeThickness="1.5" />
+                                                    Canvas.Top="0.25"
+                                                    Width="14"
+                                                    Height="1.5"
+                                                    Stroke="{Binding ElementName=RbtLeft, Path=Foreground}"
+                                                    StrokeThickness="1.5" />
                                                 <Rectangle
-                                                Canvas.Top="4.25"
-                                                Width="8"
-                                                Height="1.5"
-                                                Stroke="{Binding ElementName=RbtLeft, Path=Foreground}"
-                                                StrokeThickness="1.5" />
+                                                    Canvas.Top="4.25"
+                                                    Width="8"
+                                                    Height="1.5"
+                                                    Stroke="{Binding ElementName=RbtLeft, Path=Foreground}"
+                                                    StrokeThickness="1.5" />
                                                 <Rectangle
-                                                Canvas.Top="12.25"
-                                                Width="8"
-                                                Height="1.5"
-                                                Stroke="{Binding ElementName=RbtLeft, Path=Foreground}"
-                                                StrokeThickness="1.5" />
+                                                    Canvas.Top="12.25"
+                                                    Width="8"
+                                                    Height="1.5"
+                                                    Stroke="{Binding ElementName=RbtLeft, Path=Foreground}"
+                                                    StrokeThickness="1.5" />
                                                 <Rectangle
-                                                Canvas.Top="8.25"
-                                                Width="14"
-                                                Height="1.5"
-                                                Stroke="{Binding ElementName=RbtLeft, Path=Foreground}"
-                                                StrokeThickness="1.5" />
+                                                    Canvas.Top="8.25"
+                                                    Width="14"
+                                                    Height="1.5"
+                                                    Stroke="{Binding ElementName=RbtLeft, Path=Foreground}"
+                                                    StrokeThickness="1.5" />
                                             </Canvas>
                                         </Grid>
                                     </RadioButton>
                                     <RadioButton
-                                    Name="RbtCenter"
-                                    Width="32"
-                                    Height="32"
-                                    Margin="8"
-                                    HorizontalAlignment="Center"
-                                    VerticalAlignment="Center"
-                                    IsChecked="{Binding CenterSelected}"
-                                    Style="{StaticResource GreyBgRadioBtnStyle}">
+                                        Name="RbtCenter"
+                                        Width="32"
+                                        Height="32"
+                                        Margin="8"
+                                        HorizontalAlignment="Center"
+                                        VerticalAlignment="Center"
+                                        IsChecked="{Binding CenterSelected}"
+                                        Style="{StaticResource GreyBgRadioBtnStyle}">
                                         <Grid Width="32" Height="32">
                                             <Canvas Margin="5,10,0,0">
                                                 <Rectangle
-                                                Canvas.Top="0.25"
-                                                Width="14"
-                                                Height="1.5"
-                                                Stroke="{Binding ElementName=RbtCenter, Path=Foreground}"
-                                                StrokeThickness="1.5" />
+                                                    Canvas.Top="0.25"
+                                                    Width="14"
+                                                    Height="1.5"
+                                                    Stroke="{Binding ElementName=RbtCenter, Path=Foreground}"
+                                                    StrokeThickness="1.5" />
                                                 <Rectangle
-                                                Canvas.Left="3"
-                                                Canvas.Top="4.25"
-                                                Width="8"
-                                                Height="1.5"
-                                                Stroke="{Binding ElementName=RbtCenter, Path=Foreground}"
-                                                StrokeThickness="1.5" />
+                                                    Canvas.Left="3"
+                                                    Canvas.Top="4.25"
+                                                    Width="8"
+                                                    Height="1.5"
+                                                    Stroke="{Binding ElementName=RbtCenter, Path=Foreground}"
+                                                    StrokeThickness="1.5" />
                                                 <Rectangle
-                                                Canvas.Left="3"
-                                                Canvas.Top="12.25"
-                                                Width="8"
-                                                Height="1.5"
-                                                Stroke="{Binding ElementName=RbtCenter, Path=Foreground}"
-                                                StrokeThickness="1.5" />
+                                                    Canvas.Left="3"
+                                                    Canvas.Top="12.25"
+                                                    Width="8"
+                                                    Height="1.5"
+                                                    Stroke="{Binding ElementName=RbtCenter, Path=Foreground}"
+                                                    StrokeThickness="1.5" />
                                                 <Rectangle
-                                                Canvas.Top="8.25"
-                                                Width="14"
-                                                Height="1.5"
-                                                Stroke="{Binding ElementName=RbtCenter, Path=Foreground}"
-                                                StrokeThickness="1.5" />
+                                                    Canvas.Top="8.25"
+                                                    Width="14"
+                                                    Height="1.5"
+                                                    Stroke="{Binding ElementName=RbtCenter, Path=Foreground}"
+                                                    StrokeThickness="1.5" />
                                             </Canvas>
                                         </Grid>
                                     </RadioButton>
                                     <RadioButton
-                                    Name="RbtRight"
-                                    Width="32"
-                                    Height="32"
-                                    Margin="0,8,8,8"
-                                    HorizontalAlignment="Center"
-                                    VerticalAlignment="Center"
-                                    IsChecked="{Binding RightSelected}"
-                                    Style="{StaticResource GreyBgRadioBtnStyle}">
+                                        Name="RbtRight"
+                                        Width="32"
+                                        Height="32"
+                                        Margin="0,8,8,8"
+                                        HorizontalAlignment="Center"
+                                        VerticalAlignment="Center"
+                                        IsChecked="{Binding RightSelected}"
+                                        Style="{StaticResource GreyBgRadioBtnStyle}">
                                         <Grid Width="32" Height="32">
                                             <Canvas Margin="5,10,0,0">
                                                 <Rectangle
-                                                Canvas.Top="0.25"
-                                                Width="14"
-                                                Height="1.5"
-                                                Stroke="{Binding ElementName=RbtRight, Path=Foreground}"
-                                                StrokeThickness="1.5" />
+                                                    Canvas.Top="0.25"
+                                                    Width="14"
+                                                    Height="1.5"
+                                                    Stroke="{Binding ElementName=RbtRight, Path=Foreground}"
+                                                    StrokeThickness="1.5" />
                                                 <Rectangle
-                                                Canvas.Left="6"
-                                                Canvas.Top="4.25"
-                                                Width="8"
-                                                Height="1.5"
-                                                Stroke="{Binding ElementName=RbtRight, Path=Foreground}"
-                                                StrokeThickness="1.5" />
+                                                    Canvas.Left="6"
+                                                    Canvas.Top="4.25"
+                                                    Width="8"
+                                                    Height="1.5"
+                                                    Stroke="{Binding ElementName=RbtRight, Path=Foreground}"
+                                                    StrokeThickness="1.5" />
                                                 <Rectangle
-                                                Canvas.Left="6"
-                                                Canvas.Top="12.25"
-                                                Width="8"
-                                                Height="1.5"
-                                                Stroke="{Binding ElementName=RbtRight, Path=Foreground}"
-                                                StrokeThickness="1.5" />
+                                                    Canvas.Left="6"
+                                                    Canvas.Top="12.25"
+                                                    Width="8"
+                                                    Height="1.5"
+                                                    Stroke="{Binding ElementName=RbtRight, Path=Foreground}"
+                                                    StrokeThickness="1.5" />
                                                 <Rectangle
-                                                Canvas.Top="8.25"
-                                                Width="14"
-                                                Height="1.5"
-                                                Stroke="{Binding ElementName=RbtRight, Path=Foreground}"
-                                                StrokeThickness="1.5" />
+                                                    Canvas.Top="8.25"
+                                                    Width="14"
+                                                    Height="1.5"
+                                                    Stroke="{Binding ElementName=RbtRight, Path=Foreground}"
+                                                    StrokeThickness="1.5" />
                                             </Canvas>
                                         </Grid>
                                     </RadioButton>
                                     <RadioButton
-                                    Name="RbtnStrech"
-                                    Width="32"
-                                    Height="32"
-                                    HorizontalAlignment="Center"
-                                    VerticalAlignment="Center"
-                                    IsChecked="{Binding StrechSelected}"
-                                    Style="{StaticResource GreyBgRadioBtnStyle}">
+                                        Name="RbtnStrech"
+                                        Width="32"
+                                        Height="32"
+                                        HorizontalAlignment="Center"
+                                        VerticalAlignment="Center"
+                                        IsChecked="{Binding StrechSelected}"
+                                        Style="{StaticResource GreyBgRadioBtnStyle}">
                                         <Grid Width="32" Height="32">
                                             <Canvas Margin="5,10,0,0">
                                                 <Rectangle
-                                                Canvas.Top="0.25"
-                                                Width="14"
-                                                Height="1.5"
-                                                Stroke="{Binding ElementName=RbtnStrech, Path=Foreground}"
-                                                StrokeThickness="1.5" />
+                                                    Canvas.Top="0.25"
+                                                    Width="14"
+                                                    Height="1.5"
+                                                    Stroke="{Binding ElementName=RbtnStrech, Path=Foreground}"
+                                                    StrokeThickness="1.5" />
                                                 <Rectangle
-                                                Canvas.Top="8.25"
-                                                Width="14"
-                                                Height="1.5"
-                                                Stroke="{Binding ElementName=RbtnStrech, Path=Foreground}"
-                                                StrokeThickness="1.5" />
+                                                    Canvas.Top="8.25"
+                                                    Width="14"
+                                                    Height="1.5"
+                                                    Stroke="{Binding ElementName=RbtnStrech, Path=Foreground}"
+                                                    StrokeThickness="1.5" />
                                                 <Rectangle
-                                                Canvas.Top="4.25"
-                                                Width="14"
-                                                Height="1.5"
-                                                Stroke="{Binding ElementName=RbtnStrech, Path=Foreground}"
-                                                StrokeThickness="1.5" />
+                                                    Canvas.Top="4.25"
+                                                    Width="14"
+                                                    Height="1.5"
+                                                    Stroke="{Binding ElementName=RbtnStrech, Path=Foreground}"
+                                                    StrokeThickness="1.5" />
                                                 <Rectangle
-                                                Canvas.Top="12.25"
-                                                Width="14"
-                                                Height="1.5"
-                                                Stroke="{Binding ElementName=RbtnStrech, Path=Foreground}"
-                                                StrokeThickness="1.5" />
+                                                    Canvas.Top="12.25"
+                                                    Width="14"
+                                                    Height="1.5"
+                                                    Stroke="{Binding ElementName=RbtnStrech, Path=Foreground}"
+                                                    StrokeThickness="1.5" />
                                             </Canvas>
                                         </Grid>
                                     </RadioButton>
@@ -726,10 +741,10 @@
                                 <WrapPanel Margin="0,0,0,8">
                                     <Label Content="便签:" Style="{StaticResource Label2}" />
                                     <ComboBox
-                                    Width="228"
-                                    Height="30"
-                                    ItemsSource="{Binding AnnoteFamilyList}"
-                                    SelectedIndex="{Binding NoteSelectedIndex, Mode=TwoWay}" />
+                                        Width="228"
+                                        Height="30"
+                                        ItemsSource="{Binding AnnoteFamilyList}"
+                                        SelectedIndex="{Binding NoteSelectedIndex, Mode=TwoWay}" />
                                 </WrapPanel>
                             </WrapPanel>
                         </Border>

+ 4 - 1
PDF Office/Views/HomeContent.xaml.cs

@@ -23,10 +23,13 @@ namespace PDF_Office.Views
     {
         public string ImagePath { get; set; }
         public string Content { get; set; }
-        public PromotionBanner(string ImagePath,string Content)
+
+        public string Uri { get; set; }
+        public PromotionBanner(string ImagePath,string Content,string uri)
         {
             this.ImagePath = ImagePath;
             this.Content = Content;
+            this.Uri = uri;
         }
 
     }

+ 36 - 13
PDF Office/Views/HomePanel/PromotionContent.xaml

@@ -38,7 +38,11 @@
     </UserControl.Resources>
     <ScrollViewer VerticalScrollBarVisibility="Auto">
         <Grid>
-            <StackPanel Margin="0,0,0,252">
+            <Grid.RowDefinitions>
+                <RowDefinition Height="*" />
+                <RowDefinition Height="auto" />
+            </Grid.RowDefinitions>
+            <StackPanel>
                 <Expander
                     x:Name="PDFProSeriesExpander"
                     Margin="20,20,0,0"
@@ -60,8 +64,18 @@
                                 HorizontalAlignment="Stretch"
                                 Background="Transparent"
                                 BorderThickness="0"
-                                ItemContainerStyle="{StaticResource EmptyListViewItem}"
-                                ItemTemplate="{StaticResource PromotionDataTemplate}" />
+                                ItemTemplate="{StaticResource PromotionDataTemplate}">
+                                <ListView.ItemContainerStyle>
+                                    <Style BasedOn="{StaticResource EmptyListViewItem}" TargetType="{x:Type ListViewItem}">
+                                        <Style.Triggers>
+                                            <Trigger Property="IsMouseOver" Value="True">
+                                                <Setter Property="Background" Value="{StaticResource color.item-state.hov.bg}" />
+                                            </Trigger>
+                                        </Style.Triggers>
+                                        <EventSetter Event="PreviewMouseLeftButtonDown" Handler="FrameworkElement_PreviewMouseLeftButtonDown" />
+                                    </Style>
+                                </ListView.ItemContainerStyle>
+                            </ListView>
                         </Grid>
                     </Border>
 
@@ -88,23 +102,32 @@
                                 HorizontalAlignment="Stretch"
                                 Background="Transparent"
                                 BorderThickness="0"
-                                ItemContainerStyle="{StaticResource EmptyListViewItem}"
-                                ItemTemplate="{StaticResource PromotionDataTemplate}" />
+                                ItemTemplate="{StaticResource PromotionDataTemplate}">
+                                <ListView.ItemContainerStyle>
+                                    <Style BasedOn="{StaticResource EmptyListViewItem}" TargetType="{x:Type ListViewItem}">
+                                        <Style.Triggers>
+                                            <Trigger Property="IsMouseOver" Value="True">
+                                                <Setter Property="Background" Value="{StaticResource color.item-state.hov.bg}" />
+                                            </Trigger>
+                                        </Style.Triggers>
+                                        <EventSetter Event="PreviewMouseLeftButtonDown" Handler="FrameworkElement_PreviewMouseLeftButtonDown" />
+                                    </Style>
+                                </ListView.ItemContainerStyle>
+                            </ListView>
                         </Grid>
                     </Border>
 
                 </Expander>
 
             </StackPanel>
-            <Rectangle
-                x:Name="promtionRect"
-                Width="216"
-                Height="216"
-                Margin="0,23"
+            <Image
+                x:Name="ImgeActivity"
+                Grid.Row="1"
+                Width="184"
+                Height="243"
+                Margin="0,30"
                 VerticalAlignment="Bottom"
-                Fill="#EBEBEB"
-                RadiusX="8"
-                RadiusY="8" />
+                PreviewMouseLeftButtonDown="ImgeActivity_PreviewMouseLeftButtonDown" />
         </Grid>
     </ScrollViewer>
 </UserControl>

+ 69 - 11
PDF Office/Views/HomePanel/PromotionContent.xaml.cs

@@ -23,32 +23,60 @@ namespace PDF_Office.Views.HomePanel
     {
         private ObservableCollection<PromotionBanner> PDFProPromotion = new ObservableCollection<PromotionBanner>();
         private ObservableCollection<PromotionBanner> OthersPromotion = new ObservableCollection<PromotionBanner>();
+
+        /// <summary>
+        /// 活动链接
+        /// </summary>
+        public string ActiveUri = @"https://apps.apple.com/app/apple-store/id1475051178?pt=118745145&ct=pdfmac-promo&mt=8";
+
+        public string WindowsUri = @"https://www.pdfreaderpro.com/windows";
+
+        public string iPad = @"https://www.pdfreaderpro.com/ios";
+
+        public string Mac = @"https://www.pdfreaderpro.com/mac";
+
+        public string Android = @"https://www.pdfreaderpro.com/android";
+
+        public string ComPDFKit = @"https://www.compdf.com?utm_source=macapp&utm_medium=pdfmac&utm_campaign=compdfkit-promp";
+
+        public string ComVideoKit = @"https://www.filmagepro.com/video-sdk?utm_source=macapp&utm_medium=pdfmac&utm_campaign=comvideosdk-promo";
+
+        public string SignFlow = @"https://apps.apple.com/app/apple-store/id1584624017?pt=118745145&ct=pdfmac-promo&mt=8";
+
+        public string FilmageEditor = @"https://apps.apple.com/app/apple-store/id1475051178?pt=118745145&ct=pdfmac-promo&mt=8";
+
+        public string FilmageScreen = @"https://apps.apple.com/app/apple-store/id1475049179?pt=118745145&ct=pdfmac-promo&mt=8";
+
+        public string FreePDFTemplates = @"https://www.pdfreaderpro.com/templates?utm_source=MacApp&utm_campaign=PDFProMac&utm_medium=pdfmac_promo";
+
         public PromotionContent()
         {
             InitializeComponent();
             InitPromotionBanner();
             LoadPromotionContents();
+
+            ImgeActivity.Source = new BitmapImage(new Uri("pack://application:,,,/Resources/PromotionIcon/black_pdfreaderpro_home_en.png"));
         }
 
         private void InitPromotionBanner()
         {
-            PDFProPromotion.Add(new PromotionBanner("pack://application:,,,/Resources/PromotionIcon/Windows.png", "Windows"));
-            PDFProPromotion.Add(new PromotionBanner("pack://application:,,,/Resources/PromotionIcon/IPhoneiPad.png", "IPhone /iPad"));
-            PDFProPromotion.Add(new PromotionBanner("pack://application:,,,/Resources/PromotionIcon/Android.png", "Android"));
+            PDFProPromotion.Add(new PromotionBanner("pack://application:,,,/Resources/PromotionIcon/Windows.png", "Mac",Mac));
+            PDFProPromotion.Add(new PromotionBanner("pack://application:,,,/Resources/PromotionIcon/IPhoneiPad.png", "IPhone /iPad",iPad));
+            PDFProPromotion.Add(new PromotionBanner("pack://application:,,,/Resources/PromotionIcon/Android.png", "Android",Android));
             PDFProListview.ItemsSource = PDFProPromotion;
 
-            OthersPromotion.Add(new PromotionBanner("pack://application:,,,/Resources/PromotionIcon/ComPDFKit.png", "ComPDFKit"));
-            OthersPromotion.Add(new PromotionBanner("pack://application:,,,/Resources/PromotionIcon/ComVideoKit.png", "ComVideoKit"));
-            OthersPromotion.Add(new PromotionBanner("pack://application:,,,/Resources/PromotionIcon/SignFlow.png", "SignFlow"));
-            OthersPromotion.Add(new PromotionBanner("pack://application:,,,/Resources/PromotionIcon/FilmageEditor.png", "Filmage Editor"));
-            OthersPromotion.Add(new PromotionBanner("pack://application:,,,/Resources/PromotionIcon/FilmageScreen.png", "Filmage Screen"));
-            OthersPromotion.Add(new PromotionBanner("pack://application:,,,/Resources/PromotionIcon/FreePDFTemplates.png", "Free PDF Templates"));
+            OthersPromotion.Add(new PromotionBanner("pack://application:,,,/Resources/PromotionIcon/ComPDFKit.png", "ComPDFKit",ComPDFKit));
+            OthersPromotion.Add(new PromotionBanner("pack://application:,,,/Resources/PromotionIcon/ComVideoKit.png", "ComVideoKit",ComVideoKit));
+            OthersPromotion.Add(new PromotionBanner("pack://application:,,,/Resources/PromotionIcon/SignFlow.png", "SignFlow",SignFlow));
+            OthersPromotion.Add(new PromotionBanner("pack://application:,,,/Resources/PromotionIcon/FilmageEditor.png", "Filmage Editor",FilmageEditor));
+            OthersPromotion.Add(new PromotionBanner("pack://application:,,,/Resources/PromotionIcon/FilmageScreen.png", "Filmage Screen",FilmageEditor));
+            OthersPromotion.Add(new PromotionBanner("pack://application:,,,/Resources/PromotionIcon/FreePDFTemplates.png", "Free PDF Templates",FreePDFTemplates));
             OthersListview.ItemsSource = OthersPromotion;
         }
 
-        private void LoadPromotionContents()
+        private void LoadPromotionContents()                                          
         {
-            if(promtionRect.Visibility == Visibility.Visible)
+            if(ImgeActivity.Visibility == Visibility.Visible)
             {
 
             }
@@ -64,5 +92,35 @@ namespace PDF_Office.Views.HomePanel
         {
 
         }
+
+        private void FrameworkElement_PreviewMouseLeftButtonDown(object sender, MouseButtonEventArgs e)
+        {
+            var item = sender as ListViewItem;
+            if(item!=null)
+            {
+                if(!string.IsNullOrEmpty((item.DataContext as PromotionBanner).Uri))
+                {
+                    GotoURI((item.DataContext as PromotionBanner).Uri);
+                }
+            }
+        }
+
+        private void ImgeActivity_PreviewMouseLeftButtonDown(object sender, MouseButtonEventArgs e)
+        {
+            GotoURI(ActiveUri);
+        }
+
+        /// <summary>
+        /// 跳转到链接
+        /// </summary>
+        /// <param name="uri"></param>
+        private void GotoURI(string uri)
+        {
+            try
+            {
+                System.Diagnostics.Process.Start(uri);
+            }
+            catch { }
+        }
     }
 }

+ 5 - 8
PDFSettings/APPSettingProperties.cs

@@ -40,6 +40,7 @@ namespace PDFSettings
         /// </summary>
         public int RecentFileListMode = 0;
 
+
         /// <summary>
         /// 删除最近文件记录时是否显示询问弹窗
         /// </summary>
@@ -66,7 +67,7 @@ namespace PDFSettings
         /// <summary>
         /// 文档打开时恢复上次视图设置
         /// </summary>
-        public bool RecoveryViewWhenOpen = false;
+        public bool RecoveryViewWhenOpen = true;
 
         /// <summary>
         /// 最近打开中文档最多显示数量
@@ -132,15 +133,11 @@ namespace PDFSettings
         /// </summary>
         public bool RememberBOTA = false;
 
-        /// <summary>
-        /// 记录本次BOTA的展开状态
-        /// </summary>
-        public bool IsBOTAOpen = false;
 
         /// <summary>
         /// 有大纲时默认显示大纲列表
         /// </summary>
-        public bool ShowOutLine = true;
+        public bool ShowOutLine = false;
 
         /// <summary>
         ///属性面板 自动展开
@@ -155,12 +152,12 @@ namespace PDFSettings
         /// <summary>
         /// 阅读页背景色
         /// </summary>
-        public Color BackGround = Colors.White;
+        public Color BackGround = (Color)ColorConverter.ConvertFromString("#CED0D4");
 
         /// <summary>
         /// 全屏背景色
         /// </summary>
-        public Color BackGroundInFulWindow = Colors.White;
+        public Color BackGroundInFulWindow = (Color)ColorConverter.ConvertFromString("#36383B");
 
         /// <summary>
         ///高亮表单

+ 13 - 0
PDFSettings/RecentOpenFiles.cs

@@ -34,5 +34,18 @@ namespace PDFSettings.Settings
         public Color LastFillBrushColor = Brushes.White.Color;
 
         public bool IsGuidPDF { get; set; } = false;
+
+        /// <summary>
+        /// 记录展开的BOTA的选项
+        /// </summary>
+        public string BOTASelectedTab = "";
+
+        //记录展开的BOTA的索引
+        public int BOTASelectedInex = 0;
+
+        /// <summary>
+        /// 记录本次BOTA的展开状态
+        /// </summary>
+        public bool IsBOTAOpen = false;
     }
 }