liuaoran 2 سال پیش
والد
کامیت
921284b1ba
22فایلهای تغییر یافته به همراه970 افزوده شده و 0 حذف شده
  1. 39 0
      PDF Office/Styles/CheckBoxStyle.xaml
  2. 95 0
      PDF Office/ViewModels/EditTools/Background/BackgroundContentViewModel.cs
  3. 92 0
      PDF Office/ViewModels/EditTools/Background/BackgroundCreateBaseContentViewModel.cs
  4. 25 0
      PDF Office/ViewModels/EditTools/Background/BackgroundCreateColorContentViewModel.cs
  5. 25 0
      PDF Office/ViewModels/EditTools/Background/BackgroundCreateFileContentViewModel.cs
  6. 92 0
      PDF Office/ViewModels/EditTools/Background/BackgroundTemplateListBaseContentViewModel.cs
  7. 25 0
      PDF Office/ViewModels/EditTools/Background/BackgroundTemplateListColorContentViewModel.cs
  8. 25 0
      PDF Office/ViewModels/EditTools/Background/BackgroundTemplateListFileContentViewModel.cs
  9. 96 0
      PDF Office/Views/EditTools/Background/BackgroundContent.xaml
  10. 15 0
      PDF Office/Views/EditTools/Background/BackgroundContent.xaml.cs
  11. 51 0
      PDF Office/Views/EditTools/Background/BackgroundCreateBaseContent.xaml
  12. 15 0
      PDF Office/Views/EditTools/Background/BackgroundCreateBaseContent.xaml.cs
  13. 120 0
      PDF Office/Views/EditTools/Background/BackgroundCreateColorContent.xaml
  14. 15 0
      PDF Office/Views/EditTools/Background/BackgroundCreateColorContent.xaml.cs
  15. 107 0
      PDF Office/Views/EditTools/Background/BackgroundCreateFileContent.xaml
  16. 15 0
      PDF Office/Views/EditTools/Background/BackgroundCreateFileContent.xaml.cs
  17. 45 0
      PDF Office/Views/EditTools/Background/BackgroundTemplateListBaseContent.xaml
  18. 15 0
      PDF Office/Views/EditTools/Background/BackgroundTemplateListBaseContent.xaml.cs
  19. 14 0
      PDF Office/Views/EditTools/Background/BackgroundTemplateListColorContent.xaml
  20. 15 0
      PDF Office/Views/EditTools/Background/BackgroundTemplateListColorContent.xaml.cs
  21. 14 0
      PDF Office/Views/EditTools/Background/BackgroundTemplateListFileContent.xaml
  22. 15 0
      PDF Office/Views/EditTools/Background/BackgroundTemplateListFileContent.xaml.cs

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

@@ -0,0 +1,39 @@
+<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
+    <Style x:Key="CheckBoxStyle" TargetType="{x:Type CheckBox}">
+        <Setter Property="SnapsToDevicePixels" Value="true" />
+        <Setter Property="OverridesDefaultStyle" Value="False" />
+     
+        <Setter Property="Height" Value="22"/>
+        <Setter Property="IsChecked" Value="False"/>
+        <Setter Property="Template">
+            <Setter.Value>
+                <ControlTemplate TargetType="CheckBox">
+                    <Grid>
+                        <Grid.ColumnDefinitions>
+                            <ColumnDefinition Width="Auto"/>
+                            <ColumnDefinition Width="*"/>
+                        </Grid.ColumnDefinitions>
+                        <Grid Height="{TemplateBinding Height}" Width="{TemplateBinding Height}">
+                            <Rectangle x:Name="CheckBoxRectangle" Fill="White" Opacity="0.3" RadiusY="2" RadiusX="2"/>
+                            <Rectangle x:Name="CheckBoxRectangleOut" Stroke="Black" StrokeThickness="1" RadiusY="2" RadiusX="1"/>
+                            <Grid x:Name="CheckedMark" Width="20" Height="20" Visibility="Collapsed">
+                                <Path SnapsToDevicePixels="False" StrokeThickness="3" Data="M1,9 L10,17" Stroke="White"/>
+                                <Path SnapsToDevicePixels="False" StrokeThickness="3" Data="M8,17 L20,4" Stroke="White"/>
+                            </Grid>
+                        </Grid>
+                        <TextBlock Grid.Column="1" FontSize="18" Foreground="Black" VerticalAlignment="Center" Margin="14,0,0,0" Text="{Binding Content,RelativeSource={RelativeSource TemplatedParent}}"/>
+                    </Grid>
+                    <ControlTemplate.Triggers>
+                        <Trigger Property="IsChecked" Value="True">
+                            <Setter TargetName="CheckedMark" Property="Visibility" Value="Visible"></Setter>
+                            <Setter TargetName="CheckBoxRectangle" Property="Fill" Value="#FF00A8E0"></Setter>
+                            <Setter TargetName="CheckBoxRectangle" Property="Opacity" Value="1"></Setter>
+                            <Setter TargetName="CheckBoxRectangleOut" Property="Stroke" Value="Transparent"></Setter>
+                        </Trigger>
+                    </ControlTemplate.Triggers>
+                </ControlTemplate>
+            </Setter.Value>
+        </Setter>
+    </Style>
+</ResourceDictionary>

