Просмотр исходного кода

Merge branch 'dev' into practice2

# Conflicts:
#	PDF Office/ViewModels/BottomToolContentViewModel.cs
OYXH\oyxh 2 лет назад
Родитель
Сommit
a2f2aa01a7

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

@@ -107,6 +107,7 @@ namespace PDF_Office
             containerRegistry.RegisterForNavigation<BOTAContent>();
             containerRegistry.RegisterForNavigation<PropertyPanelContent>();
             containerRegistry.RegisterForNavigation<PageEditContent>();
+            containerRegistry.RegisterForNavigation<BottomToolContent>();
             containerRegistry.RegisterForNavigation<ToolsBarContent>();
             containerRegistry.RegisterForNavigation<AnnotToolContent>();
             containerRegistry.RegisterForNavigation<BookmarkContent>();

+ 11 - 0
PDF Office/Model/RegionNames.cs

@@ -83,6 +83,17 @@ namespace PDF_Office.Model
             }
         }
 
+        /// <summary>
+        /// 底部工具栏对应的Content RegionName
+        /// </summary>
+        public static string BottomToolRegionName
+        {
+            get
+            {
+                return GetRegionName("BottomToolRegionName");
+            }
+        }
+
         /// <summary>
         /// 获取MainWindowsViewModel RegionNames字典里的RegionName,
         /// 如果字典里没有键值就新建一个GUID,并插入到

+ 108 - 0
PDF Office/Styles/CheckBoxStyle.xaml

