Переглянути джерело

综合-图章的部分高保真,以及对应的资源文件

zhuyi 2 роки тому
батько
коміт
476128e0e4

+ 1 - 0
PDF Office/App.xaml

@@ -22,6 +22,7 @@
                 <ResourceDictionary Source="pack://application:,,,/PDF Office;component/Styles/ContainerStyles/ComboxStyle/ComboxItemStyle.xaml" />
 
                 <ResourceDictionary Source="pack://application:,,,/PDF Office;component/Styles/PathButtonStyle.xaml" />
+                <ResourceDictionary Source="pack://application:,,,/PDF Office;component/Styles/ImageButtonStyle.xaml" />
                 <ResourceDictionary Source="pack://application:,,,/PDF Office;component/Styles/PathRadioButtonDictionary.xaml" />
                 <ResourceDictionary Source="pack://application:,,,/PDF Office;component/Styles/ImageRadioButtonDictionary.xaml" />
                 <ResourceDictionary Source="pack://application:,,,/PDF Office;component/Styles/ContextMenuTextEditStyle.xaml" />

+ 243 - 0
PDF Office/CustomControl/ImageButton.cs

@@ -0,0 +1,243 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Media;
+
+namespace PDF_Office.CustomControl
+{
+    public class ImageButton : Button
+    {
+        static ImageButton()
+        {
+            DefaultStyleKeyProperty.OverrideMetadata(typeof(ImageButton), new FrameworkPropertyMetadata(typeof(ImageButton)));
+        }
+
+        public override void OnApplyTemplate()
+        {
+            base.OnApplyTemplate();
+            if (this.MouseOverBackground == null)
+            {
+                this.MouseOverBackground = Background;
+            }
+            if (this.MouseDownBackground == null)
+            {
+                if (this.MouseOverBackground == null)
+                {
+                    this.MouseDownBackground = Background;
+                }
+                else
+                {
+                    this.MouseDownBackground = MouseOverBackground;
+                }
+            }
+            if (this.MouseOverBorderBrush == null)
+            {
+                this.MouseOverBorderBrush = BorderBrush;
+            }
+            if (this.MouseDownBorderBrush == null)
+            {
+                if (this.MouseOverBorderBrush == null)
+                {
+                    this.MouseDownBorderBrush = BorderBrush;
+                }
+                else
+                {
+                    this.MouseDownBorderBrush = MouseOverBorderBrush;
+                }
+            }
+            if (this.MouseOverForeground == null)
+            {
+                this.MouseOverForeground = Foreground;
+            }
+            if (this.MouseDownForeground == null)
+            {
+                if (this.MouseOverForeground == null)
+                {
+                    this.MouseDownForeground = Foreground;
+                }
+                else
+                {
+                    this.MouseDownForeground = this.MouseOverForeground;
+                }
+            }
+        }
+
+        #region 依赖项属性  
+
+        /// <summary>  
+        /// 鼠标移上去的背景颜色  
+        /// </summary>  
+        public static readonly DependencyProperty MouseOverBackgroundProperty
+            = DependencyProperty.Register("MouseOverBackground", typeof(Brush), typeof(ImageButton));
+
+        /// <summary>  
+        /// 鼠标按下去的背景颜色  
+        /// </summary>  
+        public static readonly DependencyProperty MouseDownBackgroundProperty
+            = DependencyProperty.Register("MouseDownBackground", typeof(Brush), typeof(ImageButton));
+
+        /// <summary>  
+        /// 鼠标移上去的字体颜色  
+        /// </summary>  
+        public static readonly DependencyProperty MouseOverForegroundProperty
+            = DependencyProperty.Register("MouseOverForeground", typeof(Brush), typeof(ImageButton), new PropertyMetadata(null, null));
+
+        /// <summary>  
+        /// 鼠标按下去的字体颜色  
+        /// </summary>  
+        public static readonly DependencyProperty MouseDownForegroundProperty
+            = DependencyProperty.Register("MouseDownForeground", typeof(Brush), typeof(ImageButton), new PropertyMetadata(null, null));
+
+        /// <summary>  
+        /// 鼠标移上去的边框颜色  
+        /// </summary>  
+        public static readonly DependencyProperty MouseOverBorderBrushProperty
+            = DependencyProperty.Register("MouseOverBorderBrush", typeof(Brush), typeof(ImageButton), new PropertyMetadata(null, null));
+
+        /// <summary>  
+        /// 鼠标按下去的边框颜色  
+        /// </summary>  
+        public static readonly DependencyProperty MouseDownBorderBrushProperty
+            = DependencyProperty.Register("MouseDownBorderBrush", typeof(Brush), typeof(ImageButton), new PropertyMetadata(null, null));
+
+        /// <summary>  
+        /// 圆角  
+        /// </summary>  
+        public static readonly DependencyProperty CornerRadiusProperty
+            = DependencyProperty.Register("CornerRadius", typeof(CornerRadius), typeof(ImageButton), null);
+
+        //图标  
+        public static readonly DependencyProperty IconProperty
+            = DependencyProperty.Register("Icon", typeof(ImageSource), typeof(ImageButton), null);
+
+        //鼠标移上去的图标图标  
+        public static readonly DependencyProperty IconMouseOverProperty
+            = DependencyProperty.Register("IconMouseOver", typeof(ImageSource), typeof(ImageButton), null);
+
+        //鼠标按下去的图标图标  
+        public static readonly DependencyProperty IconPressProperty
+            = DependencyProperty.Register("IconPress", typeof(ImageSource), typeof(ImageButton), null);
+
+        //图标高度  
+        public static readonly DependencyProperty IconHeightProperty
+            = DependencyProperty.Register("IconHeight", typeof(double), typeof(ImageButton), new PropertyMetadata(24.0, null));
+
+        //图标宽度  
+        public static readonly DependencyProperty IconWidthProperty
+            = DependencyProperty.Register("IconWidth", typeof(double), typeof(ImageButton), new PropertyMetadata(24.0, null));
+
+        //图标和内容的对齐方式  
+        public static readonly DependencyProperty IconContentOrientationProperty
+            = DependencyProperty.Register("IconContentOrientation", typeof(Orientation), typeof(ImageButton), new PropertyMetadata(Orientation.Horizontal, null));
+
+        //图标和内容的距离  
+        public static readonly DependencyProperty IconContentMarginProperty
+            = DependencyProperty.Register("IconContentMargin", typeof(Thickness), typeof(ImageButton), new PropertyMetadata(new Thickness(0, 0, 0, 0), null));
+
+        #endregion
+
+        #region 属性包装
+
+        public Brush MouseOverBackground
+        {
+            get
+            {
+                return (Brush)GetValue(MouseOverBackgroundProperty);
+            }
+            set { SetValue(MouseOverBackgroundProperty, value); }
+        }
+
+        public Brush MouseDownBackground
+        {
+            get
+            {
+                return (Brush)GetValue(MouseDownBackgroundProperty);
+            }
+            set { SetValue(MouseDownBackgroundProperty, value); }
+        }
+
+        public Brush MouseOverForeground
+        {
+            get
+            {
+                return (Brush)GetValue(MouseOverForegroundProperty);
+            }
+            set { SetValue(MouseOverForegroundProperty, value); }
+        }
+
+        public Brush MouseDownForeground
+        {
+            get
+            {
+                return (Brush)GetValue(MouseDownForegroundProperty);
+            }
+            set { SetValue(MouseDownForegroundProperty, value); }
+        }
+
+        public Brush MouseOverBorderBrush
+        {
+            get { return (Brush)GetValue(MouseOverBorderBrushProperty); }
+            set { SetValue(MouseOverBorderBrushProperty, value); }
+        }
+
+        public Brush MouseDownBorderBrush
+        {
+            get { return (Brush)GetValue(MouseDownBorderBrushProperty); }
+            set { SetValue(MouseDownBorderBrushProperty, value); }
+        }
+
+        public CornerRadius CornerRadius
+        {
+            get { return (CornerRadius)GetValue(CornerRadiusProperty); }
+            set { SetValue(CornerRadiusProperty, value); }
+        }
+
+        public ImageSource Icon
+        {
+            get { return (ImageSource)GetValue(IconProperty); }
+            set { SetValue(IconProperty, value); }
+        }
+
+        public ImageSource IconMouseOver
+        {
+            get { return (ImageSource)GetValue(IconMouseOverProperty); }
+            set { SetValue(IconMouseOverProperty, value); }
+        }
+
+        public ImageSource IconPress
+        {
+            get { return (ImageSource)GetValue(IconPressProperty); }
+            set { SetValue(IconPressProperty, value); }
+        }
+
+        public double IconHeight
+        {
+            get { return (double)GetValue(IconHeightProperty); }
+            set { SetValue(IconHeightProperty, value); }
+        }
+
+        public double IconWidth
+        {
+            get { return (double)GetValue(IconWidthProperty); }
+            set { SetValue(IconWidthProperty, value); }
+        }
+
+        public Orientation IconContentOrientation
+        {
+            get { return (Orientation)GetValue(IconContentOrientationProperty); }
+            set { SetValue(IconContentOrientationProperty, value); }
+        }
+
+        public Thickness IconContentMargin
+        {
+            get { return (Thickness)GetValue(IconContentMarginProperty); }
+            set { SetValue(IconContentMarginProperty, value); }
+        }
+
+        #endregion
+    }
+}