+ 95 - 0
PDF Office/ViewModels/EditTools/Background/BackgroundContentViewModel.cs

@@ -0,0 +1,95 @@
+using Dropbox.Api.Sharing;
+using PDF_Office.EventAggregators;
+using Prism.Commands;
+using Prism.Events;
+using Prism.Mvvm;
+using Prism.Regions;
+using System;
+using System.Windows;
+using System.Linq;
+using System.Windows.Controls;
+using Visibility = System.Windows.Visibility;
+using Dropbox.Api.FileProperties;
+
+namespace PDF_Office.ViewModels.EditTools.Background
+{
+    public class BackgroundContentViewModel : BindableBase,INavigationAware
+    {
+        public IEventAggregator eventAggregator;
+        public IRegionManager backgroundRegion;
+
+        public string TemplateListName = "BackgroundTemplateListBaseContent";
+        public string CreateName = "BackgroundCreateBaseContent";
+
+        private string _backgroundSettingsRegionName;
+        public string BackgroundSettingsRegionName
+        {
+            get { return _backgroundSettingsRegionName; }
+            set { _backgroundSettingsRegionName = value;}
+        }
+
+        private Visibility _backgroundSettingsVisible = Visibility.Collapsed;
+        public Visibility BackgroundSettingsVisible
+        {
+            get { return _backgroundSettingsVisible; }
+            set { _backgroundSettingsVisible = value; }
+        }
+
+        /// <summary>
+        /// 退出EditTool
+        /// </summary>
+        public DelegateCommand CloseEditToolCommand { get; set; }
+
+        public DelegateCommand<string> EnterSelectedContentCommand { get; set; }
+
+        public BackgroundContentViewModel( IRegionManager regionManager, IEventAggregator eventAggregator)
+        {
+            this.eventAggregator = eventAggregator;
+            this.backgroundRegion = regionManager;
+            BackgroundSettingsVisible = Visibility.Visible;
+            BackgroundSettingsRegionName = Guid.NewGuid().ToString();
+
+            CloseEditToolCommand = new DelegateCommand(CloseEditTool);
+            EnterSelectedContentCommand = new DelegateCommand<string>(EnterSelectedContent);
+
+            eventAggregator.GetEvent<EnterTemplateListOrCreateEvent>().Subscribe(EnterTemplateListOrCreate);
+        }
+
+        public void CloseEditTool()
+        {  
+                this.eventAggregator.GetEvent<CloseEditToolEvent>().Publish();
+        }
+
+        public void EnterTemplateListOrCreate(EnumTemplateListOrCreate enumTemplateListOrCreate)
+        {
+            if(enumTemplateListOrCreate == EnumTemplateListOrCreate.StatusTemplate)
+            {
+                EnterSelectedContent(TemplateListName);
+            }
+            else
+            {
+                EnterSelectedContent(CreateName);
+            }
+        }
+
+        public void EnterSelectedContent(string SelectedContentName)
+        {
+            backgroundRegion.RequestNavigate(BackgroundSettingsRegionName, SelectedContentName);
+            BackgroundSettingsVisible = Visibility.Visible;
+        }
+
+        public void OnNavigatedTo(NavigationContext navigationContext)
+        {
+            EnterSelectedContent(TemplateListName);
+        }
+
+        public bool IsNavigationTarget(NavigationContext navigationContext)
+        {
+            return true;
+        }
+
+        public void OnNavigatedFrom(NavigationContext navigationContext)
+        {
+        }
+    }
+}

+ 92 - 0
PDF Office/ViewModels/EditTools/Background/BackgroundCreateBaseContentViewModel.cs

@@ -0,0 +1,92 @@
+using PDF_Office.EventAggregators;
+using Prism.Commands;
+using Prism.Events;
+using Prism.Mvvm;
+using Prism.Regions;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows.Controls;
+
+namespace PDF_Office.ViewModels.EditTools.Background
+{
+    public class BackgroundCreateBaseContentViewModel : BindableBase, INavigationAware
+    {
+        IEventAggregator eventAggregator;
+        IRegionManager backgroundCreateRegion;
+
+
+        private string backgroundCreateRegionName;
+
+        public string BackgroundCreateRegionName
+        {
+            get => backgroundCreateRegionName;
+            set => SetProperty(ref backgroundCreateRegionName, value);
+        }
+
+        private string _currentCreateName;
+        public string CurrentCreateName
+        {
+            get => _currentCreateName;
+            set=>_currentCreateName= value;
+        }
+
+
+        private System.Windows.Visibility backgroundCreateVisible;
+        public System.Windows.Visibility BackgroundCreateVisible
+        {
+            get => backgroundCreateVisible;
+            set => SetProperty(ref backgroundCreateVisible, value);
+        }
+
+        public DelegateCommand<object> ChangeCreateModCommand { get; set; }
+        public DelegateCommand EnterTemplateListCommand { get; set; }
+
+
+        public BackgroundCreateBaseContentViewModel(IRegionManager regionManager,IEventAggregator eventAggregator)
+        {
+            this.eventAggregator = eventAggregator;
+            this.backgroundCreateRegion = regionManager;
+            BackgroundCreateRegionName = Guid.NewGuid().ToString();
+            ChangeCreateModCommand = new DelegateCommand<object>(ChangeCreateMod);
+            EnterTemplateListCommand = new DelegateCommand(EnterTemplateList);
+            EnterSelectedCreateMod("BackgroundCreateColorContent");
+        }
+
+        public void EnterTemplateList()
+        {
+            this.eventAggregator.GetEvent<EnterTemplateListOrCreateEvent>().Publish(EnumTemplateListOrCreate.StatusTemplate);
+        }
+
+        public void EnterSelectedCreateMod(string currentCreateName)
+        {
+            backgroundCreateRegion.RequestNavigate(BackgroundCreateRegionName, currentCreateName);
+            backgroundCreateVisible = System.Windows.Visibility.Visible;
+        }
+
+        public void ChangeCreateMod(object e)
+        {
+            var args = e as Button;
+            if (args != null)
+            {
+                CurrentCreateName = args.Name;
+                EnterSelectedCreateMod(CurrentCreateName);
+            }
+        }
+
+        public bool IsNavigationTarget(NavigationContext navigationContext)
+        {
+            return true;
+        }
+
+        public void OnNavigatedFrom(NavigationContext navigationContext)
+        {
+        }
+
+        public void OnNavigatedTo(NavigationContext navigationContext)
+        {
+        }
+    }
+}

