Selaa lähdekoodia

自定义控件-更新

liyijie 2 vuotta sitten
vanhempi
commit
00a5ebda76
21 muutettua tiedostoa jossa 519 lisäystä ja 215 poistoa
  1. 7 2
      PDF Office/App.xaml.cs
  2. 11 7
      PDF Office/CustomControl/CommonWritableComboBox.xaml
  3. 18 3
      PDF Office/CustomControl/CommonWritableComboBox.xaml.cs
  4. 1 2
      PDF Office/PDF Office.csproj
  5. 3 3
      PDF Office/SDKLisence.xml
  6. 95 95
      PDF Office/ViewModels/EditTools/Background/BackgroundContentViewModel.cs
  7. 63 2
      PDF Office/ViewModels/EditTools/Watermark/WatermarkContentViewModel.cs
  8. 75 3
      PDF Office/ViewModels/EditTools/Watermark/WatermarkCreateBaseContentViewModel.cs
  9. 35 1
      PDF Office/ViewModels/EditTools/Watermark/WatermarkCreateFileContentViewModel.cs
  10. 15 1
      PDF Office/ViewModels/EditTools/Watermark/WatermarkCreateTextContentViewModel.cs
  11. 75 3
      PDF Office/ViewModels/EditTools/Watermark/WatermarkTemplateListBaseContentViewModel.cs
  12. 14 1
      PDF Office/ViewModels/EditTools/Watermark/WatermarkTemplateListFileContentViewModel.cs
  13. 14 1
      PDF Office/ViewModels/EditTools/Watermark/WatermarkTemplateListTextContentViewModel.cs
  14. 0 1
      PDF Office/Views/Dialog/HomePageToolsDialogs/HomePageInsertDialog.xaml
  15. 2 1
      PDF Office/Views/EditTools/Watermark/WatermarkContent.xaml
  16. 6 6
      PDF Office/Views/EditTools/Watermark/WatermarkCreateBaseContent.xaml
  17. 72 71
      PDF Office/Views/EditTools/Watermark/WatermarkCreateFileContent.xaml
  18. 6 5
      PDF Office/Views/EditTools/Watermark/WatermarkCreateTextContent.xaml
  19. 5 5
      PDF Office/Views/EditTools/Watermark/WatermarkTemplateListBaseContent.xaml
  20. 1 1
      PDF Office/Views/EditTools/Watermark/WatermarkTemplateListFileContent.xaml
  21. 1 1
      PDF Office/Views/EditTools/Watermark/WatermarkTemplateListTextContent.xaml

+ 7 - 2
PDF Office/App.xaml.cs

@@ -33,7 +33,7 @@ using PDF_Office.Views.Dialog.HomePageToolsDialogs.HomePageBatchProcessing;
 using PDF_Office.Views.Dialog.ConverterDialogs;
 using PDF_Office.Helper;
 using PDF_Office.Views.Dialog.HomePageToolsDialogs.HomePageBatchProcessing.HomePageConverter;
-using PDF_Office.Views.EditTools.Watermark; 
+using PDF_Office.Views.EditTools.Watermark; 
 using PDF_Office.Views.EditTools.Background;
 
 namespace PDF_Office
@@ -120,13 +120,18 @@ namespace PDF_Office
             containerRegistry.RegisterForNavigation<HomePageConverterExcel>();
             containerRegistry.RegisterForNavigation<WatermarkContent>();
             containerRegistry.RegisterForNavigation<BackgroundContent>();
-            containerRegistry.RegisterForNavigation<BackgroundContent>();
             containerRegistry.RegisterForNavigation<BackgroundTemplateListBaseContent>();
             containerRegistry.RegisterForNavigation<BackgroundTemplateListColorContent>();
             containerRegistry.RegisterForNavigation<BackgroundTemplateListFileContent>();
             containerRegistry.RegisterForNavigation<BackgroundCreateBaseContent>();
             containerRegistry.RegisterForNavigation<BackgroundCreateColorContent>();
             containerRegistry.RegisterForNavigation<BackgroundCreateFileContent>();
+            containerRegistry.RegisterForNavigation<WatermarkTemplateListBaseContent>();
+            containerRegistry.RegisterForNavigation<WatermarkTemplateListTextContent>();
+            containerRegistry.RegisterForNavigation<WatermarkTemplateListFileContent>();
+            containerRegistry.RegisterForNavigation<WatermarkCreateBaseContent>();
+            containerRegistry.RegisterForNavigation<WatermarkCreateTextContent>();
+            containerRegistry.RegisterForNavigation<WatermarkCreateFileContent>();
 
             //注册弹窗
             containerRegistry.RegisterDialog<VerifyPassWordDialog>(DialogNames.VerifyPassWordDialog);

+ 11 - 7
PDF Office/CustomControl/CommonWritableComboBox.xaml

@@ -6,27 +6,31 @@
              xmlns:local="clr-namespace:PDF_Office.CustomControl"
              mc:Ignorable="d" 
               d:DesignHeight="32" d:DesignWidth="66">
+    <Border CornerRadius="1" BorderBrush="Black" BorderThickness="1,1,1,1" Panel.ZIndex="2">
     <Grid>
         <Grid.ColumnDefinitions>
             <ColumnDefinition Width="*"></ColumnDefinition>
             <ColumnDefinition Width="16"></ColumnDefinition>
         </Grid.ColumnDefinitions>
         <TextBox Name="TextBox_Num"
