Parcourir la source

综合- 实现底部工具栏部分逻辑、新增解密、全屏窗体

ZhouJieSheng il y a 2 ans
Parent
commit
00dd2914b8

+ 14 - 8
PDF Office/App.xaml

@@ -1,10 +1,16 @@
-<prism:PrismApplication x:Class="PDF_Office.App"
-             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
-             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
-             xmlns:local="clr-namespace:PDF_Office"
-             xmlns:prism="http://prismlibrary.com/"
-             >
+<prism:PrismApplication
+    x:Class="PDF_Office.App"
+    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+    xmlns:local="clr-namespace:PDF_Office"
+    xmlns:prism="http://prismlibrary.com/">
     <Application.Resources>
-         
+        <ResourceDictionary>
+            <ResourceDictionary.MergedDictionaries>
+                <ResourceDictionary Source="pack://application:,,,/PDF Office;component/Styles/TabControlStyle.xaml" />
+            </ResourceDictionary.MergedDictionaries>
+
+
+        </ResourceDictionary>
     </Application.Resources>
-</prism:PrismApplication >
+</prism:PrismApplication>

+ 3 - 3
PDF Office/App.xaml.cs

@@ -89,7 +89,7 @@ namespace PDF_Office
                 if (!result)
                     return false;
             }
-            catch (Exception ex) { }
+            catch{ }
             string devKey = "";
             string devSecret = "";
 #if DEBUG
@@ -106,7 +106,7 @@ namespace PDF_Office
                 if (verifyResult != CPDFSDKVerifier.LicenseErrorCode.LICENSE_ERR_SUCCESS)
                     return false;
             }
-            catch (Exception ex) { }
+            catch{ }
 
 
 
@@ -133,7 +133,7 @@ namespace PDF_Office
                 }
                 CPDFConverter.Init(resPath);
             }
-            catch (Exception ex) { }
+            catch{ }
             return result;
         }
 

+ 231 - 0
PDF Office/CustomControl/LoadingControl.xaml

@@ -0,0 +1,231 @@
+<UserControl
+    x:Class="PDF_Office.CustomControl.LoadingControl"
+    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
+    xmlns:local="clr-namespace:PDF_Office.CustomControl"
+    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
+    d:DesignHeight="450"
+    d:DesignWidth="800"
+    mc:Ignorable="d">
+    <Grid>
+        <Grid.Background>
+            <SolidColorBrush Opacity="0.05" Color="Gray" />
+        </Grid.Background>
+        <Grid
+            HorizontalAlignment="Center"
+            VerticalAlignment="Center"
+            Background="Transparent">
+            <Grid
+                Width="100"
+                Height="100"
+                Background="Transparent">
+                <Grid.Resources>
+                    <DrawingBrush
+                        x:Key="brush"
+                        AlignmentX="Center"
+                        AlignmentY="Top"
+                        Stretch="None">
+                        <DrawingBrush.Drawing>
+                            <GeometryDrawing Brush="Gray">
+                                <GeometryDrawing.Geometry>
+                                    <EllipseGeometry RadiusX="5" RadiusY="5" />
+                                </GeometryDrawing.Geometry>
+                            </GeometryDrawing>
+                        </DrawingBrush.Drawing>
+                    </DrawingBrush>
+                </Grid.Resources>
+
+                <Rectangle
+                    x:Name="r01"
+                    Fill="{StaticResource brush}"
+                    Opacity="1"
+                    RenderTransformOrigin="0.5,0.5">
+                    <Rectangle.RenderTransform>
+                        <RotateTransform Angle="0" />
+                    </Rectangle.RenderTransform>
+                </Rectangle>
+                <Rectangle
+                    x:Name="r02"
+                    Fill="{StaticResource brush}"
+                    RenderTransformOrigin="0.5,0.5">
+                    <Rectangle.RenderTransform>
+                        <RotateTransform Angle="30" />
+                    </Rectangle.RenderTransform>
+                </Rectangle>
+                <Rectangle
+                    x:Name="r03"
+                    Fill="{StaticResource brush}"
+                    RenderTransformOrigin="0.5,0.5">
+                    <Rectangle.RenderTransform>
+                        <RotateTransform Angle="60" />
+                    </Rectangle.RenderTransform>
+                </Rectangle>
+                <Rectangle
+                    x:Name="r04"
+                    Fill="{StaticResource brush}"
+                    RenderTransformOrigin="0.5,0.5">
+                    <Rectangle.RenderTransform>
+                        <RotateTransform Angle="90" />
+                    </Rectangle.RenderTransform>
+                </Rectangle>
+                <Rectangle
+                    x:Name="r05"
+                    Fill="{StaticResource brush}"
+                    RenderTransformOrigin="0.5,0.5">
+                    <Rectangle.RenderTransform>
+                        <RotateTransform Angle="120" />
+                    </Rectangle.RenderTransform>
+                </Rectangle>
+                <Rectangle
+                    x:Name="r06"
+                    Fill="{StaticResource brush}"
+                    RenderTransformOrigin="0.5,0.5">
+                    <Rectangle.RenderTransform>
+                        <RotateTransform Angle="150" />
+                    </Rectangle.RenderTransform>
+                </Rectangle>
+                <Rectangle
+                    x:Name="r07"
+                    Fill="{StaticResource brush}"
+                    RenderTransformOrigin="0.5,0.5">
+                    <Rectangle.RenderTransform>
+                        <RotateTransform Angle="180" />
+                    </Rectangle.RenderTransform>
+                </Rectangle>
+                <Rectangle
+                    x:Name="r08"
+                    Fill="{StaticResource brush}"
+                    RenderTransformOrigin="0.5,0.5">
+                    <Rectangle.RenderTransform>
+                        <RotateTransform Angle="210" />
+                    </Rectangle.RenderTransform>
+                </Rectangle>
+                <Rectangle
+                    x:Name="r09"
+                    Fill="{StaticResource brush}"
+                    RenderTransformOrigin="0.5,0.5">
+                    <Rectangle.RenderTransform>
+                        <RotateTransform Angle="240" />
+                    </Rectangle.RenderTransform>
+                </Rectangle>
+                <Rectangle
+                    x:Name="r10"
+                    Fill="{StaticResource brush}"
+                    RenderTransformOrigin="0.5,0.5">
+                    <Rectangle.RenderTransform>
+                        <RotateTransform Angle="270" />
+                    </Rectangle.RenderTransform>
+                </Rectangle>
+                <Rectangle
+                    x:Name="r11"
+                    Fill="{StaticResource brush}"
+                    RenderTransformOrigin="0.5,0.5">
+                    <Rectangle.RenderTransform>
+                        <RotateTransform Angle="300" />
+                    </Rectangle.RenderTransform>
+                </Rectangle>
+                <Rectangle
+                    x:Name="r12"
+                    Fill="{StaticResource brush}"
+                    RenderTransformOrigin="0.5,0.5">
+                    <Rectangle.RenderTransform>
+                        <RotateTransform Angle="330" />
+                    </Rectangle.RenderTransform>
+                </Rectangle>
+                <Grid.Triggers>
+                    <EventTrigger RoutedEvent="Grid.Loaded">
+                        <BeginStoryboard>
+                            <Storyboard RepeatBehavior="Forever">
+                                <DoubleAnimation
+                                    AutoReverse="True"
+                                    BeginTime="0:0:0.00000"
+                                    Storyboard.TargetName="r01"
+                                    Storyboard.TargetProperty="Opacity"
+                                    To="0"
+                                    Duration="0:0:0.08333" />
+                                <DoubleAnimation
+                                    AutoReverse="True"
+                                    BeginTime="0:0:0.08333"
+                                    Storyboard.TargetName="r02"
+                                    Storyboard.TargetProperty="Opacity"
+                                    To="0"
+                                    Duration="0:0:0.08333" />
+                                <DoubleAnimation
+                                    AutoReverse="True"
+                                    BeginTime="0:0:0.16666"
+                                    Storyboard.TargetName="r03"
+                                    Storyboard.TargetProperty="Opacity"
+                                    To="0"
+                                    Duration="0:0:0.08333" />
+                                <DoubleAnimation
+                                    AutoReverse="True"
+                                    BeginTime="0:0:0.24999"
+                                    Storyboard.TargetName="r04"
+                                    Storyboard.TargetProperty="Opacity"
+                                    To="0"
+                                    Duration="0:0:0.08333" />
+                                <DoubleAnimation
+                                    AutoReverse="True"
+                                    BeginTime="0:0:0.33332"
+                                    Storyboard.TargetName="r05"
+                                    Storyboard.TargetProperty="Opacity"
+                                    To="0"
+                                    Duration="0:0:0.08333" />
+                                <DoubleAnimation
+                                    AutoReverse="True"
+                                    BeginTime="0:0:0.41665"
+                                    Storyboard.TargetName="r06"
+                                    Storyboard.TargetProperty="Opacity"
+                                    To="0"
+                                    Duration="0:0:0.08333" />
+                                <DoubleAnimation
+                                    AutoReverse="True"
+                                    BeginTime="0:0:0.49998"
+                                    Storyboard.TargetName="r07"
+                                    Storyboard.TargetProperty="Opacity"
+                                    To="0"
+                                    Duration="0:0:0.08333" />
+                                <DoubleAnimation
+                                    AutoReverse="True"
+                                    BeginTime="0:0:0.58331"
+                                    Storyboard.TargetName="r08"
+                                    Storyboard.TargetProperty="Opacity"
+                                    To="0"
+                                    Duration="0:0:0.08333" />
+                                <DoubleAnimation
+                                    AutoReverse="True"
+                                    BeginTime="0:0:0.66664"
+                                    Storyboard.TargetName="r09"
+                                    Storyboard.TargetProperty="Opacity"
+                                    To="0"
+                                    Duration="0:0:0.08333" />
+                                <DoubleAnimation
+                                    AutoReverse="True"
+                                    BeginTime="0:0:0.74997"
+                                    Storyboard.TargetName="r10"
+                                    Storyboard.TargetProperty="Opacity"
+                                    To="0"
+                                    Duration="0:0:0.08333" />
+                                <DoubleAnimation
+                                    AutoReverse="True"
+                                    BeginTime="0:0:0.83330"
+                                    Storyboard.TargetName="r11"
+                                    Storyboard.TargetProperty="Opacity"
+                                    To="0"
+                                    Duration="0:0:0.08333" />
+                                <DoubleAnimation
+                                    AutoReverse="True"
+                                    BeginTime="0:0:0.91663"
+                                    Storyboard.TargetName="r12"
+                                    Storyboard.TargetProperty="Opacity"
+                                    To="0"
+                                    Duration="0:0:0.08333" />
+                            </Storyboard>
+                        </BeginStoryboard>
+                    </EventTrigger>
+                </Grid.Triggers>
+            </Grid>
+        </Grid>
+    </Grid>
+</UserControl>

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