+ 30 - 0
PDF Office/CustomControl/PathRadioButton.cs

@@ -103,6 +103,18 @@ namespace PDF_Office.CustomControl
         public static readonly DependencyProperty MouseDownBackgroundProperty
             = DependencyProperty.Register("MouseDownBackground", typeof(Brush), typeof(PathRadioButton));
 
+        /// <summary>  
+        /// 鼠标移上去的背景颜色透明度 
+        /// </summary>  
+        public static readonly DependencyProperty MouseOverBackgroundOpacityProperty
+                = DependencyProperty.Register("MouseOverBackgroundOpacity", typeof(double), typeof(PathRadioButton), new PropertyMetadata(1.0, null));
+
+        /// <summary>  
+        /// 鼠标按下去的背景颜色透明度  
+        /// </summary>  
+        public static readonly DependencyProperty MouseDownBackgroundOpacityProperty
+            = DependencyProperty.Register("MouseDownBackgroundOpacity", typeof(double), typeof(PathRadioButton), new PropertyMetadata(1.0, null));
+
         /// <summary>  
         /// 鼠标移上去的字体颜色  
         /// </summary>  
@@ -219,6 +231,24 @@ namespace PDF_Office.CustomControl
             set { SetValue(MouseDownBackgroundProperty, value); }
         }
 