-                MinHeight="32"
+                MinHeight="28"
                 Grid.Column="0"
                 Padding="16,0,0,0"
                 VerticalContentAlignment="Center"
-                Background="Transparent"
+                Background="#F3F3F3"
                 BorderThickness="0"
-                FontFamily="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=local:NumericUpDown}, Path=FontFamily}"
-                FontSize="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=local:NumericUpDown}, Path=FontSize}"
-                Foreground="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=local:NumericUpDown}, Path=Foreground}"
+                FontFamily="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=local:CommonWritableComboBox}, Path=FontFamily}"
+                FontSize="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=local:CommonWritableComboBox}, Path=FontSize}"
+                Foreground="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=local:CommonWritableComboBox}, Path=Foreground}"
                 InputMethod.IsInputMethodEnabled="False"
                 PreviewTextInput="CountTextBox_PreviewTextInput"
                 Text="1"
                 TextAlignment="Left"
                 KeyDown="CurrentPage_KeyDown"
-                TextChanged="TextBox_Num_TextChanged" />
-        <ComboBox Name="ComboBox_Type" MinHeight="32" Width="16" HorizontalAlignment="Right" BorderBrush="Transparent" BorderThickness="00" Grid.Column="1" SelectionChanged="ComboBox_SelectionChanged"></ComboBox>
+                TextChanged="TextBox_Num_TextChanged"
+                 Panel.ZIndex="1"/>
+        <ComboBox Name="ComboBox_Type" MinHeight="28" MinWidth="64" HorizontalAlignment="Right" BorderThickness="00" Background="#F3F3F3" Grid.Column="0" Grid.ColumnSpan="2" SelectionChanged="ComboBox_SelectionChanged" ItemsSource="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=local:CommonWritableComboBox}, Path=TypeSouce}" Panel.ZIndex="0">
+        </ComboBox>
     </Grid>
+    </Border>
 </UserControl>

+ 18 - 3
PDF Office/CustomControl/CommonWritableComboBox.xaml.cs

@@ -14,6 +14,7 @@ using System.Windows.Media;
 using System.Windows.Media.Imaging;
 using System.Windows.Navigation;
 using System.Windows.Shapes;
+using static ImTools.ImMap;
 
 namespace PDF_Office.CustomControl
 {
@@ -33,7 +34,7 @@ namespace PDF_Office.CustomControl
         }
 
         public static readonly DependencyProperty TextProperty =
-            DependencyProperty.Register("Text", typeof(string), typeof(CommonWritableComboBox), new PropertyMetadata(""));
+            DependencyProperty.Register("Text", typeof(string), typeof(CommonWritableComboBox), new PropertyMetadata("0"));
 
 
         /// <summary>
@@ -51,11 +52,11 @@ namespace PDF_Office.CustomControl
                 else if (value < Minimum)
                 {
                     SetValue(ValueProperty, Minimum);
+                    
                 }
                 else
                 {
                     SetValue(ValueProperty, value);
-                    //TextBox_Num.Text = Value.ToString();
                 }
             }
         }
@@ -117,7 +118,7 @@ namespace PDF_Office.CustomControl
                 this.TextBox_Num.Text ="0";
             }
 
-            if (!int.TryParse(this.TextBox_Num.Text, out _)&&!int.TryParse(this.TextBox_Num.Text.Replace(Unit, ""), out _)) { this.TextBox_Num.Text = "0"; }
+            if (!int.TryParse(this.TextBox_Num.Text, out _)&&!int.TryParse(this.TextBox_Num.Text.Replace(Unit, ""), out _)) { this.TextBox_Num.Text = Text; }
             else{ 
             Text = this.TextBox_Num.Text;
             Value = int.Parse(this.TextBox_Num.Text.Replace(" ", "").Replace(Unit, ""));
@@ -140,8 +141,22 @@ namespace PDF_Office.CustomControl
         {
             if (e.Key == Key.Enter)
             {
+                if (Value > Maximum)
+                {
+                    this.TextBox_Num.Text = Maximum.ToString();
+                }
+                else if (Value < Minimum)
+                {
+                    this.TextBox_Num.Text = Minimum.ToString();
+
+                }
+                else
+                {
+                    this.TextBox_Num.Text=Value.ToString();
+                }
                 this.TextBox_Num.Text = this.TextBox_Num.Text.Replace(" " , "").Replace(Unit,"")+" "+Unit;
                 
+
             }
         }
     }

+ 1 - 2
PDF Office/PDF Office.csproj

@@ -277,7 +277,6 @@
       <DesignTime>True</DesignTime>
       <AutoGen>True</AutoGen>
     </Compile>
-    <Compile Include="ViewModels\EditTools\Background\BackgroundContentViewModel.cs" />
     <Compile Include="ViewModels\BOTA\BOTAContentViewModel.cs" />
     <Compile Include="ViewModels\BottomToolContentViewModel.cs" />
     <Compile Include="ViewModels\Dialog\ConverterDialogs\ConverterProgressBarDialogViewModel.cs" />
@@ -818,7 +817,7 @@
       <Generator>MSBuild:Compile</Generator>
     </Page>
     <Page Include="Views\EditTools\Watermark\WatermarkTemplateListTextContent.xaml">