+ 25 - 0
PDF Office/ViewModels/EditTools/Background/BackgroundCreateColorContentViewModel.cs

@@ -0,0 +1,25 @@
+using Prism.Regions;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace PDF_Office.ViewModels.EditTools.Background
+{
+    internal class BackgroundCreateColorContentViewModel : INavigationAware
+    {
+        public bool IsNavigationTarget(NavigationContext navigationContext)
+        {
+            return true;
+        }
+
+        public void OnNavigatedFrom(NavigationContext navigationContext)
+        {
+        }
+
+        public void OnNavigatedTo(NavigationContext navigationContext)
+        {
+        }
+    }
+}

+ 25 - 0
PDF Office/ViewModels/EditTools/Background/BackgroundCreateFileContentViewModel.cs

@@ -0,0 +1,25 @@
+using Prism.Regions;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace PDF_Office.ViewModels.EditTools.Background
+{
+    internal class BackgroundCreateFileContentViewModel : INavigationAware
+    {
+        public bool IsNavigationTarget(NavigationContext navigationContext)
+        {
+            return true;
+        }
+
+        public void OnNavigatedFrom(NavigationContext navigationContext)
+        {
+        }
+
+        public void OnNavigatedTo(NavigationContext navigationContext)
+        {
+        }
+    }
+}

+ 92 - 0
PDF Office/ViewModels/EditTools/Background/BackgroundTemplateListBaseContentViewModel.cs

@@ -0,0 +1,92 @@
+using Dropbox.Api.FileProperties;
+using PDF_Office.EventAggregators;
+using Prism.Commands;
+using Prism.Events;
+using Prism.Mvvm;
+using Prism.Regions;
+using System;
+using System.Collections.Generic;
+using System.Drawing.Printing;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows.Controls;
+
+namespace PDF_Office.ViewModels.EditTools.Background
+{
+    public class BackgroundTemplateListBaseContentViewModel : BindableBase, INavigationAware
+    {
+        public IRegionManager backgroundTemplateListRegion;
+        private readonly IEventAggregator eventAggregator;
+
+        private string _currentTemplateListName;
+        public string CurrentTemplateListName
+        {
+            get { return _currentTemplateListName; }
+            set { _currentTemplateListName = value; }
+        }
+
+        private string backgroundTemplateListRegionName;
+
+        public string BackgroundTemplateListRegionName
+        {
+            get => backgroundTemplateListRegionName;
+            set => SetProperty(ref backgroundTemplateListRegionName, value);
+        }
+
+
+        private System.Windows.Visibility backgroundTemplateListVisible;
+        public System.Windows.Visibility BackgroundTemplateListVisible
+        {
+            get => backgroundTemplateListVisible;
+            set => SetProperty(ref backgroundTemplateListVisible, value);
+        }
+
+        public DelegateCommand<object> ChangeTemplateListModCommand { get; set; }
+        public DelegateCommand EnterCreateCommand { get; set; }
+
+        public BackgroundTemplateListBaseContentViewModel(IRegionManager backgroundTemplateListRegion, IEventAggregator eventAggregator)
+        {
+            this.backgroundTemplateListRegion = backgroundTemplateListRegion;
+            this.eventAggregator = eventAggregator;
+            BackgroundTemplateListRegionName = Guid.NewGuid().ToString();
+            ChangeTemplateListModCommand = new DelegateCommand<object>(ChangeTemplateListMod);
+            EnterCreateCommand = new DelegateCommand(EnterCreate);
+            EnterSelectedTemplateListMod("BackgroundTemplateListColorContent");
+        }
+
+        public void EnterCreate()
+        {
+            this.eventAggregator.GetEvent<EnterTemplateListOrCreateEvent>().Publish(EnumTemplateListOrCreate.StatusCreate);
+        }
+
+        public void EnterSelectedTemplateListMod(string currentTemplateListName)
+        {
+            backgroundTemplateListRegion.RequestNavigate(BackgroundTemplateListRegionName, currentTemplateListName);
+            backgroundTemplateListVisible = System.Windows.Visibility.Visible;
+        }
+
+        public void ChangeTemplateListMod(object e)
+        {
+            var args = e as Button;
+            if (args != null)
+            {
+                CurrentTemplateListName = args.Name;
+                EnterSelectedTemplateListMod(CurrentTemplateListName);
+            }
+        }
+
+        public bool IsNavigationTarget(NavigationContext navigationContext)
+        {
+            return true;
+        }
+
+        public void OnNavigatedFrom(NavigationContext navigationContext)
+        {
+        }
+
+        public void OnNavigatedTo(NavigationContext navigationContext)
+        {
+        }
+    }
+}