+        public double MouseOverBackgroundOpacity
+        {
+            get
+            {
+                return (double)GetValue(MouseOverBackgroundOpacityProperty);
+            }
+            set { SetValue(MouseOverBackgroundOpacityProperty, value); }
+        }
+
+        public double MouseDownBackgroundOpacity
+        {
+            get
+            {
+                return (double)GetValue(MouseDownBackgroundOpacityProperty);
+            }
+            set { SetValue(MouseDownBackgroundOpacityProperty, value); }
+        }
+
         public Brush MouseOverForeground
         {
             get

+ 30 - 0
PDF Office/DataConvert/CenterToolTipConverter .cs

@@ -0,0 +1,30 @@
+using System;
+using System.Collections.Generic;
+using System.Globalization;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Data;
+
+namespace PDF_Office.DataConvert
+{
+    public class CenterToolTipConverter : IMultiValueConverter
+    {
+        public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture)
+        {
+            if (values.FirstOrDefault(v => v == DependencyProperty.UnsetValue) != null)
+            {
+                return double.NaN;
+            }
+            double placementTargetWidth = (double)values[0];
+            double toolTipWidth = (double)values[1];
+            return (placementTargetWidth / 4.0*3) - (toolTipWidth / 2.0);
+        }
+
+        public object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture)
+        {
+            throw new NotSupportedException();
+        }
+    }
+}

+ 19 - 6
PDF Office/PDF Office.csproj

@@ -212,6 +212,7 @@
       <DependentUpon>FormFieldCombox.xaml</DependentUpon>
     </Compile>
     <Compile Include="CustomControl\IconAndTextTabItem.cs" />
+    <Compile Include="CustomControl\ImageButton.cs" />
     <Compile Include="CustomControl\ImageRadioButton .cs" />
     <Compile Include="CustomControl\ListBoxItemToolBar.cs" />
     <Compile Include="CustomControl\MenuItemWithPath.cs" />
@@ -241,6 +242,7 @@
     </Compile>
     <Compile Include="DataConvert\AnnotateFontSizeConverter.cs" />
     <Compile Include="DataConvert\BoolToTextWrapConvert.cs" />
+    <Compile Include="DataConvert\CenterToolTipConverter .cs" />
     <Compile Include="DataConvert\CreateTimeToDate.cs" />
     <Compile Include="DataConvert\FileFormatToIconConvert.cs" />
     <Compile Include="DataConvert\GroupHeaderConverter.cs" />
@@ -404,8 +406,8 @@
     <Compile Include="ViewModels\PropertyPanel\PDFEdit\TextEditPropertyViewModel.cs" />
     <Compile Include="ViewModels\PropertyPanel\ViewModular\ReadViewContentViewModel.cs" />
     <Compile Include="ViewModels\HomePanel\RecentFiles\RecentFilesContentViewModel.cs" />
-    <Compile Include="ViewModels\PropertyPanel\AnnotPanel\CustomCreateDialogViewModel.cs" />
-    <Compile Include="ViewModels\PropertyPanel\AnnotPanel\DynamicPropertyDialogViewModel.cs" />
+    <Compile Include="ViewModels\Dialog\CustomCreateDialogViewModel.cs" />
+    <Compile Include="ViewModels\Dialog\DynamicPropertyDialogViewModel.cs" />
     <Compile Include="ViewModels\Tools\ConverterBarContentViewModel.cs" />
     <Compile Include="ViewModels\Dialog\ExtractDialogViewModel.cs" />
     <Compile Include="ViewModels\Dialog\FullScreenWindowViewModel.cs" />
@@ -799,10 +801,10 @@
     <Compile Include="CustomControl\CompositeControl\SlidContentPop.xaml.cs">
       <DependentUpon>SlidContentPop.xaml</DependentUpon>
     </Compile>
-    <Compile Include="Views\PropertyPanel\AnnotPanel\CustomCreateDialog.xaml.cs">
+    <Compile Include="Views\Dialog\CustomCreateDialog.xaml.cs">
       <DependentUpon>CustomCreateDialog.xaml</DependentUpon>
     </Compile>
-    <Compile Include="Views\PropertyPanel\AnnotPanel\DynamicPropertyDialog.xaml.cs">
+    <Compile Include="Views\Dialog\DynamicPropertyDialog.xaml.cs">
       <DependentUpon>DynamicPropertyDialog.xaml</DependentUpon>
     </Compile>
     <Compile Include="Views\PropertyPanel\AnnotPanel\FreehandAnnotProperty.xaml.cs">
@@ -966,6 +968,10 @@
       <Generator>MSBuild:Compile</Generator>
       <SubType>Designer</SubType>
     </Page>