-          <SubType>Designer</SubType>
+      <SubType>Designer</SubType>
       <Generator>MSBuild:Compile</Generator>
     </Page>
     <Page Include="Views\EditTools\Background\BackgroundCreateBaseContent.xaml">

+ 3 - 3
PDF Office/SDKLisence.xml

@@ -1,7 +1,7 @@
 <Lisences
-	  devKey = "ehrnKqkWc1XSEAWyPUt6+95GzCoLEyoKrCbsUuJkCqGmxmP5ozX4bS0R6crHItQVNTFvC5mBZ1M7QjJ6Ekdu4Daj7PM+EDLTBKbFJinK4Ri9E5E2X+a9vF5zSj0TkIscQPVnwj9ikxAFOWGIyybMwQQzwc8a4j1cGOqGXQRDMMY="
-            devSecret = "mG0c3O3Mzeu5dkZJW3gpqq9uA7o7EGQveSC38Q8TK4gQurxTxGuBlGAhs0P1mD3X3bHT+AHfcLiymaqE4DY7kTFHoPs9I3tl5ErS+BHdzHRhrp9sGpqfp0B228KI+IMTu4aGVjtYuk+Uxs/kosIBw1367/WkJ00tM7U7tttD6ccHhEu996bvBgqf8Sw8OekQKQq13VBewK5AckaDux4W7SGRhCUNWC4MItkr36JnXMD2tiFQYzMG8C66HYmRGSLh"
-          userKey = "iBPRM/Tz8b6Z1G2GQt52X7hiNCGfVYXztnPjalgrgARvqfKV6lFNH8QeScTzBRYI8GGFpwelfgh790Kd9JmL7V4adI1jCiFHUT2DLT7QucxY5Nkgys2aJItQS482Ck2G2Xf8gNgojxYxRt65o/MEzkj93foj8qIdfHagXsSorSs="
+	devKey = "sTHSivIW4YnZQavIYDLVw4vaFcN5DQTUtRGrVyv5p9aeaHX3GirG/MBxl6Wy9TJbNOwR4CU6LPjHmGe3Po3OtBCPqIRheam9+LomScw3AvoUTHFlG1134e2J4enF43WJQ6PyOnjwZqsG1kUdlBPNztkoPzDAE2pQKgZWf6V2i34="
+    devSecret = "mG0c3O3Mzeu5dkZJW3gpqq9uA7o7EGQveSC38Q8TK4gQurxTxGuBlGAhs0P1mD3X3bHT+AHfcLiymaqE4DY7kTFHoPs9I3tl5ErS+BHdzHRhrp9sGpqfp0B228KI+IMTu4aGVjtYuk+Uxs/kosIBw1367/WkJ00tM7U7tttD6cfaiHpW8pgW2aur3AxuQIBBLuJD5gcmNxTYW3KA32JLG8alfyXjKFVS3gka9bngvwfZ7GuNXybjKlmz1tnN6iVHpnbSj+xOHhWEperY4HHrSg=="
+	userKey = "iBPRM/Tz8b6Z1G2GQt52X7hiNCGfVYXztnPjalgrgARvqfKV6lFNH8QeScTzBRYI8GGFpwelfgh790Kd9JmL7V4adI1jCiFHUT2DLT7QucxY5Nkgys2aJItQS482Ck2G2Xf8gNgojxYxRt65o/MEzkj93foj8qIdfHagXsSorSs="
 	userSecret="mG0c3O3Mzeu5dkZJW3gpqq9uA7o7EGQveSC38Q8TK4ivEHOmPIqbfhpDnKKj+7Ymj2rXQvfZRmke06HMV+3tt064G64WjPW8+EbGCNZaAh1hrp9sGpqfp0B228KI+IMTu4aGVjtYuk+Uxs/kosIBw1FKJi6HYB+DuugQyaqI2prfej861QnJrU4s2T/npZK/"
 	ConverterDevKey="Eahwo7OZAYHJaCF7TJQYKSVqC62MzfBdllVXnC5BRR5BQFDKnQ1FJtCRVdug+VNg/ti+/DeA5Sq4IH2CBpQjAZst5705uk5Sz0ZwRu8Qdn9HFGwh2pG6dJEIrl7lOccoZS6+1IxgOTcTeHqYpym3NsmtbhBWE848Pvme3scpW28="
 	ConverterDevSecret="mG0c3O3Mzeu5dkZJW3gpqq9uA7o7EGQveSC38Q8TK4iccr16WMBclnQACarlyblNUvAm/S8uFbhXMvxwgBSgULSsrbuyF/SIZ3I+dl0qU8EiR4IKrcJxus3VRNu+jx8P7CGq2BlSjPVXRHBI1lV8ukpCIUGmcK+P+Z0QbYdkAHAm6NPgs2c4tp1jOFPPbnUkTtX7riDb9xRCx1YNm3/+xd96PzrVCcmtTizZP+elkr8="

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

@@ -1,95 +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)
-        {
-        }
-    }
-}
+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)
+        {
+        }
+    }
+}

+ 63 - 2
PDF Office/ViewModels/EditTools/Watermark/WatermarkContentViewModel.cs

@@ -2,27 +2,88 @@
 using Prism.Commands;
 using Prism.Events;
 using Prism.Mvvm;
+using Prism.Regions;
 using System;
 using System.Collections.Generic;
 using System.Linq;