@@ -0,0 +1,108 @@
+<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
+    <Style x:Key="OptionMarkFocusVisual">
+        <Setter Property="Control.Template">
+            <Setter.Value>
+                <ControlTemplate>
+                    <Rectangle
+                        Margin="14,0,0,0"
+                        SnapsToDevicePixels="true"
+                        Stroke="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"
+                        StrokeDashArray="1 2"
+                        StrokeThickness="1" />
+                </ControlTemplate>
+            </Setter.Value>
+        </Setter>
+    </Style>
+    <SolidColorBrush x:Key="OptionMark.Static.Background" Color="#FFFFFFFF" />
+    <SolidColorBrush x:Key="OptionMark.Static.Border" Color="#FF707070" />
+    <SolidColorBrush x:Key="OptionMark.MouseOver.Background" Color="White" />
+    <SolidColorBrush x:Key="OptionMark.MouseOver.Border" Color="Black" />
+    <SolidColorBrush x:Key="OptionMark.MouseOver.Glyph" Color="White" />
+    <SolidColorBrush x:Key="OptionMark.Disabled.Background" Color="#FFE6E6E6" />
+    <SolidColorBrush x:Key="OptionMark.Disabled.Border" Color="#FFBCBCBC" />
+    <SolidColorBrush x:Key="OptionMark.Disabled.Glyph" Color="#FF707070" />
+    <SolidColorBrush x:Key="OptionMark.Pressed.Background" Color="#FFD9ECFF" />
+    <SolidColorBrush x:Key="OptionMark.Pressed.Border" Color="#FF3C77DD" />
+    <SolidColorBrush x:Key="OptionMark.Pressed.Glyph" Color="White" />
+    <SolidColorBrush x:Key="OptionMark.Static.Glyph" Color="White" />
+    <ControlTemplate x:Key="MenuCheckbox" TargetType="{x:Type CheckBox}">
+        <Grid
+            x:Name="templateRoot"
+            Background="Transparent"
+            SnapsToDevicePixels="True">
+            <Grid.ColumnDefinitions>
+                <ColumnDefinition Width="Auto" />
+                <ColumnDefinition Width="*" />
+            </Grid.ColumnDefinitions>
+            <Border
+                x:Name="checkBoxBorder"
+                Width="20"
+                Height="20"
+                HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
+                VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
+                BorderBrush="{TemplateBinding BorderBrush}"
+                BorderThickness="1">
+                <Grid x:Name="markGrid">
+                    <Polygon
+                        x:Name="optionMark"
+                        Width="20"
+                        Height="20"
+                        Margin="1,0,0,0"
+                        VerticalAlignment="Center"
+                        Fill="{StaticResource OptionMark.Static.Glyph}"
+                        Opacity="0"
+                        Points="15.5992424 4.59619408 16.3063492 5.30330086 5.69974747 15.9099026 0.396446609 10.6066017 1.10355339 9.89949494 5.7 14.496" />
+                    <Rectangle
+                        x:Name="indeterminateMark"
+                        Width="20"
+                        Height="20"
+                        Fill="{StaticResource OptionMark.Static.Glyph}"
+                        Opacity="0" />
+                </Grid>
+            </Border>
+            <ContentPresenter
+                x:Name="contentPresenter"
+                Grid.Column="1"
+                Margin="{TemplateBinding Padding}"
+                HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
+                VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
+                Focusable="False"
+                RecognizesAccessKey="True"
+                SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
+        </Grid>
+        <ControlTemplate.Triggers>
+            <Trigger Property="HasContent" Value="true">
+                <Setter Property="FocusVisualStyle" Value="{StaticResource OptionMarkFocusVisual}" />
+                <Setter Property="Padding" Value="4,-1,0,0" />
+            </Trigger>
+            <Trigger Property="IsMouseOver" Value="true">
+                <Setter TargetName="checkBoxBorder" Property="Background" Value="{StaticResource OptionMark.MouseOver.Background}" />
+                <Setter TargetName="checkBoxBorder" Property="BorderBrush" Value="{StaticResource OptionMark.MouseOver.Border}" />
+                <Setter TargetName="checkBoxBorder" Property="BorderThickness" Value="2" />
+                <Setter TargetName="optionMark" Property="Fill" Value="{StaticResource OptionMark.MouseOver.Glyph}" />
+                <Setter TargetName="indeterminateMark" Property="Fill" Value="{StaticResource OptionMark.MouseOver.Glyph}" />
+            </Trigger>
+            <Trigger Property="IsEnabled" Value="false">
+                <Setter TargetName="checkBoxBorder" Property="Background" Value="{StaticResource OptionMark.Disabled.Background}" />
+                <Setter TargetName="checkBoxBorder" Property="BorderBrush" Value="{StaticResource OptionMark.Disabled.Border}" />
+                <Setter TargetName="optionMark" Property="Fill" Value="{StaticResource OptionMark.Disabled.Glyph}" />
+                <Setter TargetName="indeterminateMark" Property="Fill" Value="{StaticResource OptionMark.Disabled.Glyph}" />
+            </Trigger>
+            <Trigger Property="IsPressed" Value="true">
+                <Setter TargetName="checkBoxBorder" Property="Background" Value="{StaticResource OptionMark.Pressed.Background}" />
+                <Setter TargetName="checkBoxBorder" Property="BorderBrush" Value="{StaticResource OptionMark.Pressed.Border}" />
+                <Setter TargetName="optionMark" Property="Fill" Value="{StaticResource OptionMark.Pressed.Glyph}" />
+                <Setter TargetName="indeterminateMark" Property="Fill" Value="{StaticResource OptionMark.Pressed.Glyph}" />
+            </Trigger>
+            <Trigger Property="IsChecked" Value="true">
+                <Setter TargetName="optionMark" Property="Opacity" Value="1" />
+                <Setter TargetName="indeterminateMark" Property="Opacity" Value="0" />
+                <Setter TargetName="checkBoxBorder" Property="Background" Value="#FF0078D7" />
+            </Trigger>
+            <Trigger Property="IsChecked" Value="{x:Null}">
+                <Setter TargetName="optionMark" Property="Opacity" Value="0" />
+                <Setter TargetName="indeterminateMark" Property="Opacity" Value="1" />
+            </Trigger>
+        </ControlTemplate.Triggers>
+    </ControlTemplate>
+</ResourceDictionary>

+ 118 - 0
PDF Office/Styles/RadioButtonStyle.xaml