+    <Page Include="Styles\ImageButtonStyle.xaml">
+      <SubType>Designer</SubType>
+      <Generator>MSBuild:Compile</Generator>
+    </Page>
     <Page Include="Styles\ImageRadioButtonDictionary.xaml">
       <SubType>Designer</SubType>
       <Generator>MSBuild:Compile</Generator>
@@ -1341,11 +1347,11 @@
       <SubType>Designer</SubType>
       <Generator>MSBuild:Compile</Generator>
     </Page>
-    <Page Include="Views\PropertyPanel\AnnotPanel\CustomCreateDialog.xaml">
+    <Page Include="Views\Dialog\CustomCreateDialog.xaml">
       <SubType>Designer</SubType>
       <Generator>MSBuild:Compile</Generator>
     </Page>
-    <Page Include="Views\PropertyPanel\AnnotPanel\DynamicPropertyDialog.xaml">
+    <Page Include="Views\Dialog\DynamicPropertyDialog.xaml">
       <SubType>Designer</SubType>
       <Generator>MSBuild:Compile</Generator>
     </Page>
@@ -1664,6 +1670,13 @@
     <Resource Include="Resources\StampIcons\SignHere.png" />
     <Resource Include="Resources\StampIcons\Void.png" />
     <Resource Include="Resources\StampIcons\Witness.png" />
+    <Resource Include="Resources\Dialog\AddImage.png">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </Resource>
+    <Resource Include="Resources\Dialog\AddImageSuspend.png">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </Resource>
+    <Resource Include="Resources\Dialog\help.png" />
     <Content Include="Resources\PageEdit\GridLine.jpg">
       <CopyToOutputDirectory>Always</CopyToOutputDirectory>
     </Content>

BIN
PDF Office/Resources/Dialog/AddImage.png


BIN
PDF Office/Resources/Dialog/AddImageSuspend.png


BIN
PDF Office/Resources/Dialog/help.png


+ 96 - 0
PDF Office/Styles/ImageButtonStyle.xaml

@@ -0,0 +1,96 @@
+<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+                    xmlns:customControl="clr-namespace:PDF_Office.CustomControl">
+    <Style TargetType="{x:Type customControl:ImageButton}">
+        <Setter Property="Background" Value="Transparent" />
+        <Setter Property="Template">
+            <Setter.Value>
+                <ControlTemplate TargetType="{x:Type customControl:ImageButton}">
+
+                    <Border
+                        Background="{TemplateBinding Background}"
+                        BorderBrush="{TemplateBinding BorderBrush}"
+                        BorderThickness="{TemplateBinding BorderThickness}">
+                        <Grid x:Name="grid" Background="{TemplateBinding Background}">
+                            <Border
+                                x:Name="PART_Border"
+                                Background="{TemplateBinding Background}"
+                                BorderBrush="{TemplateBinding BorderBrush}"
+                                BorderThickness="{TemplateBinding BorderThickness}"
+                                CornerRadius="{TemplateBinding CornerRadius}" />
+
+                            <Grid HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}">
+                                <StackPanel
+                                    Margin="{TemplateBinding Padding}"
+                                    HorizontalAlignment="Center"
+                                    VerticalAlignment="Center"
+                                    Orientation="{TemplateBinding IconContentOrientation}">
+                                    <Grid HorizontalAlignment="Center" VerticalAlignment="{TemplateBinding VerticalContentAlignment}">
+                                        <Image
+                                            x:Name="PART_Icon"
+                                            Width="{TemplateBinding IconWidth}"
+                                            Height="{TemplateBinding IconHeight}"
+                                            Source="{TemplateBinding Icon}" />
+                                        <Image
+                                            x:Name="PART_MouseOverIcon"
+                                            Width="{TemplateBinding IconWidth}"
+                                            Height="{TemplateBinding IconHeight}"
+                                            Source="{TemplateBinding IconMouseOver}"
+                                            Visibility="Collapsed" />
+                                        <Image
+                                            x:Name="PART_PressIcon"
+                                            Width="{TemplateBinding IconWidth}"
+                                            Height="{TemplateBinding IconHeight}"
+                                            Source="{TemplateBinding IconPress}"
+                                            Visibility="Collapsed" />
+                                    </Grid>
+                                    <TextBlock
+                                        x:Name="PART_Content"
+                                        Margin="{TemplateBinding IconContentMargin}"
+                                        HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
+                                        VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
+                                        Foreground="{TemplateBinding Foreground}"
+                                        SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"
+                                        Text="{TemplateBinding Content}"
+                                        TextTrimming="CharacterEllipsis" />
+                                </StackPanel>
+                            </Grid>
+                        </Grid>
+                    </Border>
+
+                    <ControlTemplate.Triggers>
+                        <Trigger Property="IsMouseOver" Value="True">
+                            <Setter TargetName="PART_Content" Property="Foreground" Value="{Binding MouseOverForeground, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type customControl:ImageButton}}}" />
+                            <Setter TargetName="PART_Border" Property="Background" Value="{Binding MouseOverBackground, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type customControl:ImageButton}}}" />
+                            <Setter TargetName="PART_Border" Property="BorderBrush" Value="{Binding MouseOverBorderBrush, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type customControl:ImageButton}}}" />
+                            <Setter TargetName="PART_MouseOverIcon" Property="Visibility" Value="Visible" />
+                            <Setter TargetName="PART_Icon" Property="Visibility" Value="Collapsed" />
+                            <Setter TargetName="PART_PressIcon" Property="Visibility" Value="Collapsed" />
+                        </Trigger>
+
+                        <Trigger Property="IsPressed" Value="True">
+                            <Setter TargetName="PART_Content" Property="Foreground" Value="{Binding MouseDownForeground, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type customControl:ImageButton}}}" />
+                            <Setter TargetName="PART_Border" Property="Background" Value="{Binding MouseDownBackground, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type customControl:ImageButton}}}" />
+                            <Setter TargetName="PART_Border" Property="BorderBrush" Value="{Binding MouseDownBorderBrush, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type customControl:ImageButton}}}" />
+                            <Setter TargetName="PART_PressIcon" Property="Visibility" Value="Visible" />
+                            <Setter TargetName="PART_Icon" Property="Visibility" Value="Collapsed" />
+                            <Setter TargetName="PART_MouseOverIcon" Property="Visibility" Value="Collapsed" />
+                        </Trigger>
+
+                        <Trigger Property="IsEnabled" Value="False">
+                            <Setter Property="Opacity" Value="0.5" />
+                        </Trigger>
+
+                        <Trigger SourceName="PART_Content" Property="Text" Value="">
+                            <Setter TargetName="PART_Content" Property="Visibility" Value="Collapsed" />
+                        </Trigger>
+
+                        <Trigger SourceName="PART_Content" Property="Text" Value="{x:Null}">
+                            <Setter TargetName="PART_Content" Property="Visibility" Value="Collapsed" />
+                        </Trigger>
+                    </ControlTemplate.Triggers>
+                </ControlTemplate>
+            </Setter.Value>
+        </Setter>
+    </Style>
+</ResourceDictionary>

