liuaoran 2 سال پیش
والد
کامیت
a60f57134f

+ 13 - 0
PDF Office/EventAggregators/EditToolsEvent.cs

@@ -0,0 +1,13 @@
+using Prism.Events;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace PDF_Office.EventAggregators
+{
+    public class EditToolsEvent:PubSubEvent<string>
+    {
+    }
+}

+ 17 - 1
PDF Office/PDF Office.csproj

@@ -210,6 +210,7 @@
     </Compile>
     <Compile Include="DataConvert\FileFormatToIconConvert.cs" />
     <Compile Include="DataConvert\UnVisivleConvert.cs" />
+    <Compile Include="EventAggregators\EditToolsEvent.cs" />
     <Compile Include="EventAggregators\PageEditNotifyEvent.cs" />
     <Compile Include="EventAggregators\PageEditRefreshEvent.cs" />
     <Compile Include="Helper\ConverterHelper.cs" />
@@ -264,6 +265,8 @@
       <DesignTime>True</DesignTime>
       <AutoGen>True</AutoGen>
     </Compile>
+    <Compile Include="ViewModels\EditTools\Background\BackgroundBarContentViewModel.cs" />
+    <Compile Include="ViewModels\EditTools\Background\BackgroundTemplateContentViewModel.cs" />
     <Compile Include="ViewModels\BOTA\BOTAContentViewModel.cs" />
     <Compile Include="ViewModels\BottomToolContentViewModel.cs" />
     <Compile Include="ViewModels\Dialog\ConverterDialogs\ConverterProgressBarDialogViewModel.cs" />
@@ -416,6 +419,12 @@
     <Compile Include="Views\Dialog\VerifyPassWordDialog.xaml.cs">
       <DependentUpon>VerifyPassWordDialog.xaml</DependentUpon>
     </Compile>
+    <Compile Include="Views\EditTools\Background\BackgroundBarContent.xaml.cs">
+      <DependentUpon>BackgroundBarContent.xaml</DependentUpon>
+    </Compile>
+    <Compile Include="Views\EditTools\Background\BackgroundTemplateContent.xaml.cs">
+      <DependentUpon>BackgroundTemplateContent.xaml</DependentUpon>
+    </Compile>
     <Compile Include="Views\HomePanel\CloudDrive\CloudDriveContent.xaml.cs">
       <DependentUpon>CloudDriveContent.xaml</DependentUpon>
     </Compile>
@@ -671,6 +680,14 @@
       <SubType>Designer</SubType>
       <Generator>MSBuild:Compile</Generator>
     </Page>
+    <Page Include="Views\EditTools\Background\BackgroundBarContent.xaml">
+      <SubType>Designer</SubType>
+      <Generator>MSBuild:Compile</Generator>
+    </Page>
+    <Page Include="Views\EditTools\Background\BackgroundTemplateContent.xaml">
+      <SubType>Designer</SubType>
+      <Generator>MSBuild:Compile</Generator>
+    </Page>
     <Page Include="Views\HomeContent.xaml">
       <Generator>MSBuild:Compile</Generator>
       <SubType>Designer</SubType>
@@ -792,7 +809,6 @@
     <None Include="App.config" />
   </ItemGroup>
   <ItemGroup>
-    <Folder Include="Views\Edit\" />
     <Folder Include="Views\FillAndSign\" />
     <Folder Include="Views\Forms\" />
     <Folder Include="Views\Scan\" />

+ 16 - 0
PDF Office/ViewModels/EditTools/Background/BackgroundBarContentViewModel.cs

@@ -0,0 +1,16 @@
+using Prism.Commands;
+using Prism.Mvvm;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+
+namespace PDF_Office.ViewModels
+{
+    public class BackgroundBarContentViewModel : BindableBase
+    {
+        public BackgroundBarContentViewModel()
+        {
+
+        }
+    }
+}

+ 16 - 0
PDF Office/ViewModels/EditTools/Background/BackgroundTemplateContentViewModel.cs

@@ -0,0 +1,16 @@
+using Prism.Commands;
+using Prism.Mvvm;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+
+namespace PDF_Office.ViewModels
+{
+    public class BackgroundTemplateContentViewModel : BindableBase
+    {
+        public BackgroundTemplateContentViewModel()
+        {
+
+        }
+    }
+}

+ 14 - 2
PDF Office/ViewModels/Tools/ToolsBarContentViewModel.cs

@@ -1,6 +1,8 @@
 using ComPDFKitViewer.PdfViewer;
+using PDF_Office.EventAggregators;
 using PDF_Office.Model;
 using Prism.Commands;
+using Prism.Events;
 using Prism.Mvvm;
 using Prism.Regions;
 using Prism.Services.Dialogs;
@@ -19,6 +21,8 @@ namespace PDF_Office.ViewModels.Tools
 
         public IDialogService dialogs;
 
+        public IEventAggregator eventAggregator;
+
         /// <summary>
         /// 是否是第一次加载
         /// </summary>
@@ -30,13 +34,21 @@ namespace PDF_Office.ViewModels.Tools
 
         public DelegateCommand CancelPasswordCommand { get; set; }
 