+ 54 - 0
PDF Office/DataConvert/BoolToVisible.cs

@@ -0,0 +1,54 @@
+using System;
+using System.Collections.Generic;
+using System.Globalization;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Data;
+
+namespace PDF_Office.DataConvert
+{
+    public class BoolToVisible : IValueConverter
+    {
+        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
+        {
+            if (value == null)
+            {
+                return Visibility.Collapsed;
+            }
+            else
+            {
+                if ((bool)value)
+                {
+                    return Visibility.Visible;
+                }
+                else
+                {
+                    return Visibility.Collapsed;
+                }
+            }
+
+        }
+
+        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
+        {
+            
+            if (value == null)
+            {
+                return false;
+            }
+            else
+            {
+                if ((Visibility)value == Visibility.Visible)
+                {
+                    return true;
+                }
+                else
+                {
+                    return false;
+                }
+            }
+        }
+    }
+}

+ 52 - 0
PDF Office/DataConvert/VisibleToBoolConvert.cs

@@ -0,0 +1,52 @@
+using System;
+using System.Collections.Generic;
+using System.Globalization;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Data;
+
+namespace PDF_Office.DataConvert
+{
+    public class VisibleToBoolConvert : IValueConverter
+    {
+        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
+        {
+            if (value == null)
+            {
+                return false;
+            }
+            else
+            {
+                if ((Visibility)value==Visibility.Visible)
+                {
+                    return true;
+                }
+                else
+                {
+                    return false;
+                }
+            }
+        }
+
+        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
+        {
+            if (value == null)
+            {
+                return Visibility.Collapsed;
+            }
+            else
+            {
+                if ((bool)value)
+                {
+                    return Visibility.Visible;
+                }
+                else
+                {
+                    return Visibility.Collapsed;
+                }
+            }
+        }
+    }
+}

+ 29 - 1
PDF Office/PDF Office.csproj

@@ -103,12 +103,19 @@
       <SubType>Designer</SubType>
     </ApplicationDefinition>
     <Compile Include="CustomControl\InterTabClient.cs" />
+    <Compile Include="CustomControl\LoadingControl.xaml.cs">
+      <DependentUpon>LoadingControl.xaml</DependentUpon>
+    </Compile>
     <Compile Include="CustomControl\RegionNames.cs" />
     <Compile Include="CustomControl\TabablzRegionBehavior.cs" />
+    <Compile Include="DataConvert\BoolToVisible.cs" />
+    <Compile Include="DataConvert\VisibleToBoolConvert.cs" />
     <Compile Include="EventAggregators\DragablzWindowEvent.cs" />
     <Compile Include="EventAggregators\OpenFileEvent.cs" />
     <Compile Include="ViewModels\BOTA\BOTAContentViewModel.cs" />
     <Compile Include="ViewModels\BottomToolContentViewModel.cs" />
+    <Compile Include="ViewModels\Dialog\FullSreenWindowViewModel.cs" />
+    <Compile Include="ViewModels\Dialog\VerifyPassWordDialogViewModel.cs" />
     <Compile Include="ViewModels\HomePanel\HomeCloudContentViewModel.cs" />
     <Compile Include="ViewModels\HomePanel\HomeGuidContentViewModel.cs" />
     <Compile Include="ViewModels\HomePanel\HomeToolsContentViewModel.cs" />
@@ -119,6 +126,12 @@
     <Compile Include="Views\BottomToolContent.xaml.cs">
       <DependentUpon>BottomToolContent.xaml</DependentUpon>
     </Compile>
+    <Compile Include="Views\Dialog\FullScreenWindow.xaml.cs">
+      <DependentUpon>FullScreenWindow.xaml</DependentUpon>
+    </Compile>
+    <Compile Include="Views\Dialog\VerifyPassWordDialog.xaml.cs">
+      <DependentUpon>VerifyPassWordDialog.xaml</DependentUpon>
+    </Compile>
     <Compile Include="Views\HomePanel\HomeCloudContent.xaml.cs">
       <DependentUpon>HomeCloudContent.xaml</DependentUpon>
     </Compile>
@@ -134,6 +147,14 @@
     <Compile Include="Views\ViewContent.xaml.cs">
       <DependentUpon>ViewContent.xaml</DependentUpon>
     </Compile>
+    <Page Include="CustomControl\LoadingControl.xaml">
+      <SubType>Designer</SubType>
+      <Generator>MSBuild:Compile</Generator>
+    </Page>
+    <Page Include="Styles\TabControlStyle.xaml">
+      <SubType>Designer</SubType>
+      <Generator>MSBuild:Compile</Generator>
+    </Page>
     <Page Include="Views\BOTA\BOTAContent.xaml">
       <SubType>Designer</SubType>
       <Generator>MSBuild:Compile</Generator>
@@ -142,6 +163,14 @@
       <SubType>Designer</SubType>
       <Generator>MSBuild:Compile</Generator>
     </Page>
+    <Page Include="Views\Dialog\FullScreenWindow.xaml">
+      <SubType>Designer</SubType>
+      <Generator>MSBuild:Compile</Generator>
+    </Page>
+    <Page Include="Views\Dialog\VerifyPassWordDialog.xaml">
+      <SubType>Designer</SubType>
+      <Generator>MSBuild:Compile</Generator>
+    </Page>
     <Page Include="Views\HomeContent.xaml">
       <Generator>MSBuild:Compile</Generator>
       <SubType>Designer</SubType>
@@ -213,7 +242,6 @@
     <None Include="App.config" />
   </ItemGroup>
   <ItemGroup>
-    <Folder Include="DataConvert\" />
     <Folder Include="Model\" />
     <Folder Include="Resources\" />
     <Folder Include="Tools\" />

+ 109 - 0
PDF Office/Styles/TabControlStyle.xaml