@@ -0,0 +1,118 @@
+<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
+    <Style x:Key="OptionMarkFocusVisual">
+        <Setter Property="Control.Template">
+            <Setter.Value>
+                <ControlTemplate>
+                    <Rectangle
+                        Margin="14,0,0,0"
+                        SnapsToDevicePixels="true"
+                        Stroke="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"
+                        StrokeDashArray="1 2"
+                        StrokeThickness="1" />
+                </ControlTemplate>
+            </Setter.Value>
+        </Setter>
+    </Style>
+    <Style x:Key="FocusVisual">
+        <Setter Property="Control.Template">
+            <Setter.Value>
+                <ControlTemplate>
+                    <Rectangle
+                        Margin="2"
+                        SnapsToDevicePixels="true"
+                        Stroke="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"
+                        StrokeDashArray="1 2"
+                        StrokeThickness="1" />
+                </ControlTemplate>
+            </Setter.Value>
+        </Setter>
+    </Style>
+
+    <SolidColorBrush x:Key="RadioButton.Static.Background" Color="#FFFFFFFF" />
+    <SolidColorBrush x:Key="RadioButton.Static.Border" Color="#FF707070" />
+
+    <SolidColorBrush x:Key="RadioButton.MouseOver.Background" Color="#1A000000" />
+    <SolidColorBrush x:Key="RadioButton.MouseOver.Border" Color="#FF5593FF" />
+    <SolidColorBrush x:Key="RadioButton.MouseOver.Glyph" Color="#FFF3F9FF" />
+    <SolidColorBrush x:Key="RadioButton.Disabled.Background" Color="#00000000" />
+    <SolidColorBrush x:Key="RadioButton.Disabled.Border" Color="#FFBCBCBC" />
+    <SolidColorBrush x:Key="RadioButton.Disabled.Glyph" Color="#FF707070" />
+    <SolidColorBrush x:Key="RadioButton.Pressed.Background" Color="#26000000" />
+    <SolidColorBrush x:Key="RadioButton.Pressed.Border" Color="#FF3C77DD" />
+    <SolidColorBrush x:Key="RadioButton.Pressed.Glyph" Color="#1A477EDE" />
+    <SolidColorBrush x:Key="RadioButton.Static.Glyph" Color="#FF212121" />
+    <!--  填充颜色  -->
+    <SolidColorBrush x:Key="Separator.fill" Color="#1A000000" />
+    <SolidColorBrush x:Key="MenuIco.fill" Color="#000000" />
+    <Style x:Key="PageViewRadioBtn" TargetType="{x:Type RadioButton}">
+        <Setter Property="FocusVisualStyle" Value="{StaticResource FocusVisual}" />
+        <Setter Property="Background" Value="{StaticResource RadioButton.Static.Background}" />
+        <Setter Property="BorderBrush" Value="{StaticResource RadioButton.Static.Border}" />
+        <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}" />
+        <Setter Property="BorderThickness" Value="0" />
+        <Setter Property="Width" Value="72" />
+        <Setter Property="Height" Value="80" />
+        <Setter Property="HorizontalContentAlignment" Value="Center" />
+        <Setter Property="VerticalContentAlignment" Value="Center" />
+        <Setter Property="Template">
+            <Setter.Value>
+                <ControlTemplate TargetType="{x:Type RadioButton}">
+                    <Grid
+                        x:Name="templateRoot"
+                        Background="Transparent"
+                        SnapsToDevicePixels="True">
+                        <Border
+                            x:Name="radioButtonBorder"
+                            HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
+                            VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
+                            Background="{TemplateBinding Background}"
+                            BorderBrush="{TemplateBinding BorderBrush}"
+                            BorderThickness="{TemplateBinding BorderThickness}">
+                            <Rectangle
+                                x:Name="optionMark"
+                                Width="{TemplateBinding Width}"
+                                Height="{TemplateBinding Height}"
+                                Opacity="0" />
+                        </Border>
+                        <ContentPresenter
+                            x:Name="contentPresenter"
+                            Margin="{TemplateBinding Padding}"
+                            HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
+                            VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
+                            Focusable="False"
+                            RecognizesAccessKey="True"
+                            SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
+                    </Grid>
+                    <ControlTemplate.Triggers>
+                        <Trigger Property="HasContent" Value="true">
+                            <Setter Property="FocusVisualStyle" Value="{StaticResource OptionMarkFocusVisual}" />
+                            <Setter Property="Padding" Value="4,-1,0,0" />
+                        </Trigger>
+                        <Trigger Property="IsMouseOver" Value="true">
+                            <Setter TargetName="radioButtonBorder" Property="Background" Value="{StaticResource RadioButton.MouseOver.Background}" />
+                            <Setter TargetName="radioButtonBorder" Property="BorderBrush" Value="{StaticResource RadioButton.MouseOver.Border}" />
+                            <Setter TargetName="optionMark" Property="Fill" Value="{StaticResource RadioButton.MouseOver.Glyph}" />
+                        </Trigger>
+                        <Trigger Property="IsEnabled" Value="false">
+                            <Setter TargetName="radioButtonBorder" Property="Background" Value="{StaticResource RadioButton.Disabled.Background}" />
+                            <Setter TargetName="radioButtonBorder" Property="BorderBrush" Value="{StaticResource RadioButton.Disabled.Border}" />
+                            <Setter TargetName="optionMark" Property="Fill" Value="{StaticResource RadioButton.Disabled.Glyph}" />
+                        </Trigger>
+                        <Trigger Property="IsPressed" Value="true">
+                            <Setter TargetName="radioButtonBorder" Property="Background" Value="{StaticResource RadioButton.Pressed.Background}" />
+                            <Setter TargetName="radioButtonBorder" Property="BorderBrush" Value="{StaticResource RadioButton.Pressed.Border}" />
+                            <Setter TargetName="optionMark" Property="Fill" Value="{StaticResource RadioButton.Pressed.Glyph}" />
+                        </Trigger>
+                        <Trigger Property="IsChecked" Value="true">
+                            <Setter TargetName="optionMark" Property="Opacity" Value="1" />
+                            <Setter TargetName="optionMark" Property="Fill" Value="{StaticResource RadioButton.Pressed.Glyph}" />
+                        </Trigger>
+                        <Trigger Property="IsChecked" Value="{x:Null}">
+                            <Setter TargetName="optionMark" Property="Opacity" Value="0.56" />
+                        </Trigger>
+                    </ControlTemplate.Triggers>
+                </ControlTemplate>
+            </Setter.Value>
+        </Setter>
+    </Style>
+</ResourceDictionary>