+using System.Windows;
 
 namespace PDF_Office.ViewModels.EditTools.Watermark
 {
-    public class WatermarkContentViewModel : BindableBase
+    public class WatermarkContentViewModel : BindableBase,INavigationAware
     {
         public IEventAggregator eventAggregator;
+        public IRegionManager backgroundRegion;
+
+        public string TemplateListName = "WatermarkTemplateListBaseContent";
+        public string CreateName = "WatermarkCreateBaseContent";
+
+        private string _watermarkSettingsRegionName;
+        public string WatermarkSettingsRegionName
+        {
+            get { return _watermarkSettingsRegionName; }
+            set { _watermarkSettingsRegionName = value; }
+        }
+
+        private Visibility _watermarkSettingsVisible = Visibility.Collapsed;
+        public Visibility WatermarkSettingsVisible
+        {
+            get { return _watermarkSettingsVisible; }
+            set { _watermarkSettingsVisible = value; }
+        }
 
 
         public DelegateCommand CloseEditToolCommand { get; set; }
-        public WatermarkContentViewModel(IEventAggregator eventAggregator)
+
+        public DelegateCommand<string> EnterSelectedContentCommand { get; set; }
+        public WatermarkContentViewModel(IRegionManager regionManager, IEventAggregator eventAggregator)
         {
             this.eventAggregator = eventAggregator;
+            this.backgroundRegion = regionManager;
+            WatermarkSettingsVisible = Visibility.Visible;
+            WatermarkSettingsRegionName = 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(WatermarkSettingsRegionName, SelectedContentName);
+            WatermarkSettingsVisible = Visibility.Visible;
+        }
+
+        public void OnNavigatedTo(NavigationContext navigationContext)
+        {
+            EnterSelectedContent(TemplateListName);
+        }
+
+        public bool IsNavigationTarget(NavigationContext navigationContext)
+        {
+            return true;
+        }
+
+        public void OnNavigatedFrom(NavigationContext navigationContext)
+        {
+        }
     }
 }

+ 75 - 3
PDF Office/ViewModels/EditTools/Watermark/WatermarkCreateBaseContentViewModel.cs

@@ -1,16 +1,88 @@
-using Prism.Commands;
+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.Windows.Controls;
 
 namespace PDF_Office.ViewModels.EditTools.Watermark
 {
-    public class WatermarkCreateBaseContentViewModel : BindableBase
+    public class WatermarkCreateBaseContentViewModel : BindableBase, INavigationAware
     {
-        public WatermarkCreateBaseContentViewModel()
+        IEventAggregator eventAggregator;
+        IRegionManager watermarkCreateRegion;
+
+
+        private string watermarkCreateRegionName;
+
+        public string WatermarkCreateRegionName
+        {
+            get => watermarkCreateRegionName;
+            set => SetProperty(ref watermarkCreateRegionName, value);
+        }
+
+        private string _currentCreateName;
+        public string CurrentCreateName
+        {
+            get => _currentCreateName;
+            set => _currentCreateName = value;
+        }
+
+
+        private System.Windows.Visibility watermarkCreateVisible;
+        public System.Windows.Visibility WatermarkCreateVisible
+        {
+            get => watermarkCreateVisible;
+            set => SetProperty(ref watermarkCreateVisible, value);
+        }
+
+        public DelegateCommand<object> ChangeCreateModCommand { get; set; }
+        public DelegateCommand EnterTemplateListCommand { get; set; }
+
+        public WatermarkCreateBaseContentViewModel(IRegionManager regionManager, IEventAggregator eventAggregator)
         {
+            this.eventAggregator = eventAggregator;
+            this.watermarkCreateRegion = regionManager;
+            WatermarkCreateRegionName = Guid.NewGuid().ToString();
+            ChangeCreateModCommand = new DelegateCommand<object>(ChangeCreateMod);
+            EnterTemplateListCommand = new DelegateCommand(EnterTemplateList);
+        }
 
+        public void EnterTemplateList()
+        {
+            this.eventAggregator.GetEvent<EnterTemplateListOrCreateEvent>().Publish(EnumTemplateListOrCreate.StatusTemplate);
+        }
+
+        public void EnterSelectedCreateMod(string currentCreateName)
+        {
+            watermarkCreateRegion.RequestNavigate(WatermarkCreateRegionName, currentCreateName);
+            watermarkCreateVisible = 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)
+        {
         }
     }
 }

+ 35 - 1
PDF Office/ViewModels/EditTools/Watermark/WatermarkCreateFileContentViewModel.cs

@@ -1,16 +1,50 @@
 using Prism.Commands;
 using Prism.Mvvm;
+using Prism.Regions;
 using System;
 using System.Collections.Generic;
 using System.Linq;
 
 namespace PDF_Office.ViewModels.EditTools.Watermark
 {
-    public class WatermarkCreateFileContentViewModel : BindableBase
+    public class WatermarkCreateFileContentViewModel : BindableBase,INavigationAware
     {
+        private List<string> _opacityList = new List<string>();
+        public List<string> OpacityList
+        {
+            get { return _opacityList; }
+            set
+            {
+                SetProperty(ref _opacityList, value);
+            }
+        }
+
         public WatermarkCreateFileContentViewModel()
         {
 
         }
+
+        private void InitOpacityList()
+        {
+            OpacityList.Clear();
+            for (int temp = 0; temp < 100; temp += 10)
+            {
+                OpacityList.Add(temp.ToString() + " %");
+            }
+        }
+
+        public bool IsNavigationTarget(NavigationContext navigationContext)
+        {
+            return true;
+        }
+
+        public void OnNavigatedFrom(NavigationContext navigationContext)
+        {
+        }
+
+        public void OnNavigatedTo(NavigationContext navigationContext)
+        {
+            InitOpacityList();
+        }
     }
 }