@@ -0,0 +1,109 @@
+<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
+
+    <Style x:Key="TabControlWithUnderLineStyle" TargetType="{x:Type TabControl}">
+        <Setter Property="Padding" Value="2" />
+        <Setter Property="HorizontalContentAlignment" Value="Center" />
+        <Setter Property="VerticalContentAlignment" Value="Center" />
+        <Setter Property="Background" Value="Transparent" />
+        <Setter Property="BorderBrush" Value="#FFACACAC" />
+        <Setter Property="BorderThickness" Value="0,0,0,1" />
+        <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}" />
+        <Setter Property="Template">
+            <Setter.Value>
+                <ControlTemplate TargetType="{x:Type TabControl}">
+                    <Grid
+                        x:Name="templateRoot"
+                        ClipToBounds="True"
+                        KeyboardNavigation.TabNavigation="Local"
+                        SnapsToDevicePixels="True">
+                        <Grid.ColumnDefinitions>
+                            <ColumnDefinition x:Name="ColumnDefinition0" />
+                            <ColumnDefinition x:Name="ColumnDefinition1" Width="0" />
+                        </Grid.ColumnDefinitions>
+                        <Grid.RowDefinitions>
+                            <RowDefinition x:Name="RowDefinition0" Height="Auto" />
+                            <RowDefinition x:Name="RowDefinition1" Height="*" />
+                        </Grid.RowDefinitions>
+                        <!--  加滑轨配合滑轨样式可实现箭头左右滚动的菜单栏  -->
+                        <!--<ScrollViewer  Margin="140 0 140 0" HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Disabled">-->
+                        <TabPanel
+                            x:Name="HeaderPanel"
+                            Grid.Row="0"
+                            Grid.Column="0"
+                            HorizontalAlignment="{TemplateBinding HorizontalAlignment}"
+                            VerticalAlignment="{TemplateBinding VerticalAlignment}"
+                            Panel.ZIndex="1"
+                            Background="Transparent"
+                            IsItemsHost="True"
+                            KeyboardNavigation.TabIndex="1" />
+                        <!--</ScrollViewer>-->
+                        <!--  页头和中间内容的分割线  -->
+                        <Line
+                            Margin="0,0,0,1"
+                            VerticalAlignment="Bottom"
+                            SnapsToDevicePixels="True"
+                            Stroke="Transparent"
+                            StrokeThickness="0.1"
+                            X1="0"
+                            X2="{Binding ActualWidth, RelativeSource={RelativeSource Self}}" />
+                        <Border
+                            x:Name="ContentPanel"
+                            Grid.Row="1"
+                            Grid.Column="0"
+                            Background="{TemplateBinding Background}"
+                            BorderBrush="{TemplateBinding BorderBrush}"
+                            BorderThickness="{TemplateBinding BorderThickness}"
+                            KeyboardNavigation.DirectionalNavigation="Contained"
+                            KeyboardNavigation.TabIndex="2"
+                            KeyboardNavigation.TabNavigation="Local">
+                            <ContentPresenter
+                                x:Name="PART_SelectedContentHost"
+                                Margin="0"
+                                VerticalAlignment="Stretch"
+                                Content="{TemplateBinding SelectedContent}"
+                                ContentSource="SelectedContent"
+                                ContentStringFormat="{TemplateBinding SelectedContentStringFormat}"
+                                ContentTemplate="{TemplateBinding SelectedContentTemplate}"
+                                SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
+                        </Border>
+                    </Grid>
+                    <ControlTemplate.Triggers>
+                        <Trigger Property="TabStripPlacement" Value="Bottom">
+                            <Setter TargetName="HeaderPanel" Property="Grid.Row" Value="1" />
+                            <Setter TargetName="ContentPanel" Property="Grid.Row" Value="0" />
+                            <Setter TargetName="RowDefinition0" Property="Height" Value="*" />
+                            <Setter TargetName="RowDefinition1" Property="Height" Value="Auto" />
+
+                        </Trigger>
+                        <Trigger Property="TabStripPlacement" Value="Left">
+                            <Setter TargetName="HeaderPanel" Property="Grid.Row" Value="0" />
+                            <Setter TargetName="ContentPanel" Property="Grid.Row" Value="0" />
+                            <Setter TargetName="HeaderPanel" Property="Grid.Column" Value="0" />
+                            <Setter TargetName="ContentPanel" Property="Grid.Column" Value="1" />
+                            <Setter TargetName="ColumnDefinition0" Property="Width" Value="Auto" />
+                            <Setter TargetName="ColumnDefinition1" Property="Width" Value="*" />
+                            <Setter TargetName="RowDefinition0" Property="Height" Value="*" />
+                            <Setter TargetName="RowDefinition1" Property="Height" Value="0" />
+                            <Setter TargetName="HeaderPanel" Property="VerticalAlignment" Value="Top" />
+                        </Trigger>
+                        <Trigger Property="TabStripPlacement" Value="Right">
+                            <Setter TargetName="HeaderPanel" Property="Grid.Row" Value="0" />
+                            <Setter TargetName="ContentPanel" Property="Grid.Row" Value="0" />
+                            <Setter TargetName="HeaderPanel" Property="Grid.Column" Value="1" />
+                            <Setter TargetName="ContentPanel" Property="Grid.Column" Value="0" />
+                            <Setter TargetName="ColumnDefinition0" Property="Width" Value="*" />
+                            <Setter TargetName="ColumnDefinition1" Property="Width" Value="Auto" />
+                            <Setter TargetName="RowDefinition0" Property="Height" Value="*" />
+                            <Setter TargetName="RowDefinition1" Property="Height" Value="0" />
+                        </Trigger>
+                        <Trigger Property="IsEnabled" Value="False">
+                            <Setter TargetName="templateRoot" Property="TextElement.Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}" />
+                        </Trigger>
+                    </ControlTemplate.Triggers>
+                </ControlTemplate>
+            </Setter.Value>
+        </Setter>
+        <Setter Property="KeyboardNavigation.DirectionalNavigation" Value="Cycle" />
+        <Setter Property="KeyboardNavigation.TabNavigation" Value="Cycle" />
+    </Style>
+</ResourceDictionary>

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

@@ -1,4 +1,5 @@
 using Prism.Mvvm;
+using Prism.Regions;
 using System;
 using System.Collections.Generic;
 using System.Linq;
@@ -7,12 +8,30 @@ using System.Threading.Tasks;
 
 namespace PDF_Office.ViewModels.BOTA
 {
-    public class BOTAContentViewModel:BindableBase
+    public class BOTAContentViewModel:BindableBase, INavigationAware
     {
 
         public BOTAContentViewModel()
         {
 
         }
+
+        #region Navigate
+
+        public bool IsNavigationTarget(NavigationContext navigationContext)
+        {
+            return true;
+        }
+
+        public void OnNavigatedFrom(NavigationContext navigationContext)
+        {
+
+        }
+
+        public void OnNavigatedTo(NavigationContext navigationContext)
+        {
+            
+        }
+        #endregion
     }
 }

+ 350 - 4
PDF Office/ViewModels/BottomToolContentViewModel.cs

@@ -5,16 +5,362 @@ using System.Linq;
 using System.Text;
 using System.Threading.Tasks;
 using ComPDFKitViewer.PdfViewer;