+ 25 - 0
PDF Office/ViewModels/EditTools/Background/BackgroundTemplateListColorContentViewModel.cs

@@ -0,0 +1,25 @@
+using Prism.Regions;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace PDF_Office.ViewModels.EditTools.Background
+{
+    internal class BackgroundTemplateListColorContentViewModel : INavigationAware
+    {
+        public bool IsNavigationTarget(NavigationContext navigationContext)
+        {
+            return true;
+        }
+
+        public void OnNavigatedFrom(NavigationContext navigationContext)
+        {
+        }
+
+        public void OnNavigatedTo(NavigationContext navigationContext)
+        {
+        }
+    }
+}

+ 25 - 0
PDF Office/ViewModels/EditTools/Background/BackgroundTemplateListFileContentViewModel.cs

@@ -0,0 +1,25 @@
+using Prism.Regions;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace PDF_Office.ViewModels.EditTools.Background
+{
+    public class BackgroundTemplateListFileContentViewModel : INavigationAware
+    {
+        public bool IsNavigationTarget(NavigationContext navigationContext)
+        {
+            return true;
+        }
+
+        public void OnNavigatedFrom(NavigationContext navigationContext)
+        {
+        }
+
+        public void OnNavigatedTo(NavigationContext navigationContext)
+        {
+        }
+    }
+}

+ 96 - 0
PDF Office/Views/EditTools/Background/BackgroundContent.xaml

@@ -0,0 +1,96 @@
+<UserControl x:Class="PDF_Office.Views.EditTools.Background.BackgroundContent"
+             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"
+             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
+             xmlns:background="clr-namespace:PDF_Office.ViewModels.EditTools.Background"
+             d:DataContext="{d:DesignInstance Type=background:BackgroundContentViewModel}"
+             mc:Ignorable="d"
+             prism:ViewModelLocator.AutoWireViewModel="True"
+             d:DesignHeight="760"
+             d:DesignWidth="1280">
+    <UserControl.Resources>
+        <ResourceDictionary>
+            <ResourceDictionary.MergedDictionaries>
+                <ResourceDictionary Source="../../../Styles/CustomBtnStyle.xaml"/>
+            </ResourceDictionary.MergedDictionaries>
+        </ResourceDictionary>
+    </UserControl.Resources>
+    <Grid>
+        <Grid.RowDefinitions>
+            <RowDefinition Height="40"></RowDefinition>
+            <RowDefinition></RowDefinition>
+        </Grid.RowDefinitions>
+        <Grid Grid.Row="0" Background="AntiqueWhite">
+            <Border x:Name="ToolsBorder" BorderBrush="#1A000000" BorderThickness="0,1,0,1" Height="40">
+                <WrapPanel HorizontalAlignment="Center" Height="40">
+                    <Button Style="{StaticResource InsideBarBtnStyle }">
+
+                        <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 }" >
+
+                        <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 }" >
+                        <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" Command="{Binding CloseEditToolCommand}"></Button>
+            </StackPanel>
+        </Grid>
+        <Grid Grid.Row="1" >
+            <Grid.ColumnDefinitions>
+                <ColumnDefinition></ColumnDefinition>
+                <ColumnDefinition Width="260"></ColumnDefinition>
+            </Grid.ColumnDefinitions>
+            <Grid Grid.Column="0" Background="BurlyWood" >
+                <Border  Height="64" Width="293" HorizontalAlignment="Center"  VerticalAlignment="Bottom"  Panel.ZIndex="1" Margin="9" Background="#323232" CornerRadius="4">
+                    <Grid>
+                        <StackPanel Orientation="Horizontal"  VerticalAlignment="Center">
+                            <StackPanel Orientation="Horizontal">
+                                <TextBlock Text="-" FontSize="20" Foreground="White" Margin="20,0,20,0"></TextBlock>
+                                <TextBlock Text="+" FontSize="20" Foreground="White" Margin="0,0,39,0"></TextBlock>
+                            </StackPanel>
+                            <StackPanel Orientation="Horizontal">
+                                <TextBlock Text="1" FontSize="20" Foreground="White" Margin="0,0,24,0"></TextBlock>
+                                <TextBlock Text="/" FontSize="20" Foreground="White" Margin="0,0,24,0"></TextBlock>
+                                <TextBlock Text="20" FontSize="20" Foreground="White" Margin="0,0,24,0"></TextBlock>
+                            </StackPanel>
+                            <StackPanel Orientation="Horizontal">
+                                <TextBlock Text="↑" FontSize="20" Foreground="White" Margin="20,0,20,0"></TextBlock>
+                                <TextBlock Text="↓" FontSize="20" Foreground="White"></TextBlock>
+                            </StackPanel>
+                        </StackPanel>
+                    </Grid>
+                </Border>
+            </Grid>
+            <Grid Grid.Column="1" Background="Wheat">
+                <ContentControl prism:RegionManager.RegionName="{Binding BackgroundSettingsRegionName}" Visibility="{Binding BackgroundSettingsVisible}"></ContentControl>
+            </Grid>
+        </Grid>
+    </Grid>
+</UserControl>
+    

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

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