+ 1 - 0
PDF Office/Styles/PathButtonStyle.xaml

@@ -74,6 +74,7 @@
                                         Text="{TemplateBinding Content}"
                                         TextTrimming="CharacterEllipsis" />
                                 </StackPanel>
+                                <ContentPresenter  Focusable="False" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" RecognizesAccessKey="True" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
                             </Grid>
                         </Grid>
                     </Border>

+ 7 - 3
PDF Office/Styles/PathRadioButtonDictionary.xaml

@@ -72,6 +72,7 @@
                                         Text="{TemplateBinding Content}"
                                         TextTrimming="CharacterEllipsis" />
                                 </StackPanel>
+                                <ContentPresenter  Focusable="False" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" RecognizesAccessKey="True" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
                             </Grid>
                         </Grid>
                     </Border>
@@ -80,6 +81,7 @@
                         <Trigger Property="IsMouseOver" Value="True">
                             <Setter TargetName="PART_Content" Property="Foreground" Value="{Binding MouseOverForeground, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type customControl:PathRadioButton}}}" />
                             <Setter TargetName="PART_Border" Property="Background" Value="{Binding MouseOverBackground, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type customControl:PathRadioButton}}}" />
+                            <Setter TargetName="PART_Border" Property="Opacity" Value="{Binding MouseOverBackgroundOpacity, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type customControl:PathRadioButton}}}" />
                             <Setter TargetName="PART_Border" Property="BorderBrush" Value="{Binding MouseOverBorderBrush, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type customControl:PathRadioButton}}}" />
                             <Setter TargetName="PART_MouseOverIcon" Property="Visibility" Value="Visible" />
                             <Setter TargetName="PART_Icon" Property="Visibility" Value="Collapsed" />
@@ -90,6 +92,7 @@
                         <Trigger Property="IsPressed" Value="True">
                             <Setter TargetName="PART_Content" Property="Foreground" Value="{Binding MouseDownForeground, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type customControl:PathRadioButton}}}" />
                             <Setter TargetName="PART_Border" Property="Background" Value="{Binding MouseDownBackground, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type customControl:PathRadioButton}}}" />
+                            <Setter TargetName="PART_Border" Property="Opacity" Value="{Binding MouseDownBackgroundOpacity, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type customControl:PathRadioButton}}}" />
                             <Setter TargetName="PART_Border" Property="BorderBrush" Value="{Binding MouseDownBorderBrush, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type customControl:PathRadioButton}}}" />
                             <Setter TargetName="PART_PressIcon" Property="Visibility" Value="Visible" />
                             <Setter TargetName="PART_Icon" Property="Visibility" Value="Collapsed" />
@@ -102,9 +105,10 @@
                         </Trigger>
 
                         <Trigger Property="IsChecked" Value="True">