+using Prism.Commands;
+using Prism.Regions;
+using System.Windows;
+using PDF_Office.Views;
+using ComPDFKitViewer;
+using System.Windows.Input;
+using System.Windows.Controls;
 
 namespace PDF_Office.ViewModels
 {
-    public class BottomToolContentViewModel:BindableBase
+    public class BottomToolContentViewModel : BindableBase
     {
-        private CPDFViewer PDFViewer { get; set; }
 
-        public BottomToolContentViewModel()
+        public DelegateCommand Load { get; set; }
+
+        public DelegateCommand FirstPageCommand { get; set; }
+
+        public DelegateCommand LastPageCommand { get; set; }
+
+        public DelegateCommand PrePageCommand { get; set; }
+
+        public DelegateCommand NextPageCommand { get; set; }
+
+        public DelegateCommand MyPropertyCommand { get; set; }
+
+        public DelegateCommand FullScreenCommand { get; set; }
+
+        public DelegateCommand ReadModeCommand { get; set; }
+
+        public DelegateCommand OpenViewCommand { get; set; }
+
+        public DelegateCommand ZoomInCommand { get; set; }
+
+        public DelegateCommand ZoomOutCommand { get; set; }
+
+        public DelegateCommand SetViewModeCommand { get; set; }
+
+        public DelegateCommand<object> PageTextKeyDownCommand { get; set; }
+
+        public DelegateCommand<object> PageTextPreviewKeyDownCommand { get; set; }
+
+        private bool isSingleView;
+
+        public bool IsSingleView
+        {
+            get { return isSingleView; }
+            set
+            {
+                SetProperty(ref isSingleView, value);
+                if (value)
+                {
+                    SetModeView();
+                }
+            }
+        }
+
+        private bool isContinue;
+
+        public bool IsContinue
+        {
+            get { return isContinue; }
+            set
+            {
+                SetProperty(ref isContinue, value);
+                SetModeView();
+            }
+        }
+
+        private bool isDoubleView;
+
+        public bool IsDoubleView
+        {
+            get { return isDoubleView; }
+            set
+            {
+                SetProperty(ref isDoubleView, value);
+                if (value)
+                {
+                    SetModeView();
+                }
+            }
+        }
+
+        private bool isBookMode;
+
+        public bool IsBookMode
+        {
+            get { return isBookMode; }
+            set
+            {
+                SetProperty(ref isBookMode, value);
+                if (value)
+                {
+                    SetModeView();
+                }
+            }
+        }
+
+        private int pageCount;
+
+        public int PageCount
+        {
+            get { return pageCount; }
+            set
+            {
+                SetProperty(ref pageCount, value);
+            }
+        }
+
+        private int currentPage;
+
+        public int CurrentPage
+        {
+            get { return currentPage; }
+            set
+            {
+                SetProperty(ref currentPage, value);
+            }
+        }
+
+
+
+        public CPDFViewer PDFViewer { get; set; }
+
+
+        private IRegionManager region;
+
+        public BottomToolContentViewModel(IRegionManager regionManager)
+        {
+            region = regionManager;
+
+
+
+            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);
+            SetViewModeCommand = new DelegateCommand(SetModeView);
+            PageTextKeyDownCommand = new DelegateCommand<object>(PageNumText_KeyDown);
+            PageTextPreviewKeyDownCommand = new DelegateCommand<object>(PageNumText_PreviewKeyDown);
+        }
+
+        private void PageNumText_PreviewKeyDown(object e)
+        {
+            var args = e as KeyEventArgs;
+            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,
+            Key.NumPad3,Key.NumPad4,Key.NumPad5,Key.NumPad6,Key.NumPad7,Key.NumPad8,Key.NumPad9,Key.Delete,Key.Back,Key.Enter,Key.Right,Key.Left};
+                if (!NumberKeys.Contains(args.Key))
+                {
+                    args.Handled = true;
+                }
+            }
+        }
+
+        private void PageNumText_KeyDown(object e)
+        {
+            if (!(e is KeyEventArgs))
+                return;
+            //回车提交输入
+            if ((e as KeyEventArgs).Key == System.Windows.Input.Key.Enter)
+            {
+                int pagenum = 0;
+                string text = ((e as KeyEventArgs).OriginalSource as TextBox).Text.ToString();
+                char[] chs = { ' ', '/', '\\' };//字符截取  拒止非法输入
+                int i = text.LastIndexOfAny(chs);
+                if (i > 0)
+                    text = text.Substring(0, i - 1);
+
+                if (!int.TryParse(text, out pagenum))
+                {
+                    CurrentPage = PDFViewer.Document.PageCount;
+                    ((e as KeyEventArgs).OriginalSource as TextBox).Text = PDFViewer.Document.PageCount.ToString();
+                    return;
+                }
+                if (pagenum < 1)
+                    pagenum = 1;
+                else if (pagenum > PDFViewer.Document.PageCount)
+                    pagenum = PDFViewer.Document.PageCount;
+
+                PDFViewer.GoToPage(pagenum - 1);
+                CurrentPage = pagenum;
+                ((e as KeyEventArgs).OriginalSource as TextBox).Text = pagenum.ToString();
+            }
+        }
+
+        private void GoPrePage()
+        {
+            if (PDFViewer != null)
+            {
+                PDFViewer.GoToPage(PDFViewer.CurrentIndex - 1);
+            }
+        }
+
+        private bool CanPrePageExcute()
+        {
+            if (PDFViewer != null)
+            {
+                if (PDFViewer.CurrentIndex <= 0)
+                    return false;
+                else
+                    return true;
+            }
+            return false;
+        }
+
+
+        private void GoNextPage()
+        {
+            if (PDFViewer != null)
+            {
+                PDFViewer.GoToPage(PDFViewer.CurrentIndex + 1);
+                if(((int)PDFViewer.Mode%2)==0)
+                {
+                    PDFViewer.GoToPage(PDFViewer.CurrentIndex + 2);
+                }
+            }
+        }
+
+        private bool CanNextPageExcute()
+        {
+            if (PDFViewer != null)
+            {
+                if (PDFViewer.CurrentIndex >= PDFViewer.Document.PageCount - 1)
+                    return false;
+                else
+                    return true;
+            }
+            return false;
+        }
+
+        private void GoFirstPage()
+        {
+            if (PDFViewer != null)
+            {
+                PDFViewer.GoToPage(0);
+            }
+        }
+
+        private void GoLastPage()
+        {
+            if (PDFViewer != null)
+            {
+                PDFViewer.GoToPage(PDFViewer.Document.PageCount - 1);
+            }
+        }
+
+
+        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;
+                    PDFViewer.InfoChanged += PDFViewer_InfoChanged;
+                }
+
+            }
+        }
+
+        private void PDFViewer_InfoChanged(object sender, KeyValuePair<string, object> e)
+        {
+            if (e.Key == "PageNum")
+            {
+                CurrentPage = (int)e.Value;
+            }
+            if (e.Key == "ViewMode")
+            {
+                GetModeView((ViewMode)e.Value);
+            }
+        }
+
+        private void GetModeView(ViewMode mode)
+        {
+            if ((int)mode % 2 == 0)
+            {
+                if(!IsContinue)
+                {
+                    IsContinue = true;
+                }
+               
+            }
+            else
+            {
+                if (IsContinue)
+                {
+                    IsContinue = false;
+                }
+            }
+
+            if ((int)mode <= 2)
+            {
+                if(!isSingleView)
+                {
+                    IsSingleView = true;
+                }
+            }
+            else if ((int)mode <= 4)
+            {
+                if(!isDoubleView)
+                {
+                    IsDoubleView = true;
+                }
+            }
+            else
+            {
+                if(!isBookMode)
+                {
+                    IsBookMode = true;
+                }
+            }
+        }
+
+        private void SetModeView()
         {
-            PDFViewer = App.mainWindowViewModel.CurrentPDFViewer;
+            if (PDFViewer != null)
+            {
+                if (IsContinue)
+                {
+                    if (IsSingleView)
+                    {
+                        PDFViewer.ChangeViewMode(ViewMode.SingleContinuous);
+                    }
+                    else if (IsDoubleView)
+                    {
+                        PDFViewer.ChangeViewMode(ViewMode.DoubleContinuous);
+                    }
+                    else
+                    {
+                        PDFViewer.ChangeViewMode(ViewMode.BookContinuous);
+                    }
+                }
+                else
+                {
+                    if (IsSingleView)
+                    {
+                        PDFViewer.ChangeViewMode(ViewMode.Single);
+                    }
+                    else if (IsDoubleView)
+                    {
+                        PDFViewer.ChangeViewMode(ViewMode.Double);
+                    }
+                    else
+                    {
+                        PDFViewer.ChangeViewMode(ViewMode.Book);
+                    }
+                }
+            }
         }
 
     }

+ 13 - 0
PDF Office/ViewModels/Dialog/FullSreenWindowViewModel.cs

@@ -0,0 +1,13 @@
+using Prism.Mvvm;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace PDF_Office.ViewModels.Dialog
+{
+    public class FullSreenWindowViewModel:BindableBase
+    {
+    }
+}

+ 14 - 0
PDF Office/ViewModels/Dialog/VerifyPassWordDialogViewModel.cs

@@ -0,0 +1,14 @@
+using Prism.Mvvm;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace PDF_Office.ViewModels.Dialog
+{
+    public class VerifyPassWordDialogViewModel:BindableBase
+    {
+
+    }
+}

+ 25 - 6
PDF Office/ViewModels/HomeContentViewModel.cs

@@ -6,9 +6,11 @@ using Prism.Mvvm;
 using Prism.Regions;
 using System;
 using System.Collections.Generic;
+using System.Diagnostics;
 using System.Linq;
 using System.Text;
 using System.Threading.Tasks;
+using System.Windows;
 
 namespace PDF_Office.ViewModels
 {
@@ -29,6 +31,20 @@ namespace PDF_Office.ViewModels
             set { SetProperty(ref regionName, value); }
         }
 