+ 15 - 1
PDF Office/ViewModels/EditTools/Watermark/WatermarkCreateTextContentViewModel.cs

@@ -1,16 +1,30 @@
 using Prism.Commands;
 using Prism.Mvvm;
+using Prism.Regions;
 using System;
 using System.Collections.Generic;
 using System.Linq;
 
 namespace PDF_Office.ViewModels.EditTools.Watermark
 {
-    public class WatermarkCreateTextContentViewModel : BindableBase
+    public class WatermarkCreateTextContentViewModel : BindableBase,INavigationAware
     {
         public WatermarkCreateTextContentViewModel()
         {
 
         }
+
+        public bool IsNavigationTarget(NavigationContext navigationContext)
+        {
+            return true;
+        }
+
+        public void OnNavigatedFrom(NavigationContext navigationContext)
+        {
+        }
+
+        public void OnNavigatedTo(NavigationContext navigationContext)
+        {
+        }
     }
 }

+ 75 - 3
PDF Office/ViewModels/EditTools/Watermark/WatermarkTemplateListBaseContentViewModel.cs

@@ -1,16 +1,88 @@
-using Prism.Commands;
+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.Windows.Controls;
 
 namespace PDF_Office.ViewModels.EditTools.Watermark
 {
-    public class WatermarkTemplateListBaseContentViewModel : BindableBase
+    public class WatermarkTemplateListBaseContentViewModel : BindableBase, INavigationAware
     {
-        public WatermarkTemplateListBaseContentViewModel()
+        public IRegionManager watermarkTemplateListRegion;
+        private readonly IEventAggregator eventAggregator;
+
+        private string _currentTemplateListName;
+        public string CurrentTemplateListName
+        {
+            get { return _currentTemplateListName; }
+            set { _currentTemplateListName = value; }
+        }
+
+        private string watermarkTemplateListRegionName;
+
+        public string WatermarkTemplateListRegionName
+        {
+            get => watermarkTemplateListRegionName;
+            set => SetProperty(ref watermarkTemplateListRegionName, value);
+        }
+
+
+        private System.Windows.Visibility watermarkTemplateListVisible;
+        public System.Windows.Visibility WatermarkTemplateListVisible
+        {
+            get => watermarkTemplateListVisible;
+            set => SetProperty(ref watermarkTemplateListVisible, value);
+        }
+
+        public DelegateCommand<object> ChangeTemplateListModCommand { get; set; }
+        public DelegateCommand EnterCreateCommand { get; set; }
+
+        public WatermarkTemplateListBaseContentViewModel(IRegionManager watermarkTemplateListRegion, IEventAggregator eventAggregator)
+        {
+            this.watermarkTemplateListRegion = watermarkTemplateListRegion;
+            this.eventAggregator = eventAggregator;
+            WatermarkTemplateListRegionName = Guid.NewGuid().ToString();
+            ChangeTemplateListModCommand = new DelegateCommand<object>(ChangeTemplateListMod);
+            EnterCreateCommand = new DelegateCommand(EnterCreate);
+            EnterSelectedTemplateListMod("WatermarkTemplateListColorContent");
+        }
+
+        public void EnterCreate()
+        {
+            this.eventAggregator.GetEvent<EnterTemplateListOrCreateEvent>().Publish(EnumTemplateListOrCreate.StatusCreate);
+        }
+
+        public void EnterSelectedTemplateListMod(string currentTemplateListName)
         {
+            watermarkTemplateListRegion.RequestNavigate(WatermarkTemplateListRegionName, currentTemplateListName);
+            watermarkTemplateListVisible = 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)
+        {
         }
     }
 }

+ 14 - 1
PDF Office/ViewModels/EditTools/Watermark/WatermarkTemplateListFileContentViewModel.cs

@@ -1,16 +1,29 @@
 using Prism.Commands;
 using Prism.Mvvm;
+using Prism.Regions;
 using System;
 using System.Collections.Generic;
 using System.Linq;
 
 namespace PDF_Office.ViewModels.EditTools.Watermark
 {
-    public class WatermarkTemplateListFileContentViewModel : BindableBase
+    public class WatermarkTemplateListFileContentViewModel : BindableBase, INavigationAware
     {
         public WatermarkTemplateListFileContentViewModel()
         {
 
         }
+        public bool IsNavigationTarget(NavigationContext navigationContext)
+        {
+            return true;
+        }
+
+        public void OnNavigatedFrom(NavigationContext navigationContext)
+        {
+        }
+
+        public void OnNavigatedTo(NavigationContext navigationContext)
+        {
+        }
     }
 }

+ 14 - 1
PDF Office/ViewModels/EditTools/Watermark/WatermarkTemplateListTextContentViewModel.cs

@@ -1,16 +1,29 @@
 using Prism.Commands;
 using Prism.Mvvm;
+using Prism.Regions;
 using System;
 using System.Collections.Generic;
 using System.Linq;
 
 namespace PDF_Office.ViewModels.EditTools.Watermark
 {
-    public class WatermarkTemplateListTextContentViewModel : BindableBase
+    public class WatermarkTemplateListTextContentViewModel : BindableBase, INavigationAware
     {
         public WatermarkTemplateListTextContentViewModel()
         {
 
         }
+        public bool IsNavigationTarget(NavigationContext navigationContext)
+        {
+            return true;
+        }
+
+        public void OnNavigatedFrom(NavigationContext navigationContext)
+        {
+        }
+
+        public void OnNavigatedTo(NavigationContext navigationContext)
+        {
+        }
     }
 }

+ 0 - 1
PDF Office/Views/Dialog/HomePageToolsDialogs/HomePageInsertDialog.xaml

@@ -83,7 +83,6 @@
                     HorizontalAlignment="Right"
                     Command="{Binding InsertCommand}"
                     Content="插入" />
-            <cus:CommonWritableComboBox HorizontalAlignment="Left" Width="66" Height="32"></cus:CommonWritableComboBox>
         </Grid>
     </Grid>
 </UserControl>

+ 2 - 1
PDF Office/Views/EditTools/Watermark/WatermarkContent.xaml

@@ -88,7 +88,8 @@
                     </Grid>
                 </Border>
             </Grid>
-            <Grid Grid.Column="1" Background="DarkBlue">
+            <Grid Grid.Column="1" Background="#F3F3F3">
+                <ContentControl prism:RegionManager.RegionName="{Binding WatermarkSettingsRegionName}" Visibility="{Binding WatermarkSettingsVisible}"></ContentControl>
             </Grid>
         </Grid>
     </Grid>

+ 6 - 6
PDF Office/Views/EditTools/Watermark/WatermarkCreateBaseContent.xaml

@@ -15,7 +15,7 @@
             <RowDefinition></RowDefinition>
         </Grid.RowDefinitions>
         <Grid Grid.Row="0">
-            <Button  Height="24" Width="90" HorizontalAlignment="Left" Margin="16,0,0,0">
+            <Button  Height="24" Width="90" HorizontalAlignment="Left" Margin="16,0,0,0" Command="{Binding EnterTemplateListCommand}">
                 <StackPanel Orientation="Horizontal">
                     <TextBlock Text="&lt;" FontSize="16"></TextBlock>
                     <TextBlock Text="创建水印" Margin="8,0,0,0" FontSize="16"></TextBlock>
@@ -33,20 +33,20 @@
                 <ColumnDefinition></ColumnDefinition>
                 <ColumnDefinition></ColumnDefinition>
             </Grid.ColumnDefinitions>
-            <Button Grid.Column="0">
-                <StackPanel Orientation="Vertical"  >
-                    <TextBlock Text="颜色" FontSize="18"></TextBlock>
+            <Button Name="WatermarkCreateTextContent" Grid.Column="0" Command="{Binding ChangeCreateModCommand}" CommandParameter="{Binding ElementName=WatermarkCreateTextContent}">
+                <StackPanel Orientation="Vertical">
+                    <TextBlock Text="文本" FontSize="18"></TextBlock>
                 </StackPanel>
 
             </Button>
-            <Button Grid.Column="1">
+            <Button Grid.Column="1" Name="WatermarkCreateFileContent" Command="{Binding ChangeCreateModCommand}" CommandParameter="{Binding ElementName=WatermarkCreateFileContent}">
                 <StackPanel Orientation="Vertical"  >
                     <TextBlock Text="文件" FontSize="18" VerticalAlignment="Center"></TextBlock>
                 </StackPanel>
             </Button>
         </Grid>
         <Grid Grid.Row="2">
-
+            <ContentControl prism:RegionManager.RegionName="{Binding WatermarkCreateRegionName}" Visibility="{Binding WatermarkCreateVisible}"></ContentControl>
         </Grid>
     </Grid>
 </UserControl>

+ 72 - 71
PDF Office/Views/EditTools/Watermark/WatermarkCreateFileContent.xaml

@@ -4,6 +4,7 @@
              xmlns:prism="http://prismlibrary.com/"             
              prism:ViewModelLocator.AutoWireViewModel="True"
              xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
+             xmlns:cus="clr-namespace:PDF_Office.CustomControl"
              xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
              mc:Ignorable="d"
              d:DesignHeight="632"
@@ -11,7 +12,7 @@
     <Grid>
         <Grid.RowDefinitions>
             <RowDefinition Height="48"/>
-            <RowDefinition Height="464"/>
+            <RowDefinition Height="584"/>
         </Grid.RowDefinitions>
         <Grid Grid.Row="0" Width="228" Margin="0,16,0,0">
             <StackPanel Orientation="Horizontal">
@@ -21,88 +22,88 @@
         </Grid>
         <Grid Grid.Row="1" Visibility="{Binding ElementName=FileNameTextBox,Path=Text}">
             <Grid.RowDefinitions>
-                <RowDefinition Height="190"/>
+                <RowDefinition Height="197"/>
                 <RowDefinition Height="200"/>
-                <RowDefinition Height="74"/>
+                <RowDefinition Height="*"/>
             </Grid.RowDefinitions>
-            <Grid Grid.Row="0" Margin="0,23,0,0" Width="228">
-            <StackPanel Orientation="Vertical">
-                <TextBlock Text="外观" FontSize="12" Foreground="#666666" Height="20" Width="24" HorizontalAlignment="Left"></TextBlock>
-                <StackPanel Orientation="Horizontal" Margin="0,8,0,0">
-                    <StackPanel Orientation="Horizontal">
-                        <TextBlock Width="24" Height="24" Background="CadetBlue"></TextBlock>
-                        <ComboBox Width="66" Height="32" Margin="8,0,0,0"></ComboBox>
-                    </StackPanel>
-                    <StackPanel Orientation="Horizontal" Margin="28,0,0,0">
-                        <TextBlock Width="24" Height="24" Background="CadetBlue"></TextBlock>
-                        <ComboBox Width="66" Height="32" Margin="8,0,0,0"></ComboBox>
+            <Grid Grid.Row="0" Margin="16,23,16,0" Width="228">
+                <StackPanel Orientation="Vertical">
+                    <TextBlock Text="外观" FontSize="12" Foreground="#666666" Height="20" Width="24" HorizontalAlignment="Left"></TextBlock>
+                    <StackPanel Orientation="Horizontal" Margin="0,8,0,0">
+                        <StackPanel Orientation="Horizontal">
+                            <TextBlock Width="24" Height="24" Background="CadetBlue"></TextBlock>
+                            <cus:CommonWritableComboBox Width="66" Height="32" Margin="8,0,0,0"></cus:CommonWritableComboBox>
+                        </StackPanel>
+                        <StackPanel Orientation="Horizontal" Margin="28,0,0,0">
+                            <TextBlock Width="24" Height="24" Background="CadetBlue"></TextBlock>
+                            <cus:CommonWritableComboBox Width="66" Height="32" Margin="8,0,0,0" TypeSouce="{Binding OpacityList,Mode=TwoWay}"></cus:CommonWritableComboBox>
+                        </StackPanel>
                     </StackPanel>
+                    <ComboBox Height="32" Margin="0,8,0,0"></ComboBox>
+                    <CheckBox Margin="0,11,0,0" >
+                        <TextBlock Text="相对于页面目标的比例" Width="144" Height="22" FontSize="14"/>
+                    </CheckBox>
+                    <cus:CommonWritableComboBox Width="66" Height="32" HorizontalAlignment="Left" Margin="0,9,0,0"></cus:CommonWritableComboBox>
                 </StackPanel>
-                <ComboBox Height="32" Margin="0,8,0,0"></ComboBox>
-                <CheckBox Margin="0,11,0,0" >
-                    <TextBlock Text="相对于页面目标的比例" Width="144" Height="22" FontSize="14"/>
-                </CheckBox>
-                <ComboBox Width="66" Height="32" HorizontalAlignment="Left" Margin="0,9,0,0"></ComboBox>
-            </StackPanel>
-        </Grid>
-        <Grid  Grid.Row="1"  Margin="0,10,0,0" Width="228">
-            <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">
+            </Grid>
+            <Grid  Grid.Row="1"  Margin="16,10,16,0" Width="228">
+                <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"/>
+                            <TextBlock Text="" Background="Aquamarine" Width="25" Height="9" 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"/>
+                        <StackPanel Orientation="Horizontal" Margin="32,0,0,0">
+                            <TextBlock Background="AntiqueWhite" Width="9" Height="25" 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="" Background="Aquamarine" Width="25" Height="9" VerticalAlignment="Center"/>
-                        <TextBox Width="66" Height="32" Margin="9,0,0,0"></TextBox>
-                    </StackPanel>
-                    <StackPanel Orientation="Horizontal" Margin="32,0,0,0">
-                        <TextBlock Background="AntiqueWhite" Width="9" Height="25" VerticalAlignment="Center"/>
-                        <TextBox Width="66" Height="32" Margin="9,0,0,0"></TextBox>
-                    </StackPanel>
+            </Grid>
+            <Grid Width="228" Grid.Row="2"  Margin="16,10,16,4" Grid.RowSpan="2">
+                <StackPanel Orientation="Vertical">
+                    <TextBlock Text="页面范围" FontSize="12" Foreground="#666666" Height="20" Width="48" HorizontalAlignment="Left"></TextBlock>
+                    <ComboBox Height="32" Margin="0,8,0,0"></ComboBox>
                 </StackPanel>
-            </StackPanel>
-        </Grid>
-        <Grid Width="228" Grid.Row="2"  Margin="0,10,0,4">
-            <StackPanel Orientation="Vertical">
-                <TextBlock Text="页面范围" FontSize="12" Foreground="#666666" Height="20" Width="48" HorizontalAlignment="Left"></TextBlock>
-                <ComboBox Height="32" Margin="0,8,0,0"></ComboBox>
-            </StackPanel>
-        </Grid>
+            </Grid>
         </Grid>
     </Grid>
 </UserControl>

+ 6 - 5
PDF Office/Views/EditTools/Watermark/WatermarkCreateTextContent.xaml

@@ -4,6 +4,7 @@
              xmlns:prism="http://prismlibrary.com/"             
              prism:ViewModelLocator.AutoWireViewModel="True"
              xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
+             xmlns:cus="clr-namespace:PDF_Office.CustomControl"
              xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
              mc:Ignorable="d"
              d:DesignHeight="632"
@@ -13,7 +14,7 @@
             <RowDefinition Height="168"/>
             <RowDefinition Height="190"/>
             <RowDefinition Height="200"/>
-            <RowDefinition Height="74"/>
+            <RowDefinition Height="*"/>
         </Grid.RowDefinitions>
         <Grid Grid.Row="0" Width="228">
             <StackPanel Orientation="Vertical">
@@ -41,18 +42,18 @@
                 <StackPanel Orientation="Horizontal" Margin="0,8,0,0">
                     <StackPanel Orientation="Horizontal">
                         <TextBlock Width="24" Height="24" Background="CadetBlue"></TextBlock>
-                        <ComboBox Width="66" Height="32" Margin="8,0,0,0"></ComboBox>
+                        <cus:CommonWritableComboBox Width="66" Height="32" Margin="8,0,0,0"></cus:CommonWritableComboBox>
                     </StackPanel>
                     <StackPanel Orientation="Horizontal" Margin="28,0,0,0">
                         <TextBlock Width="24" Height="24" Background="CadetBlue"></TextBlock>
-                        <ComboBox Width="66" Height="32" Margin="8,0,0,0"></ComboBox>
+                        <cus:CommonWritableComboBox Width="66" Height="32" Margin="8,0,0,0"></cus:CommonWritableComboBox>
                     </StackPanel>
                 </StackPanel>
                 <ComboBox Height="32" Margin="0,8,0,0"></ComboBox>
                 <CheckBox Margin="0,11,0,0" >
                     <TextBlock Text="相对于页面目标的比例" Width="144" Height="22" FontSize="14"/>
                 </CheckBox>
-                <ComboBox Width="66" Height="32" HorizontalAlignment="Left" Margin="0,9,0,0"></ComboBox>
+                <cus:CommonWritableComboBox Width="66" Height="32" HorizontalAlignment="Left" Margin="0,9,0,0"></cus:CommonWritableComboBox>
             </StackPanel>
         </Grid>
         <Grid  Grid.Row="2"  Margin="0,10,0,0" Width="228">
@@ -107,7 +108,7 @@
                 </StackPanel>
             </StackPanel>
         </Grid>
-        <Grid Width="228" Grid.Row="4"  Margin="0,10,0,4">
+        <Grid Width="228" Grid.Row="4"  Margin="0,8,0,4">
             <StackPanel Orientation="Vertical">
                 <TextBlock Text="页面范围" FontSize="12" Foreground="#666666" Height="20" Width="24" HorizontalAlignment="Left"></TextBlock>
                 <ComboBox Height="32" Margin="0,8,0,0"></ComboBox>

+ 5 - 5
PDF Office/Views/EditTools/Watermark/WatermarkTemplateListBaseContent.xaml

@@ -18,7 +18,7 @@
                 <TextBlock Width="32" Height="24" Text="水印" FontSize="16" Margin="16,0,16,0" HorizontalAlignment="Left"></TextBlock>
                 <StackPanel HorizontalAlignment="Right" Orientation="Horizontal" >
                     <Button Height="20" Width="20"></Button>
-                    <Button Height="20" Width="20" Margin="16,0,6,0"></Button>
+                <Button Height="20" Width="20" Margin="16,0,6,0" Command="{Binding EnterCreateCommand}"></Button>
                 </StackPanel>
         </Grid>
         <Grid Grid.Row="1" Margin="16,0,16,0">
@@ -26,20 +26,20 @@
                 <ColumnDefinition></ColumnDefinition>
                 <ColumnDefinition></ColumnDefinition>
             </Grid.ColumnDefinitions>
-            <Button Grid.Column="0">
+            <Button Grid.Column="0" x:Name="WatermarkTemplateListTextContent"  Command="{Binding ChangeTemplateListModCommand}" CommandParameter="{Binding ElementName=WatermarkTemplateListTextContent}">
                 <StackPanel Orientation="Vertical"  >
-                    <TextBlock Text="颜色" FontSize="18"></TextBlock>
+                    <TextBlock Text="文本" FontSize="18"></TextBlock>
                 </StackPanel>
 
             </Button>
-            <Button Grid.Column="1">
+            <Button Grid.Column="1" x:Name="WatermarkTemplateListFileContent"  Command="{Binding ChangeTemplateListModCommand}" CommandParameter="{Binding ElementName=WatermarkTemplateListFileContent}">
                 <StackPanel Orientation="Vertical"  >
                     <TextBlock Text="文件" FontSize="18" VerticalAlignment="Center"></TextBlock>
                 </StackPanel>
             </Button>
         </Grid>
         <Grid Grid.Row="2">
-
+            <ContentControl prism:RegionManager.RegionName="{Binding WatermarkTemplateListRegionName}" Visibility="{Binding WatermarkTemplateListVisible}"></ContentControl>
         </Grid>
     </Grid>
 </UserControl>

+ 1 - 1
PDF Office/Views/EditTools/Watermark/WatermarkTemplateListFileContent.xaml

@@ -8,7 +8,7 @@
              mc:Ignorable="d"
              d:DesignHeight="632"
              d:DesignWidth="260" >
-    <Grid>
+    <Grid Background="DeepPink">
             
     </Grid>
 </UserControl>

+ 1 - 1
PDF Office/Views/EditTools/Watermark/WatermarkTemplateListTextContent.xaml

@@ -8,7 +8,7 @@
              mc:Ignorable="d"
              d:DesignHeight="632"
              d:DesignWidth="260" >
-    <Grid>
+    <Grid Background="CornflowerBlue">
             
     </Grid>
 </UserControl>