liuaoran 2 lat temu
rodzic
commit
e879701eb9

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

@@ -177,6 +177,10 @@ namespace PDF_Office.EventAggregators
     {
     }
 
+    public class DeleteBackgroundEvent : PubSubEvent<EnumDeleteUnicode>
+    {
+    }
+
     public class CurrentWatermarkPDFViewerEvent : PubSubEvent<CPDFViewerUnicode>
     {
     }

+ 25 - 1
PDF Office/ViewModels/EditTools/Background/BackgroundContentViewModel.cs

@@ -14,6 +14,7 @@ using ComPDFKitViewer.PdfViewer;
 using PDF_Office.Model;
 using PDF_Office.Model.EditTools.Background;
 using PDFSettings;
+using PDF_Office.CustomControl;
 
 namespace PDF_Office.ViewModels.EditTools.Background
 {
@@ -97,7 +98,7 @@ namespace PDF_Office.ViewModels.EditTools.Background
         public DelegateCommand CloseEditToolCommand { get; set; }
         public DelegateCommand ConfirmEditToolCommand { get; set; }
         public DelegateCommand<string> EnterSelectedContentCommand { get; set; }
-
+        public DelegateCommand DeleteBackgroundCommand { get; set; }
 
         public string Unicode = null;
 
@@ -113,6 +114,7 @@ namespace PDF_Office.ViewModels.EditTools.Background
             CloseEditToolCommand = new DelegateCommand(CloseEditTool);
             ConfirmEditToolCommand = new DelegateCommand(ConfirmEditTool);
             EnterSelectedContentCommand = new DelegateCommand<string>(EnterSelectedContent);
+            DeleteBackgroundCommand = new DelegateCommand(DeleteBackground);
 
             eventAggregator.GetEvent<EnterTemplateListOrCreateEvent>().Subscribe(EnterTemplateListOrCreate, e => e.Unicode == Unicode);
             eventAggregator.GetEvent<SetCurrentCreateModEvent>().Subscribe(SetCurrentCreateMod, e => e.Unicode == Unicode);
@@ -197,6 +199,28 @@ namespace PDF_Office.ViewModels.EditTools.Background
             BackgroundSettingsVisible = Visibility.Visible;
         }
 
+        private void DeleteBackground()
+        {
+            AlertsMessage alertsMessage = new AlertsMessage();
+                alertsMessage.ShowDialog("确定要删除背景吗?", "", "取消", "删除");
+                if (alertsMessage.result == ContentResult.Ok)
+                {
+                    this.eventAggregator.GetEvent<DeleteBackgroundEvent>().Publish(new EnumDeleteUnicode
+                    {
+                        Unicode = Unicode,
+                        Status = EnumDelete.StatusDeleteAll
+                    });
+                }
+                else
+                {
+                    this.eventAggregator.GetEvent<DeleteBackgroundEvent>().Publish(new EnumDeleteUnicode
+                    {
+                        Unicode = Unicode,
+                        Status = EnumDelete.StatusCreate
+                    });
+                }
+        }
+
         public void EnterDocumentContent()
         {
             NavigationParameters param = new NavigationParameters();

+ 34 - 9
PDF Office/ViewModels/EditTools/Background/BackgroundCreateColorContentViewModel.cs

@@ -54,6 +54,27 @@ namespace PDF_Office.ViewModels.EditTools.Background
             }
         }
 
+        private string _rotationText = "0";
+        public string RotationText
+        {
+            get { return _rotationText; }
+            set
+            {
+                SetProperty(ref _rotationText, value);
+            }
+        }
+
+        private string _opacityText = "100 %";
+        public string OpacityText
+        {
+            get { return _opacityText; }
+            set
+            {
+                SetProperty(ref _opacityText, value);
+
+            }
+        }
+
         private List<string> _relativeRatioList = new List<string>();
         public List<string> RelativeRatioList
         {
@@ -227,8 +248,8 @@ namespace PDF_Office.ViewModels.EditTools.Background
 
         public void InitComponent()
         {
-            InitOpacityList();
             InitRotationList();
+            InitOpacityList();
             InitRelativeRatioList();
         }
 
@@ -290,7 +311,7 @@ namespace PDF_Office.ViewModels.EditTools.Background
             }
         }
 