+        private Visibility isLoading = Visibility.Collapsed;
+
+        public Visibility IsLoading
+        {
+            get { return isLoading; }
+            set
+            {
+                SetProperty(ref isLoading, value);
+            }
+        }
+
+
+
+
         private MainContentViewModel mainContentViewModel;
 
         public DelegateCommand OpenFileCommand { get; set; }
@@ -86,14 +102,15 @@ namespace PDF_Office.ViewModels
                     if (fileList.Count <= 0)
                         return;
 
-                    mainContentViewModel.OpenFile(fileList[0]);
-                    for (int i = 1; i < fileList.Count(); i++)
-                    {
-                        if (!App.OpenedFileList.Contains(fileList[i]))
+                   
+                        mainContentViewModel.OpenFile(fileList[0]);
+                        for (int i = 1; i < fileList.Count(); i++)
                         {
-                            App.mainWindowViewModel.AddTabItem(fileList[i]);
+                            if (!App.OpenedFileList.Contains(fileList[i]))
+                            {
+                                App.mainWindowViewModel.AddTabItem(fileList[i]);
+                            }
                         }
-                    }
                 }
             }
         }
@@ -103,6 +120,7 @@ namespace PDF_Office.ViewModels
 
         }
 
+        #region Navigate
         public void OnNavigatedTo(NavigationContext navigationContext)
         {
             var mainVM = navigationContext.Parameters["MainViewModel"] as MainContentViewModel;
@@ -121,5 +139,6 @@ namespace PDF_Office.ViewModels
         {
 
         }
+        #endregion
     }
 }

+ 24 - 6
PDF Office/ViewModels/MainContentViewModel.cs

@@ -1,4 +1,5 @@
-using Microsoft.Win32;
+using ComPDFKitViewer.PdfViewer;
+using Microsoft.Win32;
 using PDF_Office.EventAggregators;
 using PDF_Office.Views;
 using Prism.Commands;
@@ -8,10 +9,12 @@ using Prism.Mvvm;
 using Prism.Regions;
 using System;
 using System.Collections.Generic;
+using System.Diagnostics;
 using System.Linq;
 using System.Text;
 using System.Threading.Tasks;
 using System.Windows;
+using System.Windows.Controls;
 
 namespace PDF_Office.ViewModels
 {
@@ -49,6 +52,19 @@ namespace PDF_Office.ViewModels
             set { SetProperty(ref fileChanged, value); }
         }
 
+        private Visibility isLoading = Visibility.Collapsed;
+
+        public Visibility IsLoading
+        {
+            get { return isLoading; }
+            set
+            {
+                SetProperty(ref isLoading, value);
+            }
+        }
+
+        public CPDFViewer PDFViewer { get; set; }
+
 
         public DelegateCommand<object> CloseTab { get; set; }
 
@@ -103,12 +119,14 @@ namespace PDF_Office.ViewModels
         {
             FilePath = filePath;
             NavigationParameters parameters = new NavigationParameters { { "MainViewModel", this } };
-
             System.Windows.Application.Current.Dispatcher.BeginInvoke(System.Windows.Threading.DispatcherPriority.Send, new Action(() =>
-            {
-                if (toolregion.Regions.ContainsRegionWithName(MainContentRegionName))
-                    toolregion.RequestNavigate(MainContentRegionName, "ViewContent", parameters);
-            }));
+                {
+                    if (toolregion.Regions.ContainsRegionWithName(MainContentRegionName))
+                        toolregion.RequestNavigate(MainContentRegionName, "ViewContent", parameters);
+
+
+
+                }));
         }
 
         public void OnNavigatedTo(NavigationContext navigationContext)

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

@@ -34,7 +34,14 @@ namespace PDF_Office.ViewModels
             get { return selectedItem; }
             set {
                 SetProperty(ref selectedItem, value);
-                //TODO:更新CurrentPDFViewer
+                if (SelectedItem!=null)
+                {
+                    var pdfviewer = (SelectedItem.DataContext as MainContentViewModel).PDFViewer;
+                    if(pdfviewer!=null)
+                    {
+                        CurrentPDFViewer = pdfviewer;
+                    }
+                }
             }
         }
 

+ 14 - 4
PDF Office/ViewModels/ViewContentViewModel.cs

@@ -9,6 +9,7 @@ using System.Threading.Tasks;
 using ComPDFKitViewer.PdfViewer;
 using Prism.Regions;
 using DryIoc;
+using System.Diagnostics;
 
 namespace PDF_Office.ViewModels
 {
@@ -17,6 +18,8 @@ namespace PDF_Office.ViewModels
     {
         public DelegateCommand LoadFile { get; set; }
 
+        public DelegateCommand Load { get; set; }
+
         private CPDFViewer PDFViewer { get; set; }
 
         private MainContentViewModel mainViewModel { get; set; }
@@ -45,15 +48,19 @@ namespace PDF_Office.ViewModels
             BOTARegionName = Guid.NewGuid().ToString();
             PropertyRegionName = Guid.NewGuid().ToString();
 
+ 
+        }
+
+        private void LoadControl()
+        {
             //在构造函数中使用Region需要借助Dispatcher 确保UI已经加载完成,加载BOTA区域
             System.Windows.Application.Current.Dispatcher.BeginInvoke(System.Windows.Threading.DispatcherPriority.Send, new Action(() =>
-                {
-                    region.RequestNavigate(BOTARegionName, "BOTAContent");
-                }
+            {
+                region.RequestNavigate(BOTARegionName, "BOTAContent");
+            }
             ));
         }
 
-
         private void loadFile()
         {
             if (mainViewModel == null || string.IsNullOrEmpty(mainViewModel.FileName))
@@ -65,6 +72,8 @@ namespace PDF_Office.ViewModels
             PDFViewer.MouseWheelZoomHandler += PdfViewer_MouseWheelZoomHandler;
             PDFViewer.InitDocument(filepath);
             PDFViewer.Load();
+
+            mainViewModel.PDFViewer = PDFViewer;
             if(App.mainWindowViewModel!=null)
             {
                 App.mainWindowViewModel.CurrentPDFViewer = PDFViewer;
@@ -119,6 +128,7 @@ namespace PDF_Office.ViewModels
             {
                 mainViewModel = mainVM;
             }
+
             loadFile();
             isOpenFile = true;
         }

+ 103 - 7
PDF Office/Views/BOTA/BOTAContent.xaml

@@ -2,6 +2,7 @@
     x:Class="PDF_Office.Views.BOTA.BOTAContent"
     xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
     xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+    xmlns:convert="clr-namespace:PDF_Office.DataConvert"
     xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
     xmlns:local="clr-namespace:PDF_Office.Views.BOTA"
     xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
@@ -10,11 +11,106 @@
     d:DesignWidth="800"
     prism:ViewModelLocator.AutoWireViewModel="True"
     mc:Ignorable="d">
-    <TabControl Background="Transparent" TabStripPlacement="Left">
-        <TabItem Width="48" Height="48" />
-        <TabItem Width="48" Height="48" />
-        <TabItem Width="48" Height="48" />
-        <TabItem Width="48" Height="48" />
-        <TabItem Width="48" Height="48" />
-    </TabControl>
+    <UserControl.Resources>
+        <ResourceDictionary>
+            <convert:VisibleToBoolConvert x:Key="VisibleToBoolConvert" />
+            <convert:BoolToVisible x:Key="BoolToVisibleConvert" />
+        </ResourceDictionary>
+    </UserControl.Resources>
+    <Grid>
+        <Grid.ColumnDefinitions>
+            <ColumnDefinition Width="48" />
+            <ColumnDefinition />
+        </Grid.ColumnDefinitions>
+        <Border Background="Transparent">
+            <Border.ContextMenu>
+                <!--  CnotextMenu 不在视觉书树内,绑定其他控件名称需要用到x:Refrence  -->
+                <ContextMenu>
+                    <MenuItem
+                        Name="MenuThumbnail"
+                        Header="{Binding Source={x:Reference Name=TabItemThumbnail}, Path=Name}"
+                        IsCheckable="True"
+                        IsChecked="True" />
+                    <MenuItem
+                        Name="MenuOutLine"
+                        Header="{Binding Source={x:Reference Name=TabItemOutLine}, Path=Name}"
+                        IsCheckable="True"
+                        IsChecked="True" />
+                    <MenuItem
+                        Name="MenuBookMark"
+                        Header="{Binding Source={x:Reference Name=TabItemBookMark}, Path=Name}"
+                        IsCheckable="True"
+                        IsChecked="True" />
+                    <MenuItem
+                        Name="MenuAnnotation"
+                        Header="{Binding Source={x:Reference Name=TabItemAnnotation}, Path=Name}"
+                        IsCheckable="True"
+                        IsChecked="True" />
+                    <MenuItem
+                        Name="MenuSearch"
+                        Header="{Binding Source={x:Reference Name=TabItemSearch}, Path=Name}"
+                        IsCheckable="True"
+                        IsChecked="True" />
+                    <MenuItem
+                        Name="MenuFrom"
+                        Header="{Binding Source={x:Reference Name=TabItemForm}, Path=Name}"
+                        IsCheckable="True" />
+                    <MenuItem
+                        Name="MenuSign"
+                        Header="{Binding Source={x:Reference Name=TabItemSign}, Path=Name}"
+                        IsCheckable="True" />
+                </ContextMenu>
+            </Border.ContextMenu>
+        </Border>
+        <TabControl
+            Grid.ColumnSpan="2"
+            Background="Transparent"
+            Style="{StaticResource TabControlWithUnderLineStyle}"
+            TabStripPlacement="Left">
+            <!--  建立一个空的标头占位  -->
+            <TabItem />
+            <TabItem
+                Name="TabItemThumbnail"
+                Width="48"
+                Height="48"
+                Header="缩略"
+                Visibility="{Binding ElementName=MenuThumbnail, Path=IsChecked, Converter={StaticResource BoolToVisibleConvert}, Mode=TwoWay}" />
+            <TabItem
+                Name="TabItemOutLine"
+                Width="48"
+                Height="48"
+                Header="大纲"
+                Visibility="{Binding ElementName=MenuOutLine, Path=IsChecked, Converter={StaticResource BoolToVisibleConvert}, Mode=TwoWay}" />
+            <TabItem
+                Name="TabItemBookMark"
+                Width="48"
+                Height="48"
+                Header="书签"
+                Visibility="{Binding ElementName=MenuBookMark, Path=IsChecked, Converter={StaticResource BoolToVisibleConvert}, Mode=TwoWay}" />
+            <TabItem
+                Name="TabItemAnnotation"
+                Width="48"
+                Height="48"
+                Header="注释"
+                Visibility="{Binding ElementName=MenuAnnotation, Path=IsChecked, Converter={StaticResource BoolToVisibleConvert}, Mode=TwoWay}" />
+            <TabItem
+                Name="TabItemSearch"
+                Width="48"
+                Height="48"
+                Header="搜索"
+                Visibility="{Binding ElementName=MenuSearch, Path=IsChecked, Converter={StaticResource BoolToVisibleConvert}, Mode=TwoWay}" />
+            <TabItem
+                Name="TabItemForm"
+                Width="48"
+                Height="48"
+                Header="域"
+                Visibility="{Binding ElementName=MenuFrom, Path=IsChecked, Converter={StaticResource BoolToVisibleConvert}, Mode=TwoWay}" />
+            <TabItem
+                Name="TabItemSign"
+                Width="48"
+                Height="48"
+                Header="签名"
+                Visibility="{Binding ElementName=MenuSign, Path=IsChecked, Converter={StaticResource BoolToVisibleConvert}, Mode=TwoWay}" />
+        </TabControl>
+    </Grid>
 </UserControl>

+ 5 - 0
PDF Office/Views/BOTA/BOTAContent.xaml.cs

@@ -24,5 +24,10 @@ namespace PDF_Office.Views.BOTA
         {
             InitializeComponent();
         }
+
+        private void Border_MouseDown(object sender, MouseButtonEventArgs e)
+        {
+
+        }
     }
 }