-                            <Setter TargetName="PART_Content" Property="Foreground" Value="{Binding MouseOverForeground, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type customControl:PathRadioButton}}}" />
-                            <Setter TargetName="PART_Border" Property="Background" Value="{Binding MouseOverBackground, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type customControl:PathRadioButton}}}" />
-                            <Setter TargetName="PART_Border" Property="BorderBrush" Value="{Binding MouseOverBorderBrush, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type customControl:PathRadioButton}}}" />
+                            <Setter TargetName="PART_Content" Property="Foreground" Value="{Binding MouseDownForeground, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type customControl:PathRadioButton}}}" />
+                            <Setter TargetName="PART_Border" Property="Background" Value="{Binding MouseDownBackground, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type customControl:PathRadioButton}}}" />
+                            <Setter TargetName="PART_Border" Property="Opacity" Value="{Binding MouseDownBackgroundOpacity, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type customControl:PathRadioButton}}}" />
+                            <Setter TargetName="PART_Border" Property="BorderBrush" Value="{Binding MouseDownBorderBrush, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type customControl:PathRadioButton}}}" />
                             <Setter TargetName="PART_MouseOverIcon" Property="Visibility" Value="Collapsed" />
                             <Setter TargetName="PART_Icon" Property="Visibility" Value="Collapsed" />
                             <Setter TargetName="PART_PressIcon" Property="Visibility" Value="Collapsed" />

PDF Office/ViewModels/PropertyPanel/AnnotPanel/CustomCreateDialogViewModel.cs → PDF Office/ViewModels/Dialog/CustomCreateDialogViewModel.cs


PDF Office/ViewModels/PropertyPanel/AnnotPanel/DynamicPropertyDialogViewModel.cs → PDF Office/ViewModels/Dialog/DynamicPropertyDialogViewModel.cs


Різницю між файлами не показано, бо вона завелика
+ 337 - 0
PDF Office/Views/Dialog/CustomCreateDialog.xaml


PDF Office/Views/PropertyPanel/AnnotPanel/CustomCreateDialog.xaml.cs → PDF Office/Views/Dialog/CustomCreateDialog.xaml.cs


+ 4 - 0
PDF Office/Views/PropertyPanel/AnnotPanel/DynamicPropertyDialog.xaml

@@ -8,8 +8,10 @@
     xmlns:i="http://schemas.microsoft.com/xaml/behaviors"
     xmlns:local="clr-namespace:PDF_Office.Views.PropertyPanel.AnnotPanel"
     xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
+    xmlns:prism="http://prismlibrary.com/"
     Width="500"
     Height="300"
+    prism:Dialog.WindowStyle="{StaticResource DialogWindowStyle}"
     d:DataContext="{d:DesignInstance Type={x:Type annotpanel:DynamicPropertyDialogViewModel}}"
     mc:Ignorable="d">
     <cus:DialogContent Header="动态图章">
@@ -25,6 +27,7 @@
                     Height="32"
                     Margin="25,0,0,0"
                     HorizontalAlignment="Left"
+                    Style="{StaticResource Btn.cta}"
                     Command="{Binding ApplyCommnad}"
                     Content="确定" />
                 <Button
@@ -33,6 +36,7 @@
                     Height="32"
                     Margin="0,0,25,0"
                     HorizontalAlignment="Right"
+                    Style="{StaticResource btn.sec}"
                     Command="{Binding CancelCommand}"
                     Content="取消" />
             </Grid>

PDF Office/Views/PropertyPanel/AnnotPanel/DynamicPropertyDialog.xaml.cs → PDF Office/Views/Dialog/DynamicPropertyDialog.xaml.cs


+ 0 - 204
PDF Office/Views/PropertyPanel/AnnotPanel/CustomCreateDialog.xaml