+ 67 - 61
PDF Office/ViewModels/BottomToolContentViewModel.cs

@@ -15,13 +15,12 @@ using System.Windows.Controls;
 using Prism.Services.Dialogs;
 using PDF_Office.CustomControl;
 using PDF_Office.Model;
-using System.Drawing;
-using PDF_Office.Views.PropertyPanel;
 
 namespace PDF_Office.ViewModels
 {
-    public class BottomToolContentViewModel : BindableBase
+    public class BottomToolContentViewModel : BindableBase, INavigationAware
     {
+
         public DelegateCommand Load { get; set; }
 
         public DelegateCommand FirstPageCommand { get; set; }
@@ -54,8 +53,6 @@ namespace PDF_Office.ViewModels
 
         public DelegateCommand<object> SelectionChangedCommand { get; set; }
 
-        public DelegateCommand<object> ShowViewModularCommand { get; set; }
-
         private bool isSingleView;
 
         public bool IsSingleView
@@ -154,39 +151,33 @@ namespace PDF_Office.ViewModels
             }
         }
 
+
+
         public CPDFViewer PDFViewer { get; set; }
 
-        private ViewContentViewModel viewContentViewModel;
+        private ViewContentViewModel viewContentViewModel { get; set; }
+
+
         private IRegionManager region;
 
         private IDialogService dialogs;
 