+ 150 - 16
PDF Office/Views/BottomToolContent.xaml

@@ -3,18 +3,64 @@
     xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
     xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
     xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
+    xmlns:i="http://schemas.microsoft.com/xaml/behaviors"
     xmlns:local="clr-namespace:PDF_Office.Views"
     xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
     xmlns:prism="http://prismlibrary.com/"
+    xmlns:viewmodels="clr-namespace:PDF_Office.ViewModels"
+    d:DataContext="{d:DesignInstance Type=viewmodels:BottomToolContentViewModel}"
     d:DesignHeight="450"
     d:DesignWidth="1280"
     prism:ViewModelLocator.AutoWireViewModel="True"
+    Loaded="UserControl_Loaded"
     mc:Ignorable="d">
+    <UserControl.Resources>
+        <Style x:Key="Radion_ButtonStyle" TargetType="{x:Type RadioButton}">
+            <Setter Property="Foreground" Value="Black" />
+            <Setter Property="Background" Value="White" />
+            <Setter Property="FontSize" Value="18" />
+            <Setter Property="Cursor" Value="Hand" />
+            <Setter Property="Margin" Value="0,0,10,10" />
+            <Setter Property="Height" Value="32" />
+            <Setter Property="Template">
+                <Setter.Value>
+                    <ControlTemplate TargetType="{x:Type RadioButton}">
+                        <Border
+                            x:Name="fore"
+                            Background="White"
+                            BorderThickness="0"
+                            CornerRadius="0">
+                            <ContentPresenter
+                                x:Name="content"
+                                HorizontalAlignment="Center"
+                                VerticalAlignment="Center"
+                                Content="{TemplateBinding Content}" />
+                        </Border>
+                        <ControlTemplate.Triggers>
+                            <Trigger Property="IsChecked" Value="true">
+                                <Setter TargetName="fore" Property="Background" Value="#575757" />
+                                <Setter Property="Foreground" Value="White" />
+                            </Trigger>
+                            <Trigger Property="IsMouseOver" Value="True">
+                                <Setter TargetName="fore" Property="Background" Value="#575757" />
+                                <Setter Property="Foreground" Value="White" />
+                            </Trigger>
+                        </ControlTemplate.Triggers>
+                    </ControlTemplate>
+                </Setter.Value>
+            </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="*"/>
-            <ColumnDefinition Width="auto" MinWidth="{Binding ElementName=StkPnlCenter,Path=ActualWidth}"/>
-            <ColumnDefinition MinWidth="{Binding ElementName=StkPnlRight, Path=ActualWidth}"/>
+            <ColumnDefinition Width="*" />
+            <ColumnDefinition Width="auto" MinWidth="{Binding ElementName=StkPnlCenter, Path=ActualWidth}" />
+            <ColumnDefinition MinWidth="{Binding ElementName=StkPnlRight, Path=ActualWidth}" />
         </Grid.ColumnDefinitions>
         <StackPanel
             Name="StkPnlCenter"
@@ -24,21 +70,86 @@
             <Button
                 Width="24"
                 Height="24"
-                Margin="4" />
+                Margin="4"
+                Command="{Binding FirstPageCommand}">
+                <Path
+                    HorizontalAlignment="Center"
+                    Data="M5.01864718,2 L5.01864718,14 L4,14 L4,2 L5.01864718,2 Z M11.2797077,2.64644661 L12,3.35355339 L7.2668015,8 L12,12.6464466 L11.2797077,13.3535534 L5.82632562,8 L11.2797077,2.64644661 Z"
+                    Fill="Black">
+                    <Path.RenderTransform>
+                        <TransformGroup>
+                            <TranslateTransform X="-2" />
+                        </TransformGroup>
+                    </Path.RenderTransform>
+                </Path>
+            </Button>
             <Button
                 Width="24"
                 Height="24"
-                Margin="4" />
-            <TextBox Width="48" />
-            <TextBlock VerticalAlignment="Center" Text="/200" />
+                Margin="4"
+                Command="{Binding PrePageCommand}">
+                <Polygon Fill="Black" Points="14.25 5.45223214 13.5232733 4.75 8.25 9.84553571 2.97672673 4.75 2.25 5.45223214 8.25 11.25">
+                    <Polygon.RenderTransform>
+                        <TransformGroup>
+                            <TranslateTransform X="8.250000" Y="8.000000" />
+                            <ScaleTransform ScaleX="-1" ScaleY="1" />
+                            <RotateTransform Angle="90" />
+                            <TranslateTransform X="22.250000" Y="23.000000" />
+                        </TransformGroup>
+                    </Polygon.RenderTransform>
+                </Polygon>
+            </Button>
+            <TextBox
+                Width="48"
+                Height="24"
+                Padding="10,0,0,0"
+                VerticalAlignment="Center"
+                VerticalContentAlignment="Center"
+                FontSize="12"
+                InputMethod.IsInputMethodEnabled="False"
+                Text="{Binding CurrentPage}">
+                <i:Interaction.Triggers>
+                    <i:EventTrigger EventName="KeyDown">
+                        <i:InvokeCommandAction Command="{Binding PageTextKeyDownCommand}" PassEventArgsToCommand="True" />
+                    </i:EventTrigger>
+                    <i:EventTrigger EventName="PreviewKeyDown">
+                        <i:InvokeCommandAction Command="{Binding PageTextPreviewKeyDownCommand}" PassEventArgsToCommand="True" />
+                    </i:EventTrigger>
+                </i:Interaction.Triggers>
+            </TextBox>
+            <TextBlock
+                MinWidth="50"
+                VerticalAlignment="Center"
+                Text="{Binding PageCount, StringFormat=/{0}}" />
             <Button
                 Width="24"
                 Height="24"