+ 51 - 0
PDF Office/Views/EditTools/Background/BackgroundCreateBaseContent.xaml

@@ -0,0 +1,51 @@
+<UserControl x:Class="PDF_Office.Views.EditTools.Background.BackgroundCreateBaseContent"
+             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+             xmlns:prism="http://prismlibrary.com/"             
+             prism:ViewModelLocator.AutoWireViewModel="True"
+              xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
+             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:background="clr-namespace:PDF_Office.ViewModels.EditTools.Background" 
+             mc:Ignorable="d"
+             d:DesignHeight="720"
+             d:DesignWidth="260" >
+    <Grid>
+        <Grid.RowDefinitions>
+            <RowDefinition Height="40"></RowDefinition>
+            <RowDefinition Height="48"></RowDefinition>
+            <RowDefinition></RowDefinition>
+        </Grid.RowDefinitions>
+        <Grid Grid.Row="0">
+            <Button  Height="24" Width="90" HorizontalAlignment="Left" Margin="16,0,0,0"  Command="{Binding EnterTemplateListCommand}">
+                <StackPanel Orientation="Horizontal">
+                    <TextBlock Text="&lt;" Margin="0,0,9,0" FontSize="16"></TextBlock>
+                    <TextBlock Text="创建背景" FontSize="16"></TextBlock>
+                </StackPanel>
+            </Button>
+            <Button  Height="20" Width="64" Margin="0,0,16,0" HorizontalAlignment="Right">
+                <StackPanel>
+                <TextBlock Text="保存至模板"  Foreground="#18A0FB"></TextBlock>
+                    <Rectangle Height="1" Fill="#18A0FB"></Rectangle>
+                </StackPanel>
+            </Button>
+        </Grid>
+        <Grid Grid.Row="1" Margin="16,0,16,0">
+            <Grid.ColumnDefinitions>
+                <ColumnDefinition></ColumnDefinition>
+                <ColumnDefinition></ColumnDefinition>
+            </Grid.ColumnDefinitions>
+            <Button Name="BackgroundCreateColorContent" Grid.Column="0" Command="{Binding ChangeCreateModCommand}" CommandParameter="{Binding ElementName=BackgroundCreateColorContent}">
+                <StackPanel Orientation="Vertical"  >
+                    <TextBlock Text="颜色" FontSize="18"></TextBlock>
+                </StackPanel>
+            </Button>
+            <Button Name="BackgroundCreateFileContent" Grid.Column="1" Command="{Binding ChangeCreateModCommand}" CommandParameter="{Binding ElementName=BackgroundCreateFileContent}">
+                <StackPanel Orientation="Vertical"  >
+                    <TextBlock Text="文件" FontSize="18" VerticalAlignment="Center"></TextBlock>
+                </StackPanel>
+            </Button>
+        </Grid>
+        <Grid Grid.Row="2">
+            <ContentControl prism:RegionManager.RegionName="{Binding BackgroundCreateRegionName}" Visibility="{Binding BackgroundCreateVisible}"></ContentControl>
+        </Grid>
+    </Grid>
+</UserControl>

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

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

+ 120 - 0
PDF Office/Views/EditTools/Background/BackgroundCreateColorContent.xaml