-        public BottomToolContentViewModel(IRegionManager regionManager, IDialogService dialogService)
+        public BottomToolContentViewModel(IRegionManager regionManager,IDialogService dialogService)
         {
             region = regionManager;
             dialogs = dialogService;
 
-            Load = new DelegateCommand(LoadControl);
-
             PrePageCommand = new DelegateCommand(GoPrePage, CanPrePageExcute).ObservesProperty(() => CurrentPage);
             NextPageCommand = new DelegateCommand(GoNextPage, CanNextPageExcute).ObservesProperty(() => CurrentPage);
             FirstPageCommand = new DelegateCommand(GoFirstPage, CanPrePageExcute).ObservesProperty(() => CurrentPage);
             LastPageCommand = new DelegateCommand(GoLastPage, CanNextPageExcute).ObservesProperty(() => CurrentPage);
-            ZoomInCommand = new DelegateCommand(ZoomIn, CanZoomIn).ObservesProperty(() => CurrentZoom);
-            ZoomOutCommand = new DelegateCommand(ZoomOut, CanZoomOut).ObservesProperty(() => CurrentZoom);
+            ZoomInCommand = new DelegateCommand(ZoomIn, CanZoomIn).ObservesProperty(()=>CurrentZoom);
+            ZoomOutCommand = new DelegateCommand(ZoomOut, CanZoomOut).ObservesProperty(()=>CurrentZoom);
             SetViewModeCommand = new DelegateCommand(SetModeView);
             PageTextKeyDownCommand = new DelegateCommand<object>(PageNumText_KeyDown);
             PageTextPreviewKeyDownCommand = new DelegateCommand<object>(PageNumText_PreviewKeyDown);
             SelectionChangedCommand = new DelegateCommand<object>(SelectionChangedEvent);
             OpenFullCommand = new DelegateCommand(OpenFullWindow);
-            ShowViewModularCommand = new DelegateCommand<object>(ShowViewModularEvent);
-        }
-
-        private void ShowViewModularEvent(object obj)
-        {
-            NavigationParameters param = new NavigationParameters();
-            param.Add(ParameterNames.PDFViewer, PDFViewer);
-            region.RequestNavigate(RegionNames.PropertyRegionName, "ViewModularContent", param);
         }
 
         /// <summary>