-                Margin="4" />
+                Margin="4"
+                Command="{Binding NextPageCommand}">
+                <Polygon Fill="Black" Points="14.25 5.45223214 13.5232733 4.75 8.25 9.84553571 2.97672673 4.75 2.25 5.45223214 8.25 11.25">
+                    <Polygon.RenderTransform>
+                        <TransformGroup>
+                            <TranslateTransform X="8.000000" Y="8.000000" />
+                            <ScaleTransform ScaleX="-1" ScaleY="1" />
+                            <RotateTransform Angle="-90" />
+                            <TranslateTransform X="-8.000000" Y="-10.000000" />
+                        </TransformGroup>
+                    </Polygon.RenderTransform>
+                </Polygon>
+            </Button>
             <Button
                 Width="24"
                 Height="24"
-                Margin="4" />
+                Margin="4"
+                Command="{Binding LastPageCommand}">
+                <Path Data="M12.0252351,2 L12.0252351,14 L11.0252351,14 L11.0252351,2 L12.0252351,2 Z M4.6892629,2.64644661 L9.90771909,8 L4.6892629,13.3535534 L4,12.6464466 L8.52929737,8 L4,3.35355339 L4.6892629,2.64644661 Z" Fill="Black">
+                    <Path.RenderTransform>
+                        <TransformGroup>
+                            <TranslateTransform X="-3" />
+                        </TransformGroup>
+                    </Path.RenderTransform>
+                </Path>
+            </Button>
         </StackPanel>
         <StackPanel
             x:Name="StkPnlRight"
@@ -48,23 +159,46 @@
             <ToggleButton
                 Width="24"
                 Height="24"
-                Margin="4" />
+                Margin="4"
+                Command="{Binding SetViewModeCommand}"
+                IsChecked="{Binding IsContinue}">
+                <Grid>
+                    <Polygon Fill="Black" Points="2 0 2 6 14 6 14 0 15 0 15 7 1 7 1 0" />
+                    <Path Data="M10.807106,9 L15,13.3928931 L15,16 L14,16 L14,14 L9.999999,14 L9.999,10 L2,10 L2,16 L1,16 L1,9 L10.807106,9 Z M13.237,13 L10.999,10.64 L10.999,13 L13.237,13 Z" Fill="Black" />
+                </Grid>
+            </ToggleButton>
             <Separator
                 Width="1"
                 Height="10"
                 Style="{StaticResource {x:Static ToolBar.SeparatorStyleKey}}" />
-            <Button
+            <RadioButton
                 Width="24"
                 Height="24"
-                Margin="4" />
-            <Button
+                Margin="4"
+                Command="{Binding SetViewModeCommand}"
+                IsChecked="{Binding IsSingleView}"
+                Style="{StaticResource Radion_ButtonStyle}">
+                <Path Data="M9.80710597,0 L14,4.39289312 L14,16 L2,16 L2,0 L9.80710597,0 Z M8.999,1 L3,1 L3,15 L13,15 L13,4.999 L8.999999,5 L8.999,1 Z M12.236,3.999 L9.999,1.64 L9.999,4 L12.236,3.999 Z" Fill="Black" />
+            </RadioButton>
+
+            <RadioButton
                 Width="24"
                 Height="24"
-                Margin="4" />
-            <Button
+                Margin="4"
+                Command="{Binding SetViewModeCommand}"
+                IsChecked="{Binding IsDoubleView}"
+                Style="{StaticResource Radion_ButtonStyle}">
+                <Path Data="M0,15 L0,1 L11.807106,1 L16,5.39289312 L16,15 L0,15 Z M7.5,2 L1,2 L1,14 L7.5,14 L7.5,2 Z M10.999,2 L8.5,2 L8.5,14 L15,14 L15,5.999 L10.999999,6 L10.999,2 Z M11.999,2.64 L11.999,5 L14.236,4.999 L11.999,2.64 Z" Fill="Black" />
+            </RadioButton>
+            <RadioButton
                 Width="24"
                 Height="24"
-                Margin="4" />
+                Margin="4"
+                Command="{Binding SetViewModeCommand}"
+                IsChecked="{Binding IsBookMode}"
+                Style="{StaticResource Radion_ButtonStyle}">
+                <Path Data="M7,11 L7,16 L6,16 L6,12 L1,12 L1,16 L0,16 L0,11 L7,11 Z M16,11 L16,16 L15,16 L15,12 L10,12 L10,16 L9,16 L9,11 L16,11 Z M3.80710597,0 L7,3.39289312 L7,9 L0,9 L0,0 L3.80710597,0 Z M2.999,1 L1,1 L1,8 L6,8 L6,3.999 L2.999999,4 L2.999,1 Z M3.999,1.652 L3.999,3 L5.251,2.999 L3.999,1.652 Z" Fill="Black" />
+            </RadioButton>
             <Separator
                 Width="1"
                 Height="10"

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

@@ -24,5 +24,10 @@ namespace PDF_Office.Views
         {
             InitializeComponent();
         }
+
+        private void UserControl_Loaded(object sender, RoutedEventArgs e)
+        {
+
+        }
     }
 }

+ 13 - 0
PDF Office/Views/Dialog/FullScreenWindow.xaml

@@ -0,0 +1,13 @@
+<Window
+    x:Class="PDF_Office.Views.Dialog.FullScreenWindow"
+    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
+    xmlns:local="clr-namespace:PDF_Office.Views.Dialog"
+    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
+    Title="FullScreenWindow"
+    Width="800"
+    Height="450"
+    mc:Ignorable="d">
+    <Grid />
+</Window>

+ 27 - 0
PDF Office/Views/Dialog/FullScreenWindow.xaml.cs

@@ -0,0 +1,27 @@
+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.Shapes;
+
+namespace PDF_Office.Views.Dialog
+{
+    /// <summary>
+    /// FullScreenWindow.xaml 的交互逻辑
+    /// </summary>
+    public partial class FullScreenWindow : Window
+    {
+        public FullScreenWindow()
+        {
+            InitializeComponent();
+        }
+    }
+}

+ 12 - 0
PDF Office/Views/Dialog/VerifyPassWordDialog.xaml

@@ -0,0 +1,12 @@
+<Window x:Class="PDF_Office.Views.Dialog.VerifyPassWordDialog"
+        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
+        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
+        xmlns:local="clr-namespace:PDF_Office.Views.Dialog"
+        mc:Ignorable="d"
+        Title="VerifyPassWordDialog" Height="450" Width="800">
+    <Grid>
+        
+    </Grid>
+</Window>

+ 27 - 0
PDF Office/Views/Dialog/VerifyPassWordDialog.xaml.cs

@@ -0,0 +1,27 @@
+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.Shapes;
+
+namespace PDF_Office.Views.Dialog
+{
+    /// <summary>
+    /// VerifyPassWordDialog.xaml 的交互逻辑
+    /// </summary>
+    public partial class VerifyPassWordDialog : Window
+    {
+        public VerifyPassWordDialog()
+        {
+            InitializeComponent();
+        }
+    }
+}

+ 2 - 0
PDF Office/Views/HomeContent.xaml

@@ -2,6 +2,7 @@
     x:Class="PDF_Office.Views.HomeContent"
     xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
     xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+    xmlns:cus="clr-namespace:PDF_Office.CustomControl"
     xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
     xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
     xmlns:prism="http://prismlibrary.com/"
@@ -55,5 +56,6 @@
         </StackPanel>
         <!--  右侧内容区域  -->
         <ContentControl Grid.Column="1" prism:RegionManager.RegionName="{Binding ToolRegionName}" />