@@ -0,0 +1,120 @@
+<UserControl x:Class="PDF_Office.Views.EditTools.Background.BackgroundCreateColorContent"
+             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+             xmlns:prism="http://prismlibrary.com/"             
+             prism:ViewModelLocator.AutoWireViewModel="True"
+               xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
+             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
+             mc:Ignorable="d"
+             d:DesignHeight="632"
+             d:DesignWidth="260">
+    <UserControl.Resources>
+        <ResourceDictionary>
+            <ResourceDictionary.MergedDictionaries>
+                <ResourceDictionary Source="../../../Styles/CheckBoxStyle.xaml"/>
+            </ResourceDictionary.MergedDictionaries>
+        </ResourceDictionary>
+    </UserControl.Resources>
+    <Grid Margin="16,0,0,0">
+        <Grid.RowDefinitions>
+            <RowDefinition Height="76"></RowDefinition>
+            <RowDefinition Height="156"></RowDefinition>
+            <RowDefinition Height="118"></RowDefinition>
+            <RowDefinition Height="76"></RowDefinition>
+            <RowDefinition></RowDefinition>
+        </Grid.RowDefinitions>
+        <Grid Grid.Row="0" >
+            <StackPanel Orientation="Vertical">
+                <TextBlock Text="背景颜色" Height="20" Width="48" HorizontalAlignment="Left" Margin="0,16,16,8" Foreground="#666666"> </TextBlock>
+                <StackPanel Orientation="Horizontal">
+                    <Button Height="32" Width="32" Margin="0,0,8,0"></Button>
+                    <Button Height="32" Width="32" Margin="0,0,8,0"></Button>
+                    <Button Height="32" Width="32" Margin="0,0,8,0"></Button>
+                    <Button Height="32" Width="32" Margin="0,0,8,0"></Button>
+                    <Button Height="32" Width="66"></Button>
+                </StackPanel>
+            </StackPanel>
+        </Grid>
+        <Grid Grid.Row="1">
+            <StackPanel Orientation="Vertical">
+                <TextBlock Text="外观" Margin="0,16,0,8" Foreground="#666666"></TextBlock>
+                <StackPanel Orientation="Horizontal">
+                    <TextBlock Height="24" Width="24" Background= "Bisque" Margin="0,0,8,0"></TextBlock>
+                    <ComboBox Height="32" Width=" 66" Margin="0,0,28,0"></ComboBox>
+                    <TextBlock Height="24" Width="24" Background="CadetBlue" Margin="0,0,8,0"></TextBlock>
+                    <ComboBox Height="32" Width=" 66"></ComboBox>
+                </StackPanel>
+                <StackPanel Orientation="Horizontal"></StackPanel>
+                <Grid Margin="0,19,0,0">
+                    <Grid.ColumnDefinitions>
+                        <ColumnDefinition  Width="30"></ColumnDefinition>
+                        <ColumnDefinition ></ColumnDefinition>
+
+                    </Grid.ColumnDefinitions>
+                    <CheckBox Grid.Column="0" Style="{StaticResource CheckBoxStyle}" Content="相对目标页面的比例" Margin="0,0,0,0" Height="22"></CheckBox>
+                    <TextBlock Grid.Column="1" Text="相对目标页面的比例" Height="22" ></TextBlock>
+                </Grid>
+                <ComboBox Height="32" Width="66" HorizontalAlignment="Left" Margin="0,11,0,0"></ComboBox>
+            </StackPanel>
+            
+        </Grid>
+        <Grid  Grid.Row="2" Margin="0,16,0,0">
+            <StackPanel>
+                <TextBlock Text="位置" FontSize="12" Foreground="#666666" Height="20" Width="24" HorizontalAlignment="Left"></TextBlock>
+                <StackPanel Orientation="Horizontal" Margin="0,8,0,0">
+                    <Grid Width="74" Height="74">
+                        <Grid.ColumnDefinitions>
+                            <ColumnDefinition></ColumnDefinition>
+                            <ColumnDefinition></ColumnDefinition>
+                            <ColumnDefinition></ColumnDefinition>
+                        </Grid.ColumnDefinitions>
+                        <Grid.RowDefinitions>
+                            <RowDefinition></RowDefinition>
+                            <RowDefinition></RowDefinition>
+                            <RowDefinition></RowDefinition>
+                        </Grid.RowDefinitions>
+                        <Button Grid.Column="0" Grid.Row="0"></Button>
+                        <Button Grid.Column="1" Grid.Row="0"></Button>
+                        <Button Grid.Column="2" Grid.Row="0"></Button>
+                        <Button Grid.Column="0" Grid.Row="1"></Button>
+                        <Button Grid.Column="1" Grid.Row="1" Background="Black"></Button>
+                        <Button Grid.Column="2" Grid.Row="1"></Button>
+                        <Button Grid.Column="0" Grid.Row="2"></Button>
+                        <Button Grid.Column="1" Grid.Row="2"></Button>
+                        <Button Grid.Column="2" Grid.Row="2"></Button>
+                    </Grid>
+                    <StackPanel Orientation="Vertical" Margin="70,0,0,0">
+                        <StackPanel Orientation="Horizontal">
+                            <TextBlock Text="X"  Width="9" Height="20" VerticalAlignment="Center"/>
+                            <TextBox Width="66" Height="32" Margin="9,0,0,0"></TextBox>
+                        </StackPanel>
+                        <StackPanel Orientation="Horizontal" Margin="0,8,0,0">
+                            <TextBlock Text="Y" Width="9" Height="20" VerticalAlignment="Center"/>
+                            <TextBox Width="66" Height="32" Margin="9,0,0,0"></TextBox>
+                        </StackPanel>
+                    </StackPanel>
+
+                </StackPanel>
+                <CheckBox Margin="0,24,0,0" >
+                    <TextBlock Text="平铺" Width="144" Height="22" FontSize="14"/>
+                </CheckBox>
+                <StackPanel Orientation="Horizontal" Margin="0,8,0,0">
+                    <StackPanel Orientation="Horizontal">
+                        <TextBlock Text="X"  Width="9" Height="20" VerticalAlignment="Center"/>
+                        <TextBox Width="66" Height="32" Margin="9,0,0,0"></TextBox>
+                    </StackPanel>
+                    <StackPanel Orientation="Horizontal" >
+                        <TextBlock Text="Y" Width="9" Height="20" VerticalAlignment="Center"/>
+                        <TextBox Width="66" Height="32" Margin="9,0,0,0"></TextBox>
+                    </StackPanel>
+                </StackPanel>
+            </StackPanel>
+        </Grid>
+        <Grid Grid.Row="3" Margin="0,16,0,0">
+            <StackPanel Orientation="Vertical">
+                <TextBlock Text="页面范围" FontSize="12" Foreground="#666666" Height="20" Width="48" HorizontalAlignment="Left"></TextBlock>
+                <ComboBox Height="32" Width="228" Margin="0,8,0,0" HorizontalAlignment="Left"></ComboBox>
+            </StackPanel>
+        </Grid>
+    </Grid>
+</UserControl>

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

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