@@ -196,15 +187,14 @@ namespace PDF_Office.ViewModels
         {
             DialogParameters parameters = new DialogParameters();
             //因为全屏模式可能需要设置特定的页面模式,所以只传文件路径,新建一个PDFview对象
-            parameters.Add(ParameterNames.FilePath, PDFViewer.Document.FilePath);
-            parameters.Add(ParameterNames.PassWord, PDFViewer.Tag == null ? "" : PDFViewer.Tag.ToString());
-            dialogs.ShowDialog(DialogNames.FullScreenDialog, parameters, e =>
-            {
-                if (e.Result == ButtonResult.Cancel)
+            parameters.Add(ParameterNames.FilePath,PDFViewer.Document.FilePath);
+            parameters.Add(ParameterNames.PassWord,PDFViewer.Tag==null?"":PDFViewer.Tag.ToString());
+            dialogs.ShowDialog(DialogNames.FullScreenDialog,parameters,e=> { 
+                if(e.Result==ButtonResult.Cancel)
                 {
                     //TODO:弹窗提示打开全屏模式失败
                     AlertsMessage alertsMessage = new AlertsMessage();
-                    alertsMessage.ShowDialog("", "Error", "OK");
+                    alertsMessage.ShowDialog("","Error","OK");
                     return;
                 }
             });
@@ -213,24 +203,21 @@ namespace PDF_Office.ViewModels
         private void SelectionChangedEvent(object e)
         {
             var args = e as SelectionChangedEventArgs;
-            if (args != null)
+            if(args!=null)
             {
-                if (SelectedIndex <= 2)
+                if(SelectedIndex<=2)
                 {
                     switch (SelectedIndex)
                     {
                         case 0:
                             PDFViewer.ChangeFitMode(FitMode.FitSize);
                             break;
-
                         case 1:
                             PDFViewer.ChangeFitMode(FitMode.FitWidth);
                             break;
-
                         case 2:
                             PDFViewer.ChangeFitMode(FitMode.FitHeight);
                             break;
-
                         default:
                             break;
                     }
@@ -245,13 +232,14 @@ namespace PDF_Office.ViewModels
                         }
                     }
                 }
+    
             }
         }
 
         private void PageNumText_PreviewKeyDown(object e)
         {
             var args = e as KeyEventArgs;
-            if (args != null)
+            if(args != null)
             {
                 //显示文本框输入内容
                 List<Key> NumberKeys = new List<Key>() { Key.D0,Key.D1,Key.D2,Key.D3,Key.D4,Key.D5,Key.D6,Key.D7,Key.D8,Key.D9,Key.NumPad0,Key.NumPad1,Key.NumPad2,
@@ -314,12 +302,13 @@ namespace PDF_Office.ViewModels
             return false;
         }
 
+
         private void GoNextPage()
         {
             if (PDFViewer != null)
             {
                 PDFViewer.GoToPage(PDFViewer.CurrentIndex + 1);
-                if (((int)PDFViewer.Mode % 2) == 0)
+                if(((int)PDFViewer.Mode%2)==0)
                 {
                     PDFViewer.GoToPage(PDFViewer.CurrentIndex + 2);
                 }
@@ -356,7 +345,7 @@ namespace PDF_Office.ViewModels
 
         private void ZoomIn()
         {
-            var zoom = PDFViewer.ZoomFactor * 100;
+            var zoom = PDFViewer.ZoomFactor*100;
             if (zoom >= 1 && zoom <= 100)
             {
                 PDFViewer.Zoom((zoom + 5) / 100.0);
@@ -373,10 +362,10 @@ namespace PDF_Office.ViewModels
 
         private void ZoomOut()
         {
-            var zoom = PDFViewer.ZoomFactor * 100;
+            var zoom = PDFViewer.ZoomFactor*100;
             if (zoom >= 1 && zoom <= 100)
             {
-                PDFViewer.Zoom((zoom - 5) / 100.0);
+                PDFViewer.Zoom((zoom - 5)/100.0);
             }
             else if (zoom <= 500)
             {
@@ -392,7 +381,7 @@ namespace PDF_Office.ViewModels
         {
             if (PDFViewer != null)
             {
-                if (PDFViewer.ZoomFactor * 100 >= 1000)
+                if (PDFViewer.ZoomFactor*100 >=1000)
                     return false;
                 else
                     return true;
@@ -404,7 +393,7 @@ namespace PDF_Office.ViewModels
         {
             if (PDFViewer != null)
             {
-                if (PDFViewer.ZoomFactor * 100 <= 1)
+                if (PDFViewer.ZoomFactor*100 <=1)
                     return false;
                 else
                     return true;
@@ -412,23 +401,6 @@ namespace PDF_Office.ViewModels
             return false;
         }
 
-        private void LoadControl()
-        {
-            if (App.mainWindowViewModel.CurrentPDFViewer != null)
-            {
-                PDFViewer = App.mainWindowViewModel.CurrentPDFViewer;
-                if (PDFViewer != null)
-                {
-                    //获取页面设置等信息
-                    PageCount = PDFViewer.Document.PageCount;
-                    GetModeView(PDFViewer.ModeView);
-                    CurrentPage = PDFViewer.CurrentIndex + 1;
-                    CurrentZoom = PDFViewer.ZoomFactor * 100;
-                    PDFViewer.InfoChanged += PDFViewer_InfoChanged;
-                }
-            }
-        }
-
         private void PDFViewer_InfoChanged(object sender, KeyValuePair<string, object> e)
         {
             if (e.Key == "PageNum")
@@ -440,9 +412,9 @@ namespace PDF_Office.ViewModels
             {
                 GetModeView((ViewMode)e.Value);
             }
-            if (e.Key == "Zoom")
+            if(e.Key=="Zoom")
             {
-                CurrentZoom = (double)e.Value * 100;
+                CurrentZoom = (double)e.Value*100;
                 SelectedIndex = -1;
             }
         }
@@ -451,10 +423,11 @@ namespace PDF_Office.ViewModels
         {
             if ((int)mode % 2 == 0)
             {
-                if (!IsContinue)
+                if(!IsContinue)
                 {
                     IsContinue = true;
                 }
+               
             }
             else
             {
@@ -466,21 +439,21 @@ namespace PDF_Office.ViewModels
 
             if ((int)mode <= 2)
             {
-                if (!isSingleView)
+                if(!isSingleView)
                 {
                     IsSingleView = true;
                 }
             }
             else if ((int)mode <= 4)
             {
-                if (!isDoubleView)
+                if(!isDoubleView)
                 {
                     IsDoubleView = true;
                 }
             }
             else
             {
-                if (!isBookMode)
+                if(!isBookMode)
                 {
                     IsBookMode = true;
                 }
@@ -523,5 +496,38 @@ namespace PDF_Office.ViewModels
                 }
             }
         }
+
+        #region Navigation
+        public void OnNavigatedTo(NavigationContext navigationContext)
+        {
+            var viewContentViewModel = navigationContext.Parameters[ParameterNames.ViewContentViewModel] as ViewContentViewModel;
+            if (viewContentViewModel != null)
+            {
+                this.viewContentViewModel = viewContentViewModel;
+            }
+
+            var pdfview = navigationContext.Parameters[ParameterNames.PDFViewer] as CPDFViewer;
+            if(pdfview!=null)
+            {
+                //获取页面设置等信息
+                PDFViewer = pdfview;
+                PageCount = PDFViewer.Document.PageCount;
+                GetModeView(PDFViewer.ModeView);
+                CurrentPage = PDFViewer.CurrentIndex + 1;
+                CurrentZoom = PDFViewer.ZoomFactor * 100;
+                PDFViewer.InfoChanged += PDFViewer_InfoChanged;
+            }
+        }
+
+        public bool IsNavigationTarget(NavigationContext navigationContext)
+        {
+            return true;
+        }
+
+        public void OnNavigatedFrom(NavigationContext navigationContext)
+        {
+
+        }
+        #endregion
     }
-}
+}

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

@@ -44,6 +44,11 @@ namespace PDF_Office.ViewModels
 
         public string ToolsBarContentRegionName { get; set; }
 
+        /// <summary>
+        /// 底部工具栏 RegionName
+        /// </summary>
+        public string BottomToolRegionName { get; set; }
+
         /// <summary>
         /// 是否处于页面编辑模式,用于执行undo redo 的具体操作
         /// </summary>
@@ -256,6 +261,7 @@ namespace PDF_Office.ViewModels
             ViwerRegionName = RegionNames.ViwerRegionName;
             BOTARegionName = RegionNames.BOTARegionName;
             PropertyRegionName = RegionNames.PropertyRegionName;
+            BottomToolRegionName = RegionNames.BottomToolRegionName;
 
             //未显示时无法注册上Region名称
             ToolContentVisible = Visibility.Visible;
@@ -445,7 +451,7 @@ namespace PDF_Office.ViewModels
                 parameters.Add(ParameterNames.PDFViewer, PDFViewer);
                 parameters.Add(ParameterNames.ViewContentViewModel, this);
                 region.RequestNavigate(BOTARegionName, "BOTAContent",parameters);
-
+                region.RequestNavigate(BottomToolRegionName, "BottomToolContent", parameters);
 
                 //TODO 根据上一次关闭记录的菜单,选中TabItem
                 EnterSelectedBar("TabItemAnnotation");

+ 0 - 5
PDF Office/Views/BottomToolContent.xaml

@@ -51,11 +51,6 @@
             </Setter>
         </Style>
     </UserControl.Resources>
-    <i:Interaction.Triggers>
-        <i:EventTrigger EventName="Loaded">
-            <prism:InvokeCommandAction Command="{Binding Load}" />
-        </i:EventTrigger>
-    </i:Interaction.Triggers>
     <Grid Height="32">
         <Grid.ColumnDefinitions>
             <ColumnDefinition Width="*" />

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

@@ -205,7 +205,7 @@
 
         </Grid>
 
-        <local:BottomToolContent Grid.Row="3" />
+        <ContentControl Grid.Row="3" prism:RegionManager.RegionName="{Binding BottomToolRegionName}" />
 
         <!--  用于显示页面编辑、水印、背景、标记密文等功能的区域  -->
         <ContentControl