+        <cus:LoadingControl Grid.ColumnSpan="2" Visibility="{Binding IsLoading}" />
     </Grid>
 </UserControl>

+ 5 - 1
PDF Office/Views/MainContent.xaml

@@ -2,6 +2,7 @@
     x:Class="PDF_Office.Views.MainContent"
     xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
     xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+    xmlns:cus="clr-namespace:PDF_Office.CustomControl"
     xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
     xmlns:i="http://schemas.microsoft.com/xaml/behaviors"
     xmlns:local="clr-namespace:PDF_Office.Views"
@@ -16,5 +17,8 @@
             <prism:InvokeCommandAction Command="{Binding Loaded}" CommandParameter="{Binding}" />
         </i:EventTrigger>
     </i:Interaction.Triggers>-->
-    <ContentControl Name="ContentMain" prism:RegionManager.RegionName="{Binding MainContentRegionName}" />
+    <Grid>
+        <ContentControl Name="ContentMain" prism:RegionManager.RegionName="{Binding MainContentRegionName}" />
+        <cus:LoadingControl Grid.ColumnSpan="2" Visibility="{Binding IsLoading}" />
+    </Grid>
 </UserControl>

+ 8 - 108
PDF Office/Views/ViewContent.xaml

@@ -12,121 +12,20 @@
     d:DesignWidth="800"
     prism:ViewModelLocator.AutoWireViewModel="True"
     mc:Ignorable="d">
+    <i:Interaction.Triggers>
+        <i:EventTrigger EventName="Loaded">
+            <prism:InvokeCommandAction Command="{Binding}"/>
+        </i:EventTrigger>
+    </i:Interaction.Triggers>
     <UserControl.Resources>
-        <ResourceDictionary>
-            <Style x:Key="TabControlWithUnderLineStyle" TargetType="{x:Type TabControl}">
-                <Setter Property="Padding" Value="2" />
-                <Setter Property="HorizontalContentAlignment" Value="Center" />
-                <Setter Property="VerticalContentAlignment" Value="Center" />
-                <Setter Property="Background" Value="Transparent" />
-                <Setter Property="BorderBrush" Value="#FFACACAC" />
-                <Setter Property="BorderThickness" Value="0,0,0,1" />
-                <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}" />
-                <Setter Property="Template">
-                    <Setter.Value>
-                        <ControlTemplate TargetType="{x:Type TabControl}">
-                            <Grid
-                                x:Name="templateRoot"
-                                ClipToBounds="True"
-                                KeyboardNavigation.TabNavigation="Local"
-                                SnapsToDevicePixels="True">
-                                <Grid.ColumnDefinitions>
-                                    <ColumnDefinition x:Name="ColumnDefinition0" />
-                                    <ColumnDefinition x:Name="ColumnDefinition1" Width="0" />
-                                </Grid.ColumnDefinitions>
-                                <Grid.RowDefinitions>
-                                    <RowDefinition x:Name="RowDefinition0" Height="Auto" />
-                                    <RowDefinition x:Name="RowDefinition1" Height="*" />
-                                </Grid.RowDefinitions>
-                                <!--  加滑轨配合滑轨样式可实现箭头左右滚动的菜单栏  -->
-                                <!--<ScrollViewer  Margin="140 0 140 0" HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Disabled">-->
-                                <TabPanel
-                                    x:Name="HeaderPanel"
-                                    Grid.Row="0"
-                                    Grid.Column="0"
-                                    Margin="30,0"
-                                    HorizontalAlignment="Center"
-                                    Panel.ZIndex="1"
-                                    Background="Transparent"
-                                    IsItemsHost="True"
-                                    KeyboardNavigation.TabIndex="1" />
-                                <!--</ScrollViewer>-->
-                                <!--  页头和中间内容的分割线  -->
-                                <Line
-                                    Margin="0,0,0,1"
-                                    VerticalAlignment="Bottom"
-                                    SnapsToDevicePixels="True"
-                                    Stroke="Transparent"
-                                    StrokeThickness="0.1"
-                                    X1="0"
-                                    X2="{Binding ActualWidth, RelativeSource={RelativeSource Self}}" />
-                                <Border
-                                    x:Name="ContentPanel"
-                                    Grid.Row="1"
-                                    Grid.Column="0"
-                                    Background="{TemplateBinding Background}"
-                                    BorderBrush="{TemplateBinding BorderBrush}"
-                                    BorderThickness="{TemplateBinding BorderThickness}"
-                                    KeyboardNavigation.DirectionalNavigation="Contained"
-                                    KeyboardNavigation.TabIndex="2"
-                                    KeyboardNavigation.TabNavigation="Local">
-                                    <ContentPresenter
-                                        x:Name="PART_SelectedContentHost"
-                                        Margin="0"
-                                        Content="{TemplateBinding SelectedContent}"
-                                        ContentSource="SelectedContent"
-                                        ContentStringFormat="{TemplateBinding SelectedContentStringFormat}"
-                                        ContentTemplate="{TemplateBinding SelectedContentTemplate}"
-                                        SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
-                                </Border>
-                            </Grid>
-                            <ControlTemplate.Triggers>
-                                <Trigger Property="TabStripPlacement" Value="Bottom">
-                                    <Setter TargetName="HeaderPanel" Property="Grid.Row" Value="1" />
-                                    <Setter TargetName="ContentPanel" Property="Grid.Row" Value="0" />
-                                    <Setter TargetName="RowDefinition0" Property="Height" Value="*" />
-                                    <Setter TargetName="RowDefinition1" Property="Height" Value="Auto" />
-
-                                </Trigger>
-                                <Trigger Property="TabStripPlacement" Value="Left">
-                                    <Setter TargetName="HeaderPanel" Property="Grid.Row" Value="0" />
-                                    <Setter TargetName="ContentPanel" Property="Grid.Row" Value="0" />
-                                    <Setter TargetName="HeaderPanel" Property="Grid.Column" Value="0" />
-                                    <Setter TargetName="ContentPanel" Property="Grid.Column" Value="1" />
-                                    <Setter TargetName="ColumnDefinition0" Property="Width" Value="Auto" />
-                                    <Setter TargetName="ColumnDefinition1" Property="Width" Value="*" />
-                                    <Setter TargetName="RowDefinition0" Property="Height" Value="*" />
-                                    <Setter TargetName="RowDefinition1" Property="Height" Value="0" />
-
-                                </Trigger>
-                                <Trigger Property="TabStripPlacement" Value="Right">
-                                    <Setter TargetName="HeaderPanel" Property="Grid.Row" Value="0" />
-                                    <Setter TargetName="ContentPanel" Property="Grid.Row" Value="0" />
-                                    <Setter TargetName="HeaderPanel" Property="Grid.Column" Value="1" />
-                                    <Setter TargetName="ContentPanel" Property="Grid.Column" Value="0" />
-                                    <Setter TargetName="ColumnDefinition0" Property="Width" Value="*" />
-                                    <Setter TargetName="ColumnDefinition1" Property="Width" Value="Auto" />
-                                    <Setter TargetName="RowDefinition0" Property="Height" Value="*" />
-                                    <Setter TargetName="RowDefinition1" Property="Height" Value="0" />
-                                </Trigger>
-                                <Trigger Property="IsEnabled" Value="False">
-                                    <Setter TargetName="templateRoot" Property="TextElement.Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}" />
-                                </Trigger>
-                            </ControlTemplate.Triggers>
-                        </ControlTemplate>
-                    </Setter.Value>
-                </Setter>
-                <Setter Property="KeyboardNavigation.DirectionalNavigation" Value="Cycle" />
-                <Setter Property="KeyboardNavigation.TabNavigation" Value="Cycle" />
-            </Style>
-        </ResourceDictionary>
+        <ResourceDictionary />
     </UserControl.Resources>
     <Grid>
         <Grid.RowDefinitions>
             <RowDefinition Name="HeadRow" Height="40" />
             <RowDefinition Name="ToolRow" Height="40" />
             <RowDefinition Height="*" />
-            <RowDefinition Height="24" />
+            <RowDefinition Height="32" />
         </Grid.RowDefinitions>
         <!--  左边菜单按钮  -->
         <StackPanel HorizontalAlignment="Left" Orientation="Horizontal">
@@ -173,6 +72,7 @@
             x:Name="ToolTabControl"
             Grid.Row="0"
             Grid.RowSpan="2"
+            HorizontalAlignment="Center"
             VerticalAlignment="Top"
             BorderThickness="0"
             Style="{StaticResource TabControlWithUnderLineStyle}">