+ 107 - 0
PDF Office/Views/EditTools/Background/BackgroundCreateFileContent.xaml

@@ -0,0 +1,107 @@
+<UserControl x:Class="PDF_Office.Views.EditTools.Background.BackgroundCreateFileContent"
+             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+             xmlns:prism="http://prismlibrary.com/"             
+             prism:ViewModelLocator.AutoWireViewModel="True"
+              xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
+             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
+             mc:Ignorable="d"
+             d:DesignHeight="632"
+             d:DesignWidth="260">
+    <UserControl.Resources>
+        <ResourceDictionary>
+            <ResourceDictionary.MergedDictionaries>
+                <ResourceDictionary Source="../../../Styles/CheckBoxStyle.xaml"/>
+            </ResourceDictionary.MergedDictionaries>
+        </ResourceDictionary>
+    </UserControl.Resources>
+    <Grid Margin="16,0,0,0">
+        <Grid.RowDefinitions>
+            <RowDefinition Height="48"></RowDefinition>
+            <RowDefinition Height="157"></RowDefinition>
+            <RowDefinition Height="163"></RowDefinition>
+            <RowDefinition Height="103"></RowDefinition>
+            <RowDefinition></RowDefinition>
+        </Grid.RowDefinitions>
+        <Grid Grid.Row="0">
+            <StackPanel Orientation="Horizontal" VerticalAlignment="Bottom">
+                <TextBox Height="32" Width="189" Margin="0,0,7,0"></TextBox>
+                <Button Height="32" Width="32"></Button>
+            </StackPanel>
+        </Grid>
+        <Grid Grid.Row="1">
+            <StackPanel Orientation="Vertical">
+                <TextBlock Text="外观" Margin="0,16,0,8" Foreground="#666666"></TextBlock>
+                <StackPanel Orientation="Horizontal">
+                    <TextBlock Height="24" Width="24" Background= "Bisque" Margin="0,0,8,0"></TextBlock>
+                    <ComboBox Height="32" Width=" 66" Margin="0,0,28,0"></ComboBox>
+                    <TextBlock Height="24" Width="24" Background="CadetBlue" Margin="0,0,8,0"></TextBlock>
+                    <ComboBox Height="32" Width=" 66"></ComboBox>
+                </StackPanel>
+                <StackPanel Orientation="Horizontal"></StackPanel>
+                <Grid Margin="0,19,0,0">
+                    <Grid.ColumnDefinitions>
+                        <ColumnDefinition  Width="30"></ColumnDefinition>
+                        <ColumnDefinition ></ColumnDefinition>
+
+                    </Grid.ColumnDefinitions>
+                    <CheckBox Grid.Column="0" Style="{StaticResource CheckBoxStyle}" Content="相对目标页面的比例" Margin="0,0,0,0" Height="22"></CheckBox>
+                    <TextBlock Grid.Column="1" Text="相对目标页面的比例" Height="22" ></TextBlock>
+                </Grid>
+                <ComboBox Height="32" Width="66" HorizontalAlignment="Left" Margin="0,11,0,0"></ComboBox>
+            </StackPanel>
+        </Grid>
+        <Grid  Grid.Row="2" Margin="0,16,0,0" VerticalAlignment="Bottom">
+            <Grid.ColumnDefinitions>
+                <ColumnDefinition Width="3*"/>
+                <ColumnDefinition Width="241*"/>
+            </Grid.ColumnDefinitions>
+            <StackPanel Grid.ColumnSpan="2">
+                <TextBlock Text="位置" FontSize="12" Foreground="#666666" Height="20" Width="24" HorizontalAlignment="Left"></TextBlock>
+                <StackPanel Orientation="Horizontal" Margin="0,8,0,0">
+                    <Grid Width="74" Height="74">
+                        <Grid.ColumnDefinitions>
+                            <ColumnDefinition></ColumnDefinition>
+                            <ColumnDefinition></ColumnDefinition>
+                            <ColumnDefinition></ColumnDefinition>
+                        </Grid.ColumnDefinitions>
+                        <Grid.RowDefinitions>
+                            <RowDefinition></RowDefinition>
+                            <RowDefinition></RowDefinition>
+                            <RowDefinition></RowDefinition>
+                        </Grid.RowDefinitions>
+                        <Button Grid.Column="0" Grid.Row="0"></Button>
+                        <Button Grid.Column="1" Grid.Row="0"></Button>
+                        <Button Grid.Column="2" Grid.Row="0"></Button>
+                        <Button Grid.Column="0" Grid.Row="1"></Button>
+                        <Button Grid.Column="1" Grid.Row="1" Background="Black"></Button>
+                        <Button Grid.Column="2" Grid.Row="1"></Button>
+                        <Button Grid.Column="0" Grid.Row="2"></Button>
+                        <Button Grid.Column="1" Grid.Row="2"></Button>
+                        <Button Grid.Column="2" Grid.Row="2"></Button>
+                    </Grid>
+                    <StackPanel Orientation="Vertical" Margin="70,0,0,0">
+                        <StackPanel Orientation="Horizontal">
+                            <TextBlock Text="X"  Width="9" Height="20" VerticalAlignment="Center"/>
+                            <TextBox Width="66" Height="32" Margin="9,0,0,0"></TextBox>
+                        </StackPanel>
+                        <StackPanel Orientation="Horizontal" Margin="0,8,0,0">
+                            <TextBlock Text="Y" Width="9" Height="20" VerticalAlignment="Center"/>
+                            <TextBox Width="66" Height="32" Margin="9,0,0,0"></TextBox>
+                        </StackPanel>
+                    </StackPanel>
+
+                </StackPanel>
+
+
+            </StackPanel>
+        </Grid>
+
+        <Grid Grid.Row="3" Margin="0,16,0,0" VerticalAlignment="Bottom">
+            <StackPanel Orientation="Vertical">
+                <TextBlock Text="页面范围" FontSize="12" Foreground="#666666" Height="20" Width="48" HorizontalAlignment="Left"></TextBlock>
+                <ComboBox Height="32" Width="228" Margin="0,8,0,0" HorizontalAlignment="Left"></ComboBox>
+            </StackPanel>
+        </Grid>
+    </Grid>
+</UserControl>

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

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