-        public ToolsBarContentViewModel(IDialogService dialogService)
+        public DelegateCommand SetBackgroundCommand { get; set; }
+
+        public ToolsBarContentViewModel(IDialogService dialogService, IEventAggregator eventAggregator)
         {
             dialogs= dialogService;
-
+            this.eventAggregator= eventAggregator;
             CompressCommand = new DelegateCommand(OpenCompressDialog);
             SetPasswordCommand = new DelegateCommand(OpenSetPasswordDialog);
             CancelPasswordCommand = new DelegateCommand(OpenCancelPasswordDialog);
+            SetBackgroundCommand = new DelegateCommand(SetBackground);
+        }
+
+        private void SetBackground()
+        {
+            this.eventAggregator.GetEvent<EditToolsEvent>().Publish("SetBackground");
         }
 
         private void OpenCompressDialog()

تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 755 - 709
PDF Office/ViewModels/ViewContentViewModel.cs


+ 56 - 0
PDF Office/Views/EditTools/Background/BackgroundBarContent.xaml

@@ -0,0 +1,56 @@
+<UserControl x:Class="PDF_Office.Views.EditTools.Background.BackgroundBarContent"
+             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+             xmlns:prism="http://prismlibrary.com/"             
+             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
+             prism:ViewModelLocator.AutoWireViewModel="True"
+                          Height="40" Width="1280">
+    <UserControl.Resources>
+        <ResourceDictionary>
+            <ResourceDictionary.MergedDictionaries>
+                <ResourceDictionary Source="../../../Styles/CustomBtnStyle.xaml"/>
+            </ResourceDictionary.MergedDictionaries>
+        </ResourceDictionary>
+    </UserControl.Resources>
+    <Grid>
+        <Border x:Name="ToolsBorder" BorderBrush="#1A000000" BorderThickness="0,1,0,1" Height="40">
+            <WrapPanel HorizontalAlignment="Center" Height="40">
+                <Button Style="{StaticResource InsideBarBtnStyle }" Command="{Binding CompressCommand}">
+
+                    <StackPanel Orientation="Horizontal" Margin="12 0 12 0">
+                        <StackPanel Margin="0,0,8,0">
+                            <Border Height="30" Width="30" Background="LightSeaGreen" ></Border>
+                        </StackPanel >
+                        <TextBlock Text="添加背景" VerticalAlignment="Center"></TextBlock>
+                    </StackPanel>
+                </Button>
+                <Button Style="{StaticResource InsideBarBtnStyle }" Command="{Binding CompressCommand}">
+
+                    <StackPanel Orientation="Horizontal" Margin="12 0 12 0">
+                        <StackPanel Margin="0,0,8,0">
+                            <Border Height="30" Width="30" Background="LightSeaGreen" ></Border>
+                        </StackPanel >
+                        <TextBlock Text="移除" VerticalAlignment="Center"></TextBlock>
+                    </StackPanel>
+                </Button>
+
+                <Label Height="10" Width="1" Background="LightGray"></Label>
+                
+                <Button Style="{StaticResource InsideBarBtnStyle }" Command="{Binding CompressCommand}">
+                    <StackPanel Orientation="Horizontal" Margin="12 0 12 0">
+                        <StackPanel Margin="0,0,8,0">
+                            <Border Height="30" Width="30" Background="LightSeaGreen" ></Border>
+                        </StackPanel >
+                        <TextBlock Text="批量" VerticalAlignment="Center"></TextBlock>
+                    </StackPanel>
+                </Button>
+            </WrapPanel>
+        </Border>
+        <StackPanel HorizontalAlignment="Right" Orientation="Horizontal">
+            <Button Content="应用" Height="24" Width="44"></Button>
+            <Button Content="关闭" Height="24" Width="44" Margin="16,0,16,0"></Button>
+        </StackPanel>
+    </Grid>
+    
+</UserControl>
+

+ 15 - 0
PDF Office/Views/EditTools/Background/BackgroundBarContent.xaml.cs

@@ -0,0 +1,15 @@
+using System.Windows.Controls;
+
+namespace PDF_Office.Views.EditTools.Background
+{
+    /// <summary>
+    /// Interaction logic for BackgroundBarContent
+    /// </summary>
+    public partial class BackgroundBarContent : UserControl
+    {
+        public BackgroundBarContent()
+        {
+            InitializeComponent();
+        }
+    }
+}

+ 31 - 0
PDF Office/Views/EditTools/Background/BackgroundTemplateContent.xaml

@@ -0,0 +1,31 @@
+<UserControl x:Class="PDF_Office.Views.EditTools.Background.BackgroundTemplateContent"
+             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+             xmlns:prism="http://prismlibrary.com/"        
+             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
+             prism:ViewModelLocator.AutoWireViewModel="True"
+                 xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
+                 mc:Ignorable="d"
+             d:DesignHeight ="720"
+             d:DesignWidth ="260">
+    <Grid>
+        <Grid.RowDefinitions>
+            <RowDefinition Height="56"></RowDefinition>
+            <RowDefinition Height="32"></RowDefinition>
+            <RowDefinition></RowDefinition>
+        </Grid.RowDefinitions>
+        <Grid Grid.Row="0">
+            <StackPanel Orientation="Horizontal">
+                <TextBlock Height="32" Width="24" Margin="16" Text="背景"></TextBlock>
+            </StackPanel>
+        </Grid>
+        <Grid Grid.Row="1">
+            <StackPanel Orientation="Horizontal">
+                
+            </StackPanel>
+        </Grid>
+        <Grid Grid.Row="2" Background="AliceBlue" >
+            
+        </Grid>
+    </Grid>
+</UserControl>