@@ -1,204 +0,0 @@
-<UserControl x:Class="PDF_Office.Views.PropertyPanel.AnnotPanel.CustomCreateDialog"
-             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
-             xmlns:customcontrol="clr-namespace:PDF_Office.CustomControl"
-             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
-             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
-             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
-             xmlns:local="clr-namespace:PDF_Office.Views.PropertyPanel.AnnotPanel" xmlns:cus="clr-namespace:PDF_Office.CustomControl" xmlns:annotpanel="clr-namespace:PDF_Office.ViewModels.PropertyPanel.AnnotPanel" xmlns:i="http://schemas.microsoft.com/xaml/behaviors" xmlns:dataconvert="clr-namespace:PDF_Office.DataConvert" d:DataContext="{d:DesignInstance Type=annotpanel:CustomCreateDialogViewModel}"
-             mc:Ignorable="d" >
-
-    <UserControl.Resources>
-        <PathGeometry x:Key="Ic_AddButtonPath" Figures="M8.5,2.5 L8.5,7.5 L13.5,7.5 L13.5,8.5 L8.5,8.5 L8.5,13.5 L7.5,13.5 L7.5,8.5 L2.5,8.5 L2.5,7.5 L7.5,7.5 L7.5,2.5 L8.5,2.5 Z"/>
-        <dataconvert:UnVisivleConvert x:Key="UnVisivleConvert"/>
-        <dataconvert:IntAndTagToBoolMultiBinding x:Key="IntAndTagToBoolMultiBinding"/>
-    </UserControl.Resources>
-    <cus:DialogContent Header="新建图章">
-        <cus:DialogContent.Content>
-            <TabControl Grid.Row="1" Name="StampTabControl" SelectedIndex="2"  HorizontalAlignment="Center" HorizontalContentAlignment="Center" Style="{StaticResource TabControlWithUnderLineStyle}">
-                <TabItem x:Name="文字图章"
-                        Header="文字图章"
-                        FontFamily="Segoe UI" Foreground="#FF666666"
-                        HorizontalContentAlignment="Center"
-                        FontSize="16"
-                        Height="40"
-                        Width="88"
-                        IsSelected="True">
-                    <Grid>
-                        <Grid.RowDefinitions>
-                            <RowDefinition Height="*"/>
-                            <RowDefinition Height="*"/>
-                            <RowDefinition Height="*"/>
-                            <RowDefinition Height="*"/>
-                        </Grid.RowDefinitions>
-                        <Image Height="50" Source="{Binding TextImageSource}"/>
-                        <TextBox Grid.Row="1" Text="{Binding StampText,Mode=TwoWay}" TextChanged="TextBox_TextChanged">
-                            <i:Interaction.Triggers>
-                                <i:EventTrigger EventName="LostFocus">
-                                    <i:InvokeCommandAction Command="{Binding UpDataDynamicCommnad}" PassEventArgsToCommand="True" />
-                                </i:EventTrigger>
-                                <i:EventTrigger EventName="KeyDown">
-                                    <i:InvokeCommandAction Command="{Binding KeyDown}" PassEventArgsToCommand="True" />
-                                </i:EventTrigger>
-                            </i:Interaction.Triggers>
-                        </TextBox>
-                        <Grid Grid.Row="2">
-                            <StackPanel Orientation="Horizontal">
-                                <RadioButton Tag="1" Checked="RadioButton_Checked" >
-                                    <RadioButton.IsChecked>
-                                        <MultiBinding Converter="{StaticResource IntAndTagToBoolMultiBinding }" Mode="OneWay">
-                                            <Binding Source="1"/>
-                                            <Binding Path="RadioButtonIndex"/>
-                                        </MultiBinding>
-                                    </RadioButton.IsChecked>
-                                </RadioButton>
-                                <RadioButton Tag="2" Checked="RadioButton_Checked">
-                                    <RadioButton.IsChecked>
-                                        <MultiBinding Converter="{StaticResource IntAndTagToBoolMultiBinding }" Mode="OneWay">
-                                            <Binding Source="2"/>
-                                            <Binding Path="RadioButtonIndex"/>
-                                        </MultiBinding>
-                                    </RadioButton.IsChecked>
-                                </RadioButton>
-                                <RadioButton Tag="3" Checked="RadioButton_Checked">
-                                    <RadioButton.IsChecked>
-                                        <MultiBinding  Converter="{StaticResource IntAndTagToBoolMultiBinding }" Mode="OneWay">
-                                            <Binding Source="3"/>
-                                            <Binding Path="RadioButtonIndex"/>
-                                        </MultiBinding>
-                                    </RadioButton.IsChecked>
-                                </RadioButton>
-                                <RadioButton Tag="4" Checked="RadioButton_Checked">
-                                    <RadioButton.IsChecked>
-                                        <MultiBinding Converter="{StaticResource IntAndTagToBoolMultiBinding }" Mode="OneWay">
-                                            <Binding Source="4"/>
-                                            <Binding Path="RadioButtonIndex"/>
-                                        </MultiBinding>
-                                    </RadioButton.IsChecked>
-                                </RadioButton>
-                                <RadioButton Tag="5" Checked="RadioButton_Checked">
-                                    <RadioButton.IsChecked>
-                                        <MultiBinding Converter="{StaticResource IntAndTagToBoolMultiBinding }" Mode="OneWay">
-                                            <Binding Source="5"/>
-                                            <Binding Path="RadioButtonIndex"/>
-                                        </MultiBinding>
-                                    </RadioButton.IsChecked>
-                                </RadioButton>
-                                <RadioButton Tag="6" Checked="RadioButton_Checked">
-                                    <RadioButton.IsChecked>
-                                        <MultiBinding Converter="{StaticResource IntAndTagToBoolMultiBinding }" Mode="OneWay">
-                                            <Binding Source="6"/>
-                                            <Binding Path="RadioButtonIndex"/>
-                                        </MultiBinding>
-                                    </RadioButton.IsChecked>
-                                </RadioButton>
-                                <RadioButton Tag="7" Checked="RadioButton_Checked">
-                                    <RadioButton.IsChecked>
-                                        <MultiBinding Converter="{StaticResource IntAndTagToBoolMultiBinding }" Mode="OneWay">
-                                            <Binding Source="7"/>
-                                            <Binding Path="RadioButtonIndex"/>
-                                        </MultiBinding>
-                                    </RadioButton.IsChecked>
-                                </RadioButton>
-                                <RadioButton Tag="8" Checked="RadioButton_Checked">
-                                    <RadioButton.IsChecked>
-                                        <MultiBinding Converter="{StaticResource IntAndTagToBoolMultiBinding }" Mode="OneWay">
-                                            <Binding Source="8"/>
-                                            <Binding Path="RadioButtonIndex"/>
-                                        </MultiBinding>
-                                    </RadioButton.IsChecked>
-                                </RadioButton>
-                                <RadioButton Tag="9" Checked="RadioButton_Checked">
-                                    <RadioButton.IsChecked>
-                                        <MultiBinding Converter="{StaticResource IntAndTagToBoolMultiBinding }" Mode="OneWay">
-                                            <Binding Source="9"/>
-                                            <Binding Path="RadioButtonIndex"/>
-                                        </MultiBinding>
-                                    </RadioButton.IsChecked>
-                                </RadioButton>
-                                <RadioButton Tag="10" Checked="RadioButton_Checked">
-                                    <RadioButton.IsChecked>
-                                        <MultiBinding Converter="{StaticResource IntAndTagToBoolMultiBinding }" Mode="OneWay">
-                                            <Binding Source="10"/>
-                                            <Binding Path="RadioButtonIndex"/>
-                                        </MultiBinding>
-                                    </RadioButton.IsChecked>
-                                </RadioButton>
-                                <RadioButton Tag="11" Checked="RadioButton_Checked">
-                                    <RadioButton.IsChecked>
-                                        <MultiBinding Converter="{StaticResource IntAndTagToBoolMultiBinding}" Mode="OneWay">
-                                            <Binding Source="11"/>
-                                            <Binding Path="RadioButtonIndex"/>
-                                        </MultiBinding>
-                                    </RadioButton.IsChecked>
-                                </RadioButton>
-                            </StackPanel>
-                        </Grid>
-                        <StackPanel Grid.Row="3" Orientation="Horizontal" HorizontalAlignment="Center">
-                            <CheckBox Name="Date" VerticalAlignment="Center" FontFamily="Seoge UI" FontSize="14" Content="Date" Padding="7 0 0 0" IsChecked="{Binding IsCheckedDate,Mode=TwoWay}"/>
-                            <CheckBox Name="Time" VerticalAlignment="Center" FontFamily="Seoge UI" FontSize="14" Content="Time" Padding="7 0 0 0" IsChecked="{Binding IsCheckedTime,Mode=TwoWay}"/>
-                        </StackPanel>
-                    </Grid>
-                </TabItem>
-                <TabItem  x:Name="图片图章"
-                        Header="图片图章"
-                        FontFamily="Segoe UI" Foreground="#FF666666"
-                        HorizontalContentAlignment="Center"
-                        FontSize="16"
-                        Width="86">
-                    <Grid >
-                        <Grid.RowDefinitions>
-                            <RowDefinition Height="*"/>
-                            <RowDefinition Height="20"/>
-                        </Grid.RowDefinitions>
-                        <customcontrol:PathButton
-                        x:Name="BtnAdd"
-                        Height="24" Width="24"  IconHeight="20"  IconWidth="20" 
-                        Icon="{StaticResource Ic_AddButtonPath}"  IconFill="Red"
-                        IconPress="{StaticResource Ic_AddButtonPath}" IconPressFill="#C04CF8"
-                        IconMouseOver="{StaticResource Ic_AddButtonPath}" IconMouseOverFill="#C04CF8" Visibility="{Binding ShowImageButton}"  Command="{Binding OpenImageCommnad}"/>
-                        <Grid Background="Red" Visibility="{Binding ElementName=BtnAdd,Path=Visibility,Converter={StaticResource UnVisivleConvert}}">
-                            <Grid.RowDefinitions>
-                                <RowDefinition Height="24"/>
-                                <RowDefinition Height="*"/>
-                            </Grid.RowDefinitions>
-                            <Image Grid.RowSpan="2" Width="200" Height="200" Source="{Binding ImagePreviewSource}" />
-
-                            <customcontrol:PathButton
-                            x:Name="BtnReAdd"
-                            HorizontalAlignment="Right" VerticalAlignment="Top"
-                            Height="24" Width="24"  IconHeight="20"  IconWidth="20" 
-                            Icon="{StaticResource Ic_AddButtonPath}"  IconFill="Red"
-                            IconPress="{StaticResource Ic_AddButtonPath}" IconPressFill="#C04CF8"
-                            IconMouseOver="{StaticResource Ic_AddButtonPath}" IconMouseOverFill="#C04CF8" Command="{Binding OpenImageCommnad}"/>
-                        </Grid>
-                        <CheckBox Grid.Row="1" Width="20" Height="20" IsChecked="{Binding IsRemoveBackground}"/>
-                    </Grid>
-                </TabItem>
-            </TabControl>
-        </cus:DialogContent.Content>
-        <cus:DialogContent.BottmBar>
-            <Grid>
-                <Grid.ColumnDefinitions>
-                    <ColumnDefinition Width="50*" />
-                    <ColumnDefinition Width="50*" />
-                </Grid.ColumnDefinitions>
-                <Button
-                    Grid.Column="0"
-                    Width="150"
-                    Height="32"
-                    Margin="25,0,0,0"
-                    HorizontalAlignment="Left"
-                    Command="{Binding CreateCommnad}"
-                    Content="确定" />
-                <Button
-                    Grid.Column="1"
-                    Width="150"
-                    Height="32"
-                    Margin="0,0,25,0"
-                    HorizontalAlignment="Right"
-                    Command="{Binding CancelCommand}"
-                    Content="取消" />
-            </Grid>
-        </cus:DialogContent.BottmBar>
-    </cus:DialogContent>
-</UserControl>

Різницю між файлами не показано, бо вона завелика
+ 49 - 35
PDF Office/Views/PropertyPanel/AnnotPanel/StampAnnotProperty.xaml