+ 45 - 0
PDF Office/Views/EditTools/Background/BackgroundTemplateListBaseContent.xaml

@@ -0,0 +1,45 @@
+<UserControl x:Class="PDF_Office.Views.EditTools.Background.BackgroundTemplateListBaseContent"
+             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+             xmlns:prism="http://prismlibrary.com/"             
+             prism:ViewModelLocator.AutoWireViewModel="True"
+              xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
+             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:background="clr-namespace:PDF_Office.ViewModels.EditTools.Background" d:DataContext="{d:DesignInstance Type=background:BackgroundTemplateListBaseContentViewModel}"
+             mc:Ignorable="d"
+             d:DesignHeight="720"
+             d:DesignWidth="260" >
+    <Grid>
+        <Grid.RowDefinitions>
+            <RowDefinition Height="40"></RowDefinition>
+            <RowDefinition Height="48"></RowDefinition>
+            <RowDefinition></RowDefinition>
+        </Grid.RowDefinitions>
+        <Grid Grid.Row="0">
+            <TextBlock Width="32" Height="24" Text="背景" FontSize="16" Margin="16,0,16,0" HorizontalAlignment="Left"></TextBlock>
+            <StackPanel Orientation="Horizontal" HorizontalAlignment="Right">
+                <Button  Height="20" Width="20"></Button>
+                <Button  Height="20" Width="20" Margin="16,0,16,0" Command="{Binding EnterCreateCommand}"></Button>
+            </StackPanel>
+        </Grid>
+        <Grid Grid.Row="1" Margin="16,0,16,0">
+            <Grid.ColumnDefinitions>
+                <ColumnDefinition></ColumnDefinition>
+                <ColumnDefinition></ColumnDefinition>
+            </Grid.ColumnDefinitions>
+            <Button x:Name="BackgroundTemplateListColorContent" Grid.Column="0"  Command="{Binding ChangeTemplateListModCommand}" CommandParameter="{Binding ElementName=BackgroundTemplateListColorContent}">
+                <StackPanel Orientation="Vertical"  >
+                        <TextBlock Text="颜色" FontSize="18"></TextBlock>
+                </StackPanel>
+
+            </Button>
+            <Button Grid.Column="1"  x:Name="BackgroundTemplateListFileContent"  Command="{Binding ChangeTemplateListModCommand}" CommandParameter="{Binding ElementName=BackgroundTemplateListFileContent}">
+                <StackPanel Orientation="Vertical"  >
+                        <TextBlock Text="文件" FontSize="18" VerticalAlignment="Center"></TextBlock>
+                </StackPanel>
+            </Button>
+        </Grid>
+        <Grid Grid.Row="2">
+            <ContentControl prism:RegionManager.RegionName="{Binding BackgroundTemplateListRegionName}" Visibility="{Binding BackgroundTemplateListVisible}"></ContentControl>
+        </Grid>
+    </Grid>
+</UserControl>

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

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

+ 14 - 0
PDF Office/Views/EditTools/Background/BackgroundTemplateListColorContent.xaml

@@ -0,0 +1,14 @@
+<UserControl x:Class="PDF_Office.Views.EditTools.Background.BackgroundTemplateListColorContent"
+             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+             xmlns:prism="http://prismlibrary.com/"             
+             prism:ViewModelLocator.AutoWireViewModel="True"
+               xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
+             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
+             mc:Ignorable="d"
+             d:DesignHeight="720"
+             d:DesignWidth="260">
+    <Grid Background="ForestGreen">
+            
+    </Grid>
+</UserControl>

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

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

+ 14 - 0
PDF Office/Views/EditTools/Background/BackgroundTemplateListFileContent.xaml

@@ -0,0 +1,14 @@
+<UserControl x:Class="PDF_Office.Views.EditTools.Background.BackgroundTemplateListFileContent"
+             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+             xmlns:prism="http://prismlibrary.com/"             
+             prism:ViewModelLocator.AutoWireViewModel="True" 
+             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
+             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
+             mc:Ignorable="d"
+             d:DesignHeight="632"
+             d:DesignWidth="260">
+    <Grid Background="CornflowerBlue">
+            
+    </Grid>
+</UserControl>

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

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