+ 15 - 0
PDF Office/Views/EditTools/Background/BackgroundTemplateContent.xaml.cs

@@ -0,0 +1,15 @@
+using System.Windows.Controls;
+
+namespace PDF_Office.Views.EditTools.Background
+{
+    /// <summary>
+    /// Interaction logic for BackgroundTemplateContent
+    /// </summary>
+    public partial class BackgroundTemplateContent : UserControl
+    {
+        public BackgroundTemplateContent()
+        {
+            InitializeComponent();
+        }
+    }
+}

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

@@ -18,6 +18,6 @@
         </i:EventTrigger>
     </i:Interaction.Triggers>-->
     <Grid>
-        <ContentControl Name="ContentMain" prism:RegionManager.RegionName="{Binding MainContentRegionName}" Margin="-64,-10,64,10" />
+        <ContentControl Name="ContentMain" prism:RegionManager.RegionName="{Binding MainContentRegionName}"  />
     </Grid>
 </UserControl>

+ 2 - 2
PDF Office/Views/Tools/ToolsBarContent.xaml

@@ -1,7 +1,7 @@
 <UserControl x:Class="PDF_Office.Views.Tools.ToolsBarContent"
              xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
              xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
-             xmlns:prism="http://prismlibrary.com/"             
+             xmlns:prism="http://prismlibrary.com/" xmlns:tools="clr-namespace:PDF_Office.ViewModels.Tools" xmlns:d="http://schemas.microsoft.com/expression/blend/2008"  
              prism:ViewModelLocator.AutoWireViewModel="True">
     <UserControl.Resources>
         <ResourceDictionary>
@@ -96,7 +96,7 @@
                         </Path>
                     </StackPanel>
                 </Button>
-                <Button Style="{StaticResource InsideBarBtnStyle }" >
+                <Button Style="{StaticResource InsideBarBtnStyle }" Command="{Binding SetBackgroundCommand }">
 
                     <StackPanel Orientation="Horizontal" Margin="12 0 12 0">
                         <StackPanel Margin="0,0,8,0">

+ 12 - 3
PDF Office/Views/ViewContent.xaml

@@ -31,10 +31,11 @@
     <Grid>
         <Grid.RowDefinitions>
             <RowDefinition Name="HeadRow" Height="40" />
-            <RowDefinition Name="ToolRow" Height="40" />
+            <RowDefinition Name="ToolRow" Height="{Binding ToolRowHeight}" /> 
             <RowDefinition Height="*" />
             <RowDefinition Height="32" />
         </Grid.RowDefinitions>
+        <Grid Visibility="{Binding}">
         <!--  左边菜单按钮  -->
         <StackPanel HorizontalAlignment="Left" Orientation="Horizontal">
             <Button
@@ -136,6 +137,7 @@
                 Header="工具"
                 Style="{StaticResource TabItem_WithUnderLineStyle}">
                 <Grid Grid.Row="1" Height="40" />
+                
             </cus:IconAndTextTabItem>
             <i:Interaction.Triggers>
                 <i:EventTrigger EventName="SelectionChanged">
@@ -143,6 +145,7 @@
                 </i:EventTrigger>
             </i:Interaction.Triggers>
         </TabControl>
+        </Grid>
         <Grid Name="DocumentView" Grid.Row="2">
             <Grid.ColumnDefinitions>
                 <ColumnDefinition
@@ -156,7 +159,7 @@
                     Width="*"
                     MinWidth="200" />
                 <ColumnDefinition Width="12" />
-                <ColumnDefinition Name="PropertyColumn" Width="0" />
+                <ColumnDefinition Name="PropertyColumn"  Width="{Binding PropertyColumnWidth}" />
             </Grid.ColumnDefinitions>
             <ContentControl prism:RegionManager.RegionName="{Binding BOTARegionName}" />
             <GridSplitter
@@ -185,6 +188,12 @@
 
         <cus:LoadingControl Grid.RowSpan="3" Visibility="{Binding IsLoading}" />
 
+        <ContentControl
+        x:Name="ContentBackgroundBar"
+            Grid.Row="{Binding}"
+            
+            ></ContentControl>
+        
         <ContentControl
             Name="ContentToolsBar"
             Grid.Row="{Binding GridToolRow}"
@@ -195,7 +204,7 @@
             Grid.Row="{Binding GridToolRow}"
             prism:RegionManager.RegionName="{Binding ConverterBarContentRegionName}"
             Visibility="{Binding ConverterBarContentVisible}" />
-        
+
     </Grid>
     
 </UserControl>