-
+        
         public void ChangeColor(object e)
         {
             if (e != null)
@@ -307,7 +328,7 @@ namespace PDF_Office.ViewModels.EditTools.Background
         {
             if (backgroundItem != null)
             {
-                backgroundItem.type = backgroundInfo.BackgroundType;
+                backgroundItem.type = C_Background_Type.BG_TYPE_COLOR;
                 backgroundItem.bgColor = backgroundInfo.Color;
                 backgroundItem.horizalign = backgroundInfo.Horizalign;
                 backgroundItem.vertalign = backgroundInfo.Vertalign;
@@ -357,8 +378,8 @@ namespace PDF_Office.ViewModels.EditTools.Background
                     tempBackground.SetBackgroundType(BackgroundInfo.BackgroundType);
                     tempBackground.SetColor(BackgroundInfo.Color);
                     tempBackground.SetScale(1);
-                    tempBackground.SetRotation(BackgroundInfo.Rotation);
-                    tempBackground.SetOpacity(BackgroundInfo.Opacity);
+                    tempBackground.SetRotation((float)((BackgroundInfo.Rotation / 180) * Math.PI));
+                    tempBackground.SetOpacity((byte)((BackgroundInfo.Opacity / 100) * 255));
                     tempBackground.SetVertalign(BackgroundInfo.Vertalign);
                     tempBackground.SetHorizalign(BackgroundInfo.Horizalign);
                     tempBackground.SetXOffset(BackgroundInfo.HorizOffset);
@@ -398,7 +419,7 @@ namespace PDF_Office.ViewModels.EditTools.Background
         {
             if (backgroundItem != null)
             {
-                backgroundInfo.BackgroundType = backgroundItem.type;
+                backgroundInfo.BackgroundType = C_Background_Type.BG_TYPE_COLOR;
                 backgroundInfo.Color = backgroundItem.bgColor;
                 backgroundInfo.Horizalign = backgroundItem.horizalign;
                 backgroundInfo.Vertalign = backgroundItem.vertalign;
@@ -419,10 +440,12 @@ namespace PDF_Office.ViewModels.EditTools.Background
         {
             ConvertItemToInfo(TemplateBackgroundItem, ref BackgroundInfo);
             Color = EditToolsHelper.ConvertColor(BackgroundInfo.Color);
-            RotationValue = (int)BackgroundInfo.Rotation;
+            RotationText = BackgroundInfo.Rotation.ToString();
+            OpacityText = BackgroundInfo.Opacity.ToString();
             InitLocationButtonMatrix();
             HorizontalOffsetValue = (BackgroundInfo.HorizOffset).ToString();
             VerticalOffsetValue = (BackgroundInfo.VertOffset).ToString();
+            PageRangeSelectIndex = BackgroundInfo.PageRangeIndex;
         }
 
         public void ConfirmEditBackgroundTemplateItem(EnumColorOrFileUnicode enumColorOrFileunicode)
@@ -461,8 +484,8 @@ namespace PDF_Office.ViewModels.EditTools.Background
                         tempBackground.SetBackgroundType(BackgroundInfo.BackgroundType);
                         tempBackground.SetColor(BackgroundInfo.Color);
                         tempBackground.SetScale(1);
-                        tempBackground.SetRotation(BackgroundInfo.Rotation);
-                        tempBackground.SetOpacity(BackgroundInfo.Opacity);
+                        tempBackground.SetRotation((float)((BackgroundInfo.Rotation / 180) * Math.PI));
+                        tempBackground.SetOpacity((byte)((BackgroundInfo.Opacity / 100) * 255));
                         tempBackground.SetVertalign(BackgroundInfo.Vertalign);
                         tempBackground.SetHorizalign(BackgroundInfo.Horizalign);
                         tempBackground.SetXOffset(BackgroundInfo.HorizOffset);
@@ -507,6 +530,7 @@ namespace PDF_Office.ViewModels.EditTools.Background
                 SaveCurrentTemplate();
             }
         }
+
         public bool IsNavigationTarget(NavigationContext navigationContext)
         {
             return true;
@@ -520,6 +544,7 @@ namespace PDF_Office.ViewModels.EditTools.Background
         {
 
             navigationContext.Parameters.TryGetValue<CPDFViewer>(ParameterNames.PDFViewer, out PDFViewer);
+            EditToolsHelper.GetPageRange(PageRangeSelectIndex, PDFViewer.Document, ref BackgroundInfo.PageRange, PageRangeText);
             if (navigationContext.Parameters.TryGetValue<BackgroundItem>("BackgroundItem", out TemplateBackgroundItem))
             {
                 InitComponentBySelectedInfo();

+ 45 - 3
PDF Office/ViewModels/EditTools/Background/BackgroundCreateFileContentViewModel.cs

@@ -132,7 +132,26 @@ namespace PDF_Office.ViewModels.EditTools.Background
             }
         }
 
+        private string _rotationText = "0";
+        public string RotationText
+        {
+            get { return _rotationText; }
+            set
+            {
+                SetProperty(ref _rotationText, value);
+            }
+        }
+
+        private string _opacityText = "100 %";
+        public string OpacityText
+        {
+            get { return _opacityText; }
+            set
+            {
+                SetProperty(ref _opacityText, value);
 
+            }
+        }
 
         private ObservableDictionary<string, bool> _getLocationFromNumber = new ObservableDictionary<string, bool>();
         public ObservableDictionary<string, bool> GetLocationFromNumber
@@ -221,7 +240,7 @@ namespace PDF_Office.ViewModels.EditTools.Background
 
         private void InitRotationList()
         {
-            OpacityList.Clear();
+            RotationList.Clear();
             for (int defaultRotation = -45; defaultRotation <= 45; defaultRotation += 15)
             {
                 RotationList.Add(defaultRotation.ToString());
@@ -264,7 +283,13 @@ namespace PDF_Office.ViewModels.EditTools.Background
 
         public void InitComponentBySelectedInfo()
         {
-
+            ConvertItemToInfo(TemplateBackgroundItem, ref BackgroundInfo);
+            RotationText = BackgroundInfo.Rotation.ToString();
+            OpacityText = BackgroundInfo.Opacity.ToString();
+            InitLocationButtonMatrix();
+            HorizontalOffsetValue = (BackgroundInfo.HorizOffset).ToString();
+            VerticalOffsetValue = (BackgroundInfo.VertOffset).ToString();
+            PageRangeSelectIndex = BackgroundInfo.PageRangeIndex;
         }
 
         public void ChangeLocation(object e)
@@ -325,9 +350,26 @@ namespace PDF_Office.ViewModels.EditTools.Background
             document.Release();
         }
 
+        public void ConvertItemToInfo(BackgroundItem backgroundItem, ref BackgroundInfo backgroundInfo)
+        {
+            if (backgroundItem != null)
+            {
+                backgroundInfo.BackgroundType = C_Background_Type.BG_TYPE_IMAGE;
+                backgroundInfo.Color = backgroundItem.bgColor;
+                backgroundInfo.Horizalign = backgroundItem.horizalign;
+                backgroundInfo.Vertalign = backgroundItem.vertalign;
+                backgroundInfo.VertOffset = backgroundItem.vertOffset;
+                backgroundInfo.Horizalign = backgroundItem.horizalign;
+                backgroundInfo.Opacity = backgroundItem.opacity;
+                backgroundInfo.Rotation = backgroundItem.rotation;
+                backgroundInfo.Scale = backgroundItem.scale;
+                backgroundInfo.PageRangeIndex = backgroundItem.PageRangeIndex;
+                backgroundInfo.PageRange = backgroundItem.pageRange;
+            }
+        }
         public void ConvertInfoToItem(ref BackgroundItem backgroundItem, BackgroundInfo backgroundInfo)
         {
-            backgroundItem.type = backgroundInfo.BackgroundType;
+            backgroundItem.type =  C_Background_Type.BG_TYPE_IMAGE;
             backgroundItem.imageArray = backgroundInfo.ImageArray;
             backgroundItem.imageWidth = backgroundInfo.ImageWidth;
             backgroundItem.imageHeight = backgroundInfo.ImageHeight;

+ 29 - 9
PDF Office/ViewModels/EditTools/Background/BackgroundDocumentContentViewModel.cs

@@ -34,7 +34,8 @@ namespace PDF_Office.ViewModels.EditTools.Background
         public CPDFViewer PDFViewer;
         public CPDFDocument Document;
         private ViewContentViewModel viewContentViewModel;
-        CPDFViewer pdfViewer;
+        public EnumDelete EnumDelete = EnumDelete.StatusCreate;
+        public CPDFViewer pdfViewer;
 
         private CPDFBackground background;
         private BackgroundInfo backgroundInfo;
@@ -91,6 +92,7 @@ namespace PDF_Office.ViewModels.EditTools.Background
 
             eventAggregator.GetEvent<ConfirmEditToolsBackgroundEvent>().Subscribe(ConfirmEditToolsBackground);
             eventAggregator.GetEvent<SetBackgroundEvent>().Subscribe(SetBackground, e => e.Unicode == Unicode);
+            eventAggregator.GetEvent<DeleteBackgroundEvent>().Subscribe(DeleteBackground, e => e.Unicode == Unicode);
             ViewerRegionName = RegionNames.BackgroundViewerRegionName;
         }
 
@@ -122,20 +124,38 @@ namespace PDF_Office.ViewModels.EditTools.Background
 
         public void ConfirmEditToolsBackground()
         {
+            if (EnumDelete == EnumDelete.StatusDeleteAll)
+            {
+                PDFViewer.Document.GetBackground().Clear();
+            }
+
             if (backgroundInfo != null)
             {
                 CreateBackground(viewContentViewModel.PDFViewer.Document);
             }
+            viewContentViewModel.PDFViewer.UndoManager.CanSave = true;
+        }
+
+        public void DeleteBackground(EnumDeleteUnicode enumDeleteunicode)
+        {
+            if(enumDeleteunicode.Status == EnumDelete.StatusDeleteAll)
+            {
+                EnumDelete enumDelete = enumDeleteunicode.Status;
+                EnumDelete = enumDelete;
+                PDFViewer.Document.GetBackground().Clear();
+                PDFViewer.Document.ReleasePages();
+                PDFViewer.ReloadDocument();
+            }
         }
+        
 
         public void SetBackground(BackgroundInfoUnicode backgroundInfounicode)
         {
+            EnumDelete = EnumDelete.StatusCreate;
             BackgroundInfo backgroundInfo = backgroundInfounicode.Status;
             this.backgroundInfo = backgroundInfo;
             CreateBackground(PDFViewer.Document);
             PDFViewer.InvalidChildVisual(false);
-            PDFViewer.Document.ReleasePages();
-            PDFViewer.ReloadDocument();
         }
 
         public void CreateBackground(CPDFDocument document, bool IsNewDoc = false)
@@ -154,9 +174,9 @@ namespace PDF_Office.ViewModels.EditTools.Background
                     background.SetImage(backgroundInfo.ImageArray, backgroundInfo.ImageWidth, backgroundInfo.ImageHeight, ComPDFKit.Import.C_Scale_Type.fitCenter);
                 }
 
-                background.SetScale(1);
-                background.SetRotation(backgroundInfo.Rotation);
-                background.SetOpacity(backgroundInfo.Opacity);
+                background.SetScale((float)(backgroundInfo.Scale/100));
+                background.SetRotation((float)((backgroundInfo.Rotation / 180) * Math.PI ));
+                background.SetOpacity((byte)((backgroundInfo.Opacity / 100) * 255));
                 background.SetVertalign(backgroundInfo.Vertalign);
                 background.SetHorizalign(backgroundInfo.Horizalign);
                 background.SetXOffset(backgroundInfo.HorizOffset);
@@ -212,10 +232,10 @@ namespace PDF_Office.ViewModels.EditTools.Background
             CreateBackground(newDoc, true);
             CPDFPage newPage = newDoc.PageAtIndex(0);
             double scale = 96.0 / 72.0;
-            zoom = zoom * scale;
+            zoom = zoom * 1.5;
             Rect renderRect = new Rect(0, 0, (int)(pageSize.Width * scale), (int)(pageSize.Height * scale));
             byte[] imageArray = new byte[(int)(renderRect.Width * renderRect.Height * 4)];
-            newPage.RenderPageBitmapWithMatrix((float)zoom, renderRect, 0x00FFFFFF, imageArray, 1, true);
+            newPage.RenderPageBitmapWithMatrix(1/(float)zoom, renderRect, 0x00FFFFFF, imageArray, 1, true);
             WriteableBitmap WirteBitmap = new WriteableBitmap((int)renderRect.Width, (int)renderRect.Height, 96, 96, PixelFormats.Bgra32, null);
             WirteBitmap.WritePixels(new Int32Rect(0, 0, (int)renderRect.Width, (int)renderRect.Height), imageArray, WirteBitmap.BackBufferStride, 0);
             return WirteBitmap;
@@ -251,7 +271,7 @@ namespace PDF_Office.ViewModels.EditTools.Background
                     PDFViewer.ChangeViewMode(ViewMode.Single);
                     PDFViewer.SetMouseMode(MouseModes.Default);
                     PageRangeNumber = PDFViewer.Document.PageCount;
-                    PDFViewer.ChangeFitMode(FitMode.FitHeight);
+                    PDFViewer.Zoom(0.5);
                 }
             }
         }

+ 0 - 1
PDF Office/ViewModels/EditTools/Watermark/WatermarkContentViewModel.cs

@@ -226,7 +226,6 @@ namespace PDF_Office.ViewModels.EditTools.Watermark
                 }
             }
             else {
-
                 alertsMessage.ShowDialog("无法在本文件中找到可删除的水印。如果您看到水印,其不是使用PDF Office添加的,因此无法被检测到。", "", "取消", "确定");
             }
             

+ 0 - 1
PDF Office/ViewModels/EditTools/Watermark/WatermarkDocumentContentViewModel.cs

@@ -306,7 +306,6 @@ namespace PDF_Office.ViewModels.EditTools.Watermark
                     });
                     PageRangeNumber = PDFViewer.Document.PageCount;
                     PDFViewer.Zoom(0.5);
-
                 }
             }
         }

+ 1 - 1
PDF Office/Views/EditTools/Background/BackgroundContent.xaml

@@ -34,7 +34,7 @@
                             <TextBlock Text="添加背景" VerticalAlignment="Center"></TextBlock>
                         </StackPanel>
                     </Button>
-                    <Button Style="{StaticResource InsideBarBtnStyle }" >
+                    <Button Style="{StaticResource InsideBarBtnStyle }" Command="{Binding DeleteBackgroundCommand}">
 
                         <StackPanel Orientation="Horizontal" Margin="12 0 12 0">
                             <StackPanel Margin="0,0,8,0">

+ 4 - 4
PDF Office/Views/EditTools/Background/BackgroundCreateColorContent.xaml

@@ -56,17 +56,17 @@
                 <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>
-                    <cus:CommonWritableComboBox HorizontalAlignment="Left" Width="66" Height="32" Margin="0,0,28,0" TypeSouce="{Binding RotationList, Mode=TwoWay}" Value="{Binding RotationValue, Mode=TwoWay}" Text="0" ></cus:CommonWritableComboBox>
+                    <cus:CommonWritableComboBox HorizontalAlignment="Left" Width="66" Height="32" Margin="0,0,28,0"   Minimum="-360" Maximum="360"  TypeSouce="{Binding RotationList,Mode=TwoWay}" Value="{Binding RotationValue, Mode=TwoWay}" Text="{Binding RotationText,Mode=TwoWay}" ></cus:CommonWritableComboBox>
                     
                     <TextBlock Height="24" Width="24" Background="CadetBlue" Margin="0,0,8,0"></TextBlock>
-                    <cus:CommonWritableComboBox HorizontalAlignment="Left" Width="66" Height="32" TypeSouce="{Binding OpacityList, Mode=TwoWay}" Value="{Binding OpacityValue, Mode=TwoWay}" Text="100 %"></cus:CommonWritableComboBox>
+                    <cus:CommonWritableComboBox HorizontalAlignment="Left" Width="66" Height="32" TypeSouce="{Binding OpacityList,Mode=TwoWay}" Value="{Binding OpacityValue,Mode=TwoWay}" Text="{Binding OpacityText,Mode=TwoWay}" Loaded="CommonWritableComboBox_Loaded"></cus:CommonWritableComboBox>
                 </StackPanel>
                 <StackPanel Orientation="Horizontal"></StackPanel>
                 <Grid Margin="0,19,0,0">
 
                     <CheckBox Grid.Column="0" Style="{StaticResource EditToolsCheckBoxStyle}" Content="相对目标页面的比例" Margin="0,0,0,0" Height="22" ></CheckBox>
                 </Grid>
-                <cus:CommonWritableComboBox HorizontalAlignment="Left" Width="66" Height="32" Margin="0,11,0,0" TypeSouce="{Binding RelativeRatioList,Mode=TwoWay}" Value="{Binding RelativeRatioValue, Mode=TwoWay}" Text="50 %"></cus:CommonWritableComboBox>
+                <cus:CommonWritableComboBox HorizontalAlignment="Left" Width="66" Height="32" Margin="0,11,0,0" TypeSouce="{Binding RelativeRatioList,Mode=TwoWay}" Value="{Binding RelativeRatioValue,Mode=TwoWay}" Text="50 %"></cus:CommonWritableComboBox>
 
 
             </StackPanel>
@@ -100,7 +100,7 @@
                     <StackPanel Orientation="Vertical" Margin="70,0,0,0">
                         <StackPanel Orientation="Horizontal">
                             <TextBlock Text="X"  Width="9" Height="20" VerticalAlignment="Center"/>
-                            <cus:NumericUpDown Width="66" Height="32" Margin="9,0,0,0"  Text="{Binding HorizontalOffsetValue, Mode=TwoWay}" ></cus:NumericUpDown>
+                            <cus:NumericUpDown  Width="66" Height="32" Margin="9,0,0,0"  Text="{Binding HorizontalOffsetValue, Mode=TwoWay}" ></cus:NumericUpDown>
 
                         </StackPanel>
                         <StackPanel Orientation="Horizontal" Margin="0,8,0,0">

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

@@ -25,5 +25,10 @@ namespace PDF_Office.Views.EditTools.Background
                 data.ChangeColorCommand?.Execute(e);
             }
         }
+
+        private void CommonWritableComboBox_Loaded(object sender, System.Windows.RoutedEventArgs e)
+        {
+
+        }
     }
 }

+ 3 - 3
PDF Office/Views/EditTools/Background/BackgroundCreateFileContent.xaml

@@ -43,15 +43,15 @@
                     <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>
-                        <cus:CommonWritableComboBox HorizontalAlignment="Left" Width="66" Height="32" Margin="0,0,28,0" TypeSouce="{Binding RotationList, Mode=TwoWay}" Text="0" Value="{Binding RotationValue,Mode=TwoWay}"></cus:CommonWritableComboBox>
+                        <cus:CommonWritableComboBox HorizontalAlignment="Left" Width="66" Height="32" Margin="0,0,28,0" TypeSouce="{Binding RotationList, Mode=TwoWay}" Text="{Binding RotationText,Mode=TwoWay}" Value="{Binding RotationValue,Mode=TwoWay}"></cus:CommonWritableComboBox>
                         <TextBlock Height="24" Width="24" Background="CadetBlue" Margin="0,0,8,0"></TextBlock>
-                        <cus:CommonWritableComboBox HorizontalAlignment="Left" Width="66" Height="32" Margin="0,0,28,0" TypeSouce="{Binding OpacityList, Mode=TwoWay}" Text="100 %"  Value="{Binding OpacityValue,Mode=TwoWay}"></cus:CommonWritableComboBox>
+                        <cus:CommonWritableComboBox HorizontalAlignment="Left" Width="66" Height="32" Margin="0,0,28,0" TypeSouce="{Binding OpacityList, Mode=TwoWay}" Text="{Binding OpacityText,Mode=TwoWay}"  Value="{Binding OpacityValue,Mode=TwoWay}"></cus:CommonWritableComboBox>
                     </StackPanel>
                     <StackPanel Orientation="Horizontal"></StackPanel>
                     <Grid Margin="0,19,0,0">
                         <CheckBox Grid.Column="0" Style="{StaticResource EditToolsCheckBoxStyle}" Content="相对目标页面的比例" Margin="0,0,0,0" Height="22"></CheckBox>
                     </Grid>
-                    <cus:CommonWritableComboBox HorizontalAlignment="Left" Width="66" Height="32" Margin="0,11,28,0" TypeSouce="{Binding RotationList, Mode=TwoWay}"  Text="100 %"></cus:CommonWritableComboBox>
+                    <cus:CommonWritableComboBox HorizontalAlignment="Left" Width="66" Height="32" Margin="0,11,28,0" TypeSouce="{Binding RelativeRatioList, Mode=TwoWay}"  Text="100 %"></cus:CommonWritableComboBox>
                 </StackPanel>
             </Grid>
             <Grid  Grid.Row="1" Margin="0,16,0,0" VerticalAlignment="Bottom">

+ 11 - 2
PDF Office/Views/EditTools/Background/BackgroundDocumentContent.xaml

@@ -8,7 +8,16 @@
              mc:Ignorable="d"
              d:DesignHeight="720"
              d:DesignWidth="1020" >
-    <Grid Height="720" Width="1020">
+    <UserControl.Resources>
+        <Style TargetType="Button" x:Key="btn"> 
+            <Style.Triggers>
+                <Trigger Property="IsMouseOver" Value="True">
+                    <Setter Property="Background" Value="Transparent"></Setter>
+                </Trigger>
+            </Style.Triggers>
+        </Style>
+    </UserControl.Resources>
+    <Grid>
         <ContentControl
                 x:Name="PDFViewerContent"
                 HorizontalAlignment="Stretch"
@@ -16,7 +25,7 @@
         <Border CornerRadius="4" Background="#323232"  HorizontalAlignment="Left" VerticalAlignment="Bottom" Margin="41,0,0,25" Height="53" Width="93"  Panel.ZIndex="1" >
             <StackPanel Orientation="Horizontal" HorizontalAlignment="Center" VerticalAlignment="Center" >
                 <Grid>
-                    <Button  Name="ShowInputIndexBoxBtn" Background="Transparent" BorderThickness="0" Padding="0">
+                    <Button  Name="ShowInputIndexBoxBtn" Background="Transparent" BorderThickness="0" Padding="0" Style="{StaticResource btn}">
                         <Label  Content="{Binding CurrentPageIndex, Mode=TwoWay}" Foreground="White" FontSize="20"></Label>
                         <i:Interaction.Triggers>
                             <i:EventTrigger EventName="MouseDoubleClick">

+ 2 - 2
PDF Office/Views/EditTools/Watermark/WatermarkCreateTextContent.xaml

@@ -49,7 +49,7 @@
                 <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" TypeSouce="{Binding RotationList}" Minimum="-360" Maximum="360" Unit=" " Text="{Binding RotationText,Mode=TwoWay}" Value="{Binding RotationValue,Mode=TwoWay}"></cus:CommonWritableComboBox>
+                        <cus:CommonWritableComboBox  Width="66" Height="32" Margin="8,0,0,0" TypeSouce="{Binding RotationList,Mode=TwoWay}" Minimum="-360" Maximum="360" Unit=" " Text="{Binding RotationText,Mode=TwoWay}" Value="{Binding RotationValue,Mode=TwoWay}"></cus:CommonWritableComboBox>
                     </StackPanel>
                     <StackPanel Orientation="Horizontal" Margin="28,0,0,0">
                         <TextBlock Width="24" Height="24" Background="CadetBlue"></TextBlock>
@@ -60,7 +60,7 @@
                 <CheckBox Margin="0,11,0,0" Name="RelativeScaleCheckBox">
                     <TextBlock Text="相对于页面目标的比例" Width="144" Height="22" FontSize="14"/>
                 </CheckBox>
-                <cus:CommonWritableComboBox Width="66" Height="32" HorizontalAlignment="Left" Margin="0,9,0,0" TypeSouce="{Binding ScaleList}" IsEnabled="{Binding ElementName=RelativeScaleCheckBox,Path=IsChecked}" Text="{Binding RelativeScaleText,Mode=TwoWay}" Value="{Binding RelativeScaleValue,Mode=TwoWay}"></cus:CommonWritableComboBox>
+                <cus:CommonWritableComboBox Width="66" Height="32" HorizontalAlignment="Left" Margin="0,9,0,0" TypeSouce="{Binding ScaleList,Mode=TwoWay}" IsEnabled="{Binding ElementName=RelativeScaleCheckBox,Path=IsChecked}" Text="{Binding RelativeScaleText,Mode=TwoWay}" Value="{Binding RelativeScaleValue,Mode=TwoWay}"></cus:CommonWritableComboBox>
             </StackPanel>
         </Grid>
         <Grid  Grid.Row="2"  Margin="0,10,0,0" Width="228">

+ 19 - 19
PDF Office/Views/EditTools/Watermark/WatermarkDocumentContent.xaml

@@ -9,29 +9,29 @@
              mc:Ignorable="d"
              d:DesignHeight="720"
              d:DesignWidth="1020" >
-    <Grid Height="720" Width="1020" Background="SkyBlue">
+    <Grid Background="SkyBlue">
         <ContentControl
                 x:Name="PDFViewerContent"
                 HorizontalAlignment="Stretch"
                 prism:RegionManager.RegionName="{Binding ViewerRegionName}" />
-        <Border CornerRadius="4" Background="#323232"  HorizontalAlignment="Left" VerticalAlignment="Bottom" Margin="41,0,0,25" Height="53" Width="93"  Panel.ZIndex="1" >
-            <StackPanel Orientation="Horizontal" HorizontalAlignment="Center" VerticalAlignment="Center" >
-                <Grid>
-                    <Button  Name="ShowInputIndexBoxBtn" Background="Transparent" BorderThickness="0" Padding="0">
-                        <Label  Content="{Binding CurrentPageIndex, Mode=TwoWay}" Foreground="White" FontSize="20"></Label>
-                        <i:Interaction.Triggers>
-                            <i:EventTrigger EventName="MouseDoubleClick">
-                                <i:InvokeCommandAction Command="{Binding ShowInputIndexBoxCommand}" CommandParameter="{Binding ElementName=ShowInputIndexBoxBtn}"/>
-                            </i:EventTrigger>
-                        </i:Interaction.Triggers>
-                    </Button>
-                    <TextBox Name="CurrentPageIndexBox" Visibility="{Binding InputIndexBoxVisible}" KeyDown="CurrentPageIndexBox_KeyDown" VerticalContentAlignment="Center">
-
-                    </TextBox>
-                </Grid>
-                <TextBlock Text="/" Foreground="White" FontSize="20" VerticalAlignment="Center" Margin="2,0,2,0"></TextBlock>
-                <TextBlock  Text="{Binding PageRangeNumber, Mode=TwoWay}" FontSize="20"  Foreground="White" VerticalAlignment="Center"></TextBlock>
-            </StackPanel>
+        <Border CornerRadius="4" Background="#323232"  HorizontalAlignment="Left" VerticalAlignment="Bottom" Margin="41,0,0,25" Height="53" Width="93"  Panel.ZIndex="1" >
+            <StackPanel Orientation="Horizontal" HorizontalAlignment="Center" VerticalAlignment="Center" >
+                <Grid>
+                    <Button  Name="ShowInputIndexBoxBtn" Background="Transparent" BorderThickness="0" Padding="0">
+                        <Label  Content="{Binding CurrentPageIndex, Mode=TwoWay}" Foreground="White" FontSize="20"></Label>
+                        <i:Interaction.Triggers>
+                            <i:EventTrigger EventName="MouseDoubleClick">
+                                <i:InvokeCommandAction Command="{Binding ShowInputIndexBoxCommand}" CommandParameter="{Binding ElementName=ShowInputIndexBoxBtn}"/>
+                            </i:EventTrigger>
+                        </i:Interaction.Triggers>
+                    </Button>
+                    <TextBox Name="CurrentPageIndexBox" Visibility="{Binding InputIndexBoxVisible}" KeyDown="CurrentPageIndexBox_KeyDown" VerticalContentAlignment="Center">
+
+                    </TextBox>
+                </Grid>
+                <TextBlock Text="/" Foreground="White" FontSize="20" VerticalAlignment="Center" Margin="2,0,2,0"></TextBlock>
+                <TextBlock  Text="{Binding PageRangeNumber, Mode=TwoWay}" FontSize="20"  Foreground="White" VerticalAlignment="Center"></TextBlock>
+            </StackPanel>
         </Border>
     </Grid>
 </UserControl>