Bläddra i källkod

UI-补充Combox样式

ZhouJieSheng 2 år sedan
förälder
incheckning
fb0c7f1c2c

+ 399 - 0
PDF Office/App.xaml

@@ -2,6 +2,7 @@
     x:Class="PDF_Office.App"
     xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
     xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+    xmlns:Themes="clr-namespace:Microsoft.Windows.Themes;assembly=PresentationFramework.Aero2"
     xmlns:local="clr-namespace:PDF_Office"
     xmlns:prism="http://prismlibrary.com/"
     xmlns:sys="clr-namespace:System;assembly=mscorlib">
@@ -344,7 +345,405 @@
                 </Setter>
             </Style>
 
+            <!--  Design Token ComboboxItem  -->
+            <Style TargetType="{x:Type ComboBoxItem}">
+                <Setter Property="Foreground" Value="{StaticResource color.sys.text.neutral.lv1}" />
+                <Setter Property="BorderThickness" Value="0" />
+                <Setter Property="Padding" Value="8,0" />
+                <Setter Property="Template">
+                    <Setter.Value>
+                        <ControlTemplate TargetType="{x:Type ComboBoxItem}">
+                            <Border
+                                Name="Bd"
+                                Padding="{TemplateBinding Control.Padding}"
+                                Background="{TemplateBinding Panel.Background}"
+                                BorderBrush="{TemplateBinding Border.BorderBrush}"
+                                BorderThickness="{TemplateBinding Border.BorderThickness}"
+                                CornerRadius="{StaticResource border-radius.4}"
+                                SnapsToDevicePixels="True">
+                                <ContentPresenter
+                                    HorizontalAlignment="{TemplateBinding Control.HorizontalContentAlignment}"
+                                    VerticalAlignment="{TemplateBinding Control.VerticalContentAlignment}"
+                                    Content="{TemplateBinding ContentControl.Content}"
+                                    ContentStringFormat="{TemplateBinding ContentControl.ContentStringFormat}"
+                                    ContentTemplate="{TemplateBinding ContentControl.ContentTemplate}"
+                                    SnapsToDevicePixels="{TemplateBinding UIElement.SnapsToDevicePixels}" />
+                            </Border>
+                            <ControlTemplate.Triggers>
+                                <Trigger Property="UIElement.IsEnabled" Value="False">
+                                    <Setter Property="Foreground" Value="{StaticResource color.sys.text.neutral.dis}" />
+                                </Trigger>
+                                <MultiTrigger>
+                                    <MultiTrigger.Conditions>
+                                        <Condition Property="Selector.IsSelected" Value="False" />
+                                        <Condition Property="UIElement.IsMouseOver" Value="True" />
+                                        <Condition Property="UIElement.IsKeyboardFocused" Value="False" />
+                                    </MultiTrigger.Conditions>
+                                    <Setter TargetName="Bd" Property="Panel.Background" Value="{StaticResource color.item-state.hov.bg}" />
+                                    <Setter TargetName="Bd" Property="Border.BorderBrush" Value="#A826A0DA" />
+                                </MultiTrigger>
+                                <MultiTrigger>
+                                    <MultiTrigger.Conditions>
+                                        <Condition Property="Selector.IsSelected" Value="True" />
+                                        <Condition Property="UIElement.IsMouseOver" Value="False" />
+                                        <Condition Property="UIElement.IsKeyboardFocused" Value="True" />
+                                    </MultiTrigger.Conditions>
+                                    <Setter TargetName="Bd" Property="Panel.Background" Value="{StaticResource color.item-state.sel.bg.lv1}" />
+                                    <Setter TargetName="Bd" Property="Border.BorderBrush" Value="#26A0DA" />
+                                </MultiTrigger>
+                                <MultiTrigger>
+                                    <MultiTrigger.Conditions>
+                                        <Condition Property="Selector.IsSelected" Value="True" />
+                                        <Condition Property="UIElement.IsMouseOver" Value="True" />
+                                    </MultiTrigger.Conditions>
+                                    <Setter TargetName="Bd" Property="Panel.Background" Value="{StaticResource color.item-state.hov.bg}" />
+                                    <Setter TargetName="Bd" Property="Border.BorderBrush" Value="#1A477EDE" />
+                                </MultiTrigger>
+                                <MultiTrigger>
+                                    <MultiTrigger.Conditions>
+                                        <Condition Property="Selector.IsSelected" Value="True" />
+                                        <Condition Property="UIElement.IsMouseOver" Value="False" />
+                                        <Condition Property="UIElement.IsKeyboardFocused" Value="False" />
+                                    </MultiTrigger.Conditions>
+                                    <Setter TargetName="Bd" Property="Panel.Background" Value="{StaticResource color.item-state.sel.bg.lv1}" />
+                                    <Setter TargetName="Bd" Property="Border.BorderBrush" Value="#DADADA" />
+                                </MultiTrigger>
+                                <MultiTrigger>
+                                    <MultiTrigger.Conditions>
+                                        <Condition Property="Selector.IsSelected" Value="False" />
+                                        <Condition Property="UIElement.IsMouseOver" Value="False" />
+                                        <Condition Property="UIElement.IsKeyboardFocused" Value="True" />
+                                    </MultiTrigger.Conditions>
+                                    <Setter TargetName="Bd" Property="Border.BorderBrush" Value="#26A0DA" />
+                                </MultiTrigger>
+                                <MultiTrigger>
+                                    <MultiTrigger.Conditions>
+                                        <Condition Property="Selector.IsSelected" Value="False" />
+                                        <Condition Property="UIElement.IsMouseOver" Value="True" />
+                                        <Condition Property="UIElement.IsKeyboardFocused" Value="True" />
+                                    </MultiTrigger.Conditions>
+                                    <Setter TargetName="Bd" Property="Panel.Background" Value="{StaticResource color.item-state.hov.bg}" />
+                                    <Setter TargetName="Bd" Property="Border.BorderBrush" Value="#1A000000" />
+                                </MultiTrigger>
+                            </ControlTemplate.Triggers>
+                        </ControlTemplate>
+                    </Setter.Value>
+                </Setter>
+            </Style>
 
+            <Style x:Key="ComboBoxToggleButton" TargetType="{x:Type ToggleButton}">
+                <Setter Property="OverridesDefaultStyle" Value="true" />
+                <Setter Property="IsTabStop" Value="false" />
+                <Setter Property="Focusable" Value="false" />
+                <Setter Property="ClickMode" Value="Press" />
+                <Setter Property="Template">
+                    <Setter.Value>
+                        <ControlTemplate TargetType="{x:Type ToggleButton}">
+                            <Border
+                                x:Name="templateRoot"
+                                Background="Transparent"
+                                BorderBrush="{StaticResource color.field.border.norm}"
+                                BorderThickness="{TemplateBinding BorderThickness}"
+                                CornerRadius="{StaticResource border-radius.4}"
+                                SnapsToDevicePixels="true">
+                                <Border
+                                    x:Name="splitBorder"
+                                    Width="{DynamicResource {x:Static SystemParameters.VerticalScrollBarWidthKey}}"
+                                    Margin="8,0"
+                                    HorizontalAlignment="Right"
+                                    BorderBrush="Transparent"
+                                    BorderThickness="0"
+                                    SnapsToDevicePixels="true">
+                                    <Path
+                                        x:Name="arrow"
+                                        Width="12"
+                                        Height="12"
+                                        Margin="0"
+                                        HorizontalAlignment="Center"
+                                        VerticalAlignment="Center"
+                                        Data="M6 7.56434L2.03039 3.59473L0.969727 4.65539L5.46967 9.15533C5.76256 9.44822 6.23743 9.44822 6.53033 9.15533L11.0303 4.65539L9.9696 3.59473L6 7.56434Z"
+                                        Fill="{StaticResource color.icon.arrow.gray.def}" />
+                                </Border>
+                            </Border>
+                            <ControlTemplate.Triggers>
+                                <MultiDataTrigger>
+                                    <MultiDataTrigger.Conditions>
+                                        <Condition Binding="{Binding IsEditable, RelativeSource={RelativeSource AncestorType={x:Type ComboBox}}}" Value="true" />
+                                        <Condition Binding="{Binding IsMouseOver, RelativeSource={RelativeSource Self}}" Value="false" />
+                                        <Condition Binding="{Binding IsPressed, RelativeSource={RelativeSource Self}}" Value="false" />
+                                        <Condition Binding="{Binding IsEnabled, RelativeSource={RelativeSource Self}}" Value="true" />
+                                    </MultiDataTrigger.Conditions>
+                                    <Setter TargetName="templateRoot" Property="BorderBrush" Value="{StaticResource color.field.border.norm}" />
+                                </MultiDataTrigger>
+                                <Trigger Property="IsMouseOver" Value="true">
+                                    <Setter TargetName="arrow" Property="Fill" Value="{StaticResource color.icon.arrow.accent.hov}" />
+                                    <Setter TargetName="templateRoot" Property="BorderBrush" Value="{StaticResource color.field.border.hov}" />
+                                </Trigger>
+                                <MultiDataTrigger>
+                                    <MultiDataTrigger.Conditions>
+                                        <Condition Binding="{Binding IsMouseOver, RelativeSource={RelativeSource Self}}" Value="true" />
+                                        <Condition Binding="{Binding IsEditable, RelativeSource={RelativeSource AncestorType={x:Type ComboBox}}}" Value="false" />
+                                    </MultiDataTrigger.Conditions>
+                                    <Setter TargetName="templateRoot" Property="BorderBrush" Value="{StaticResource color.field.border.hov}" />
+                                </MultiDataTrigger>
+                                <MultiDataTrigger>
+                                    <MultiDataTrigger.Conditions>
+                                        <Condition Binding="{Binding IsMouseOver, RelativeSource={RelativeSource Self}}" Value="true" />
+                                        <Condition Binding="{Binding IsEditable, RelativeSource={RelativeSource AncestorType={x:Type ComboBox}}}" Value="true" />
+                                    </MultiDataTrigger.Conditions>
+                                    <Setter TargetName="templateRoot" Property="BorderBrush" Value="{StaticResource color.field.border.hov}" />
+                                </MultiDataTrigger>
+                                <Trigger Property="IsPressed" Value="true">
+                                    <Setter TargetName="arrow" Property="Fill" Value="{StaticResource color.icon.arrow.accent.hov}" />
+                                </Trigger>
+                                <Trigger Property="IsFocused" Value="True">
+                                    <Setter TargetName="templateRoot" Property="BorderBrush" Value="{StaticResource color.field.border.focus}" />
+                                    <Setter TargetName="templateRoot" Property="Effect" Value="{StaticResource shadow.blue-0-4}" />
+                                </Trigger>
+                                <Trigger Property="IsChecked" Value="True">
+                                    <Setter TargetName="arrow" Property="LayoutTransform">
+                                        <Setter.Value>
+                                            <RotateTransform Angle="180" />
+                                        </Setter.Value>
+                                    </Setter>
+                                </Trigger>
+                                <Trigger Property="IsEnabled" Value="false">
+                                    <Setter TargetName="arrow" Property="Fill" Value="{StaticResource color.icon.arrow.gray.dis}" />
+                                    <Setter TargetName="templateRoot" Property="Background" Value="{StaticResource color.field.bg.dis}" />
+                                    <Setter TargetName="templateRoot" Property="BorderBrush" Value="{StaticResource color.field.border.dis}" />
+                                </Trigger>
+                            </ControlTemplate.Triggers>
+                        </ControlTemplate>
+                    </Setter.Value>
+                </Setter>
+            </Style>
+            <ControlTemplate x:Key="ComboBoxTemplate" TargetType="{x:Type ComboBox}">
+                <Grid
+                    x:Name="templateRoot"
+                    Background="Transparent"
+                    SnapsToDevicePixels="true">
+                    <Grid.ColumnDefinitions>
+                        <ColumnDefinition Width="*" />
+                        <ColumnDefinition Width="0" MinWidth="{DynamicResource {x:Static SystemParameters.VerticalScrollBarWidthKey}}" />
+                    </Grid.ColumnDefinitions>
+                    <Popup
+                        x:Name="PART_Popup"
+                        Grid.ColumnSpan="2"
+                        Margin="1"
+                        AllowsTransparency="true"
+                        IsOpen="{Binding IsDropDownOpen, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}"
+                        Placement="Bottom"
+                        PopupAnimation="{DynamicResource {x:Static SystemParameters.ComboBoxPopupAnimationKey}}">
+                        <Themes:SystemDropShadowChrome
+                            x:Name="shadow"
+                            MinWidth="{Binding ActualWidth, ElementName=templateRoot}"
+                            MaxHeight="{TemplateBinding MaxDropDownHeight}"
+                            Color="Transparent">
+                            <Border
+                                x:Name="dropDownBorder"
+                                Margin="0,4,0,0"
+                                Background="{StaticResource color.sys.layout.anti}"
+                                BorderBrush="{DynamicResource {x:Static SystemColors.WindowFrameBrushKey}}"
+                                BorderThickness="0"
+                                CornerRadius="{StaticResource radius.base.m}"
+                                Effect="{StaticResource shadow.neutral.m}">
+                                <ScrollViewer x:Name="DropDownScrollViewer">
+                                    <Grid HorizontalAlignment="Stretch" SnapsToDevicePixels="True">
+                                        <!--  圆角背景  -->
+                                        <Border
+                                            x:Name="Bd"
+                                            HorizontalAlignment="Stretch"
+                                            Background="{StaticResource color.sys.layout.anti}"
+                                            BorderThickness="1"
+                                            CornerRadius="7">
+                                            <!--  面板内容  -->
+                                            <StackPanel
+                                                Margin="4"
+                                                HorizontalAlignment="Stretch"
+                                                IsItemsHost="True"
+                                                KeyboardNavigation.DirectionalNavigation="Contained" />
+                                        </Border>
+                                    </Grid>
+                                </ScrollViewer>
+                            </Border>
+                        </Themes:SystemDropShadowChrome>
+                    </Popup>
+                    <ToggleButton
+                        x:Name="toggleButton"
+                        Grid.ColumnSpan="2"
+                        Margin="2"
+                        Background="{TemplateBinding Background}"
+                        BorderBrush="{TemplateBinding BorderBrush}"
+                        BorderThickness="{TemplateBinding BorderThickness}"
+                        IsChecked="{Binding IsDropDownOpen, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}"
+                        Style="{StaticResource ComboBoxToggleButton}" />
+                    <ContentPresenter
+                        x:Name="contentPresenter"
+                        Margin="{TemplateBinding Padding}"
+                        HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
+                        VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
+                        Content="{TemplateBinding SelectionBoxItem}"
+                        ContentStringFormat="{TemplateBinding SelectionBoxItemStringFormat}"
+                        ContentTemplate="{TemplateBinding SelectionBoxItemTemplate}"
+                        ContentTemplateSelector="{TemplateBinding ItemTemplateSelector}"
+                        IsHitTestVisible="false"
+                        SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
+                </Grid>
+                <ControlTemplate.Triggers>
+                    <Trigger SourceName="PART_Popup" Property="HasDropShadow" Value="true">
+                        <Setter TargetName="shadow" Property="Margin" Value="5" />
+                    </Trigger>
+                    <Trigger Property="HasItems" Value="false">
+                        <Setter TargetName="dropDownBorder" Property="Height" Value="95" />
+                    </Trigger>
+                    <MultiTrigger>
+                        <MultiTrigger.Conditions>
+                            <Condition Property="IsGrouping" Value="true" />
+                            <Condition Property="VirtualizingPanel.IsVirtualizingWhenGrouping" Value="false" />
+                        </MultiTrigger.Conditions>
+                        <Setter Property="ScrollViewer.CanContentScroll" Value="false" />
+                    </MultiTrigger>
+                </ControlTemplate.Triggers>
+            </ControlTemplate>
+            <SolidColorBrush x:Key="TextBox.Static.Background" Color="#FFFFFFFF" />
+            <Style x:Key="ComboBoxEditableTextBox" TargetType="{x:Type TextBox}">
+                <Setter Property="OverridesDefaultStyle" Value="true" />
+                <Setter Property="AllowDrop" Value="true" />
+                <Setter Property="MinWidth" Value="0" />
+                <Setter Property="MinHeight" Value="0" />
+                <Setter Property="FocusVisualStyle" Value="{x:Null}" />
+                <Setter Property="ScrollViewer.PanningMode" Value="VerticalFirst" />
+                <Setter Property="Stylus.IsFlicksEnabled" Value="False" />
+                <Setter Property="Template">
+                    <Setter.Value>
+                        <ControlTemplate TargetType="{x:Type TextBox}">
+                            <ScrollViewer
+                                x:Name="PART_ContentHost"
+                                Background="Transparent"
+                                Focusable="false"
+                                HorizontalScrollBarVisibility="Hidden"
+                                VerticalScrollBarVisibility="Hidden" />
+                        </ControlTemplate>
+                    </Setter.Value>
+                </Setter>
+            </Style>
+            <ControlTemplate x:Key="ComboBoxEditableTemplate" TargetType="{x:Type ComboBox}">
+                <Grid x:Name="templateRoot" SnapsToDevicePixels="true">
+                    <Grid.ColumnDefinitions>
+                        <ColumnDefinition Width="*" />
+                        <ColumnDefinition Width="0" MinWidth="{DynamicResource {x:Static SystemParameters.VerticalScrollBarWidthKey}}" />
+                    </Grid.ColumnDefinitions>
+                    <Popup
+                        x:Name="PART_Popup"
+                        Grid.ColumnSpan="2"
+                        AllowsTransparency="true"
+                        IsOpen="{Binding IsDropDownOpen, RelativeSource={RelativeSource TemplatedParent}}"
+                        Placement="Bottom"
+                        PopupAnimation="{DynamicResource {x:Static SystemParameters.ComboBoxPopupAnimationKey}}">
+                        <Themes:SystemDropShadowChrome
+                            x:Name="shadow"
+                            MinWidth="{Binding ActualWidth, ElementName=templateRoot}"
+                            MaxHeight="{TemplateBinding MaxDropDownHeight}"
+                            Color="Transparent">
+                            <Border
+                                x:Name="dropDownBorder"
+                                Background="{DynamicResource {x:Static SystemColors.WindowBrushKey}}"
+                                BorderBrush="{DynamicResource {x:Static SystemColors.WindowFrameBrushKey}}"
+                                BorderThickness="1">
+                                <ScrollViewer x:Name="DropDownScrollViewer">
+                                    <Grid x:Name="grid" RenderOptions.ClearTypeHint="Enabled">
+                                        <Canvas
+                                            x:Name="canvas"
+                                            Width="0"
+                                            Height="0"
+                                            HorizontalAlignment="Left"
+                                            VerticalAlignment="Top">
+                                            <Rectangle
+                                                x:Name="opaqueRect"
+                                                Width="{Binding ActualWidth, ElementName=dropDownBorder}"
+                                                Height="{Binding ActualHeight, ElementName=dropDownBorder}"
+                                                Fill="{Binding Background, ElementName=dropDownBorder}" />
+                                        </Canvas>
+                                        <ItemsPresenter
+                                            x:Name="ItemsPresenter"
+                                            KeyboardNavigation.DirectionalNavigation="Contained"
+                                            SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
+                                    </Grid>
+                                </ScrollViewer>
+                            </Border>
+                        </Themes:SystemDropShadowChrome>
+                    </Popup>
+                    <ToggleButton
+                        x:Name="toggleButton"
+                        Grid.ColumnSpan="2"
+                        Background="{TemplateBinding Background}"
+                        BorderBrush="{TemplateBinding BorderBrush}"
+                        BorderThickness="{TemplateBinding BorderThickness}"
+                        IsChecked="{Binding IsDropDownOpen, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}"
+                        Style="{StaticResource ComboBoxToggleButton}" />
+                    <Border
+                        x:Name="border"
+                        Margin="{TemplateBinding BorderThickness}"
+                        Background="{StaticResource TextBox.Static.Background}">
+                        <TextBox
+                            x:Name="PART_EditableTextBox"
+                            Margin="{TemplateBinding Padding}"
+                            HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
+                            VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"
+                            IsReadOnly="{Binding IsReadOnly, RelativeSource={RelativeSource TemplatedParent}}"
+                            Style="{StaticResource ComboBoxEditableTextBox}" />
+                    </Border>
+                </Grid>
+                <ControlTemplate.Triggers>
+                    <Trigger Property="IsEnabled" Value="false">
+                        <Setter TargetName="border" Property="Opacity" Value="0.56" />
+                    </Trigger>
+                    <Trigger Property="IsKeyboardFocusWithin" Value="true">
+                        <Setter Property="Foreground" Value="Black" />
+                    </Trigger>
+                    <Trigger SourceName="PART_Popup" Property="HasDropShadow" Value="true">
+                        <Setter TargetName="shadow" Property="Margin" Value="0,0,5,5" />
+                        <Setter TargetName="shadow" Property="Color" Value="#71000000" />
+                    </Trigger>
+                    <Trigger Property="HasItems" Value="false">
+                        <Setter TargetName="dropDownBorder" Property="Height" Value="95" />
+                    </Trigger>
+                    <MultiTrigger>
+                        <MultiTrigger.Conditions>
+                            <Condition Property="IsGrouping" Value="true" />
+                            <Condition Property="VirtualizingPanel.IsVirtualizingWhenGrouping" Value="false" />
+                        </MultiTrigger.Conditions>
+                        <Setter Property="ScrollViewer.CanContentScroll" Value="false" />
+                    </MultiTrigger>
+                    <Trigger SourceName="DropDownScrollViewer" Property="ScrollViewer.CanContentScroll" Value="false">
+                        <Setter TargetName="opaqueRect" Property="Canvas.Top" Value="{Binding VerticalOffset, ElementName=DropDownScrollViewer}" />
+                        <Setter TargetName="opaqueRect" Property="Canvas.Left" Value="{Binding HorizontalOffset, ElementName=DropDownScrollViewer}" />
+                    </Trigger>
+                </ControlTemplate.Triggers>
+            </ControlTemplate>
+            <!--  Design Token ComBobox  -->
+            <Style TargetType="{x:Type ComboBox}">
+                <Setter Property="FocusVisualStyle" Value="{StaticResource FocusVisual}" />
+                <Setter Property="Background" Value="{StaticResource color.field.bg.def}" />
+                <Setter Property="BorderBrush" Value="{StaticResource color.field.border.norm}" />
+                <Setter Property="Foreground" Value="{StaticResource color.field.text.act}" />
+                <Setter Property="BorderThickness" Value="{StaticResource border-width.1}" />
+                <Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Auto" />
+                <Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Auto" />
+                <Setter Property="VerticalContentAlignment" Value="Center" />
+                <Setter Property="Padding" Value="8,3,5,3" />
+                <Setter Property="ScrollViewer.CanContentScroll" Value="true" />
+                <Setter Property="ScrollViewer.PanningMode" Value="Both" />
+                <Setter Property="Stylus.IsFlicksEnabled" Value="False" />
+                <Setter Property="Template" Value="{StaticResource ComboBoxTemplate}" />
+                <Style.Triggers>
+                    <Trigger Property="IsEditable" Value="true">
+                        <Setter Property="IsTabStop" Value="false" />
+                        <Setter Property="Padding" Value="2" />
+                        <Setter Property="Template" Value="{StaticResource ComboBoxEditableTemplate}" />
+                    </Trigger>
+                </Style.Triggers>
+            </Style>
         </ResourceDictionary>
     </Application.Resources>
 </prism:PrismApplication>

+ 1 - 1
PDF Office/CustomControl/DialogContent.cs

@@ -21,7 +21,7 @@ namespace PDF_Office.CustomControl
     /// 
     /// Content里暂时不能包含region 会注册不上,需要留意
     /// </summary>
-    public class DialogContent : Control
+    public class DialogContent : ContentControl
     {
         static DialogContent()
         {

+ 22 - 0
PDF Office/PDF Office.csproj

@@ -120,6 +120,7 @@
     <Reference Include="office, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c">
       <EmbedInteropTypes>True</EmbedInteropTypes>
     </Reference>
+    <Reference Include="PresentationFramework.Aero2" />
     <Reference Include="Prism, Version=8.1.97.5141, Culture=neutral, PublicKeyToken=40ee6c3a2184dc59, processorArchitecture=MSIL">
       <HintPath>packages\Prism.Core.8.1.97\lib\net461\Prism.dll</HintPath>
     </Reference>
@@ -598,6 +599,15 @@
     <Compile Include="Views\Dialog\HomePageToolsDialogs\HomePagePrinter\HomePagePrinterDialog.xaml.cs">
       <DependentUpon>HomePagePrinterDialog.xaml</DependentUpon>
     </Compile>
+    <Compile Include="Views\Dialog\Redaction\MarkSettingDialog.xaml.cs">
+      <DependentUpon>MarkSettingDialog.xaml</DependentUpon>
+    </Compile>
+    <Compile Include="Views\Dialog\Redaction\PageMarkDialog.xaml.cs">
+      <DependentUpon>PageMarkDialog.xaml</DependentUpon>
+    </Compile>
+    <Compile Include="Views\Dialog\Redaction\RepeatMarkDialog.xaml.cs">
+      <DependentUpon>RepeatMarkDialog.xaml</DependentUpon>
+    </Compile>
     <Compile Include="Views\Dialog\ToolsDialogs\CompressDialogs\CompressDialog.xaml.cs">
       <DependentUpon>CompressDialog.xaml</DependentUpon>
     </Compile>
@@ -1141,6 +1151,18 @@
       <SubType>Designer</SubType>
       <Generator>MSBuild:Compile</Generator>
     </Page>
+    <Page Include="Views\Dialog\Redaction\MarkSettingDialog.xaml">
+      <Generator>MSBuild:Compile</Generator>
+      <SubType>Designer</SubType>
+    </Page>
+    <Page Include="Views\Dialog\Redaction\PageMarkDialog.xaml">
+      <Generator>MSBuild:Compile</Generator>
+      <SubType>Designer</SubType>
+    </Page>
+    <Page Include="Views\Dialog\Redaction\RepeatMarkDialog.xaml">
+      <Generator>MSBuild:Compile</Generator>
+      <SubType>Designer</SubType>
+    </Page>
     <Page Include="Views\EditTools\Bates\BatesContent.xaml">
       <SubType>Designer</SubType>
       <Generator>MSBuild:Compile</Generator>

+ 45 - 25
PDF Office/Styles/CustomBtnStyle.xaml

@@ -477,7 +477,7 @@
                             <Setter TargetName="optionMark" Property="Fill" Value="{StaticResource RadioButton.Pressed.Glyph}" />
                         </Trigger>
                         <Trigger Property="IsChecked" Value="true">
-                            <Setter TargetName="optionMark" Property="Opacity" Value="1" />
+                            <Setter  TargetName="radioButtonBorder" Property="Background" Value="Red" />
                             <Setter TargetName="optionMark" Property="Fill" Value="{StaticResource RadioButton.Pressed.Glyph}" />
                         </Trigger>
                         <Trigger Property="IsChecked" Value="{x:Null}">
@@ -528,33 +528,53 @@
                             RecognizesAccessKey="True"
                             SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
                     </Grid>
-                    <ControlTemplate.Triggers>
-                        <Trigger Property="IsMouseOver" Value="true">
-                            <Setter TargetName="radioButtonBorder" Property="Background" Value="{StaticResource RadioButton.MouseOver.Background}" />
-                            <Setter TargetName="radioButtonBorder" Property="BorderBrush" Value="{StaticResource RadioButton.MouseOver.Border}" />
-                            <Setter TargetName="optionMark" Property="Fill" Value="{StaticResource RadioButton.MouseOver.Glyph}" />
-                        </Trigger>
-                        <Trigger Property="IsEnabled" Value="false">
-                            <Setter TargetName="radioButtonBorder" Property="Background" Value="{StaticResource RadioButton.Disabled.Background}" />
-                            <Setter TargetName="radioButtonBorder" Property="BorderBrush" Value="{StaticResource RadioButton.Disabled.Border}" />
-                            <Setter TargetName="optionMark" Property="Fill" Value="{StaticResource RadioButton.Disabled.Glyph}" />
-                        </Trigger>
-                        <Trigger Property="IsPressed" Value="true">
-                            <Setter TargetName="radioButtonBorder" Property="Background" Value="{StaticResource RadioButton.Pressed.Background}" />
-                            <Setter TargetName="radioButtonBorder" Property="BorderBrush" Value="{StaticResource RadioButton.Pressed.Border}" />
-                            <Setter TargetName="optionMark" Property="Fill" Value="{StaticResource RadioButton.Pressed.Glyph}" />
-                        </Trigger>
-                        <Trigger Property="IsChecked" Value="true">
-                            <Setter TargetName="optionMark" Property="Opacity" Value="1" />
-                            <Setter TargetName="optionMark" Property="Fill" Value="{StaticResource RadioButton.Pressed.Glyph}" />
-                        </Trigger>
-                        <Trigger Property="IsChecked" Value="{x:Null}">
-                            <Setter TargetName="optionMark" Property="Opacity" Value="0.56" />
-                        </Trigger>
-                    </ControlTemplate.Triggers>
                 </ControlTemplate>
             </Setter.Value>
         </Setter>
+        <Style.Triggers>
+            <Trigger Property="IsMouseOver" Value="true">
+                <Setter Property="Background" Value="{StaticResource RadioButton.MouseOver.Background}" />
+                <Setter Property="BorderBrush" Value="{StaticResource RadioButton.MouseOver.Border}" />
+            </Trigger>
+            <Trigger Property="IsEnabled" Value="false">
+                <Setter Property="Background" Value="{StaticResource RadioButton.Disabled.Background}" />
+                <Setter Property="BorderBrush" Value="{StaticResource RadioButton.Disabled.Border}" />
+            </Trigger>
+            <Trigger Property="IsChecked" Value="True">
+                <Setter Property="Background" Value="{StaticResource color.item-state.sel.bg.lv2}" />
+            </Trigger>
+            <Trigger Property="IsPressed" Value="true">
+                <Setter Property="Background" Value="{StaticResource RadioButton.Pressed.Background}" />
+                <Setter Property="BorderBrush" Value="{StaticResource RadioButton.Pressed.Border}" />
+            </Trigger>
+        </Style.Triggers>
+    </Style>
+
+    <!--  Design Token SubToolbar lv2 radionbutton  -->
+    <Style
+        x:Key="SubToolbarRdb"
+        BasedOn="{StaticResource RectangleRadionButtonWithCorner}"
+        TargetType="{x:Type RadioButton}">
+        <Setter Property="Background" Value="Transparent" />
+        <Setter Property="FontSize" Value="12" />
+        <Setter Property="FontFamily" Value="Segoe UI" />
+        <Setter Property="Foreground" Value="{StaticResource color.sys.text.neutral.lv1}" />
+        <Setter Property="BorderThickness" Value="0" />
+        <!--<Style.Triggers>
+            <Trigger Property="IsMouseOver" Value="True">
+                <Setter Property="Background" Value="{StaticResource color.item-state.sel.bg.lv2}" />
+            </Trigger>
+            <Trigger Property="IsPressed" Value="True">
+                <Setter Property="Background" Value="{StaticResource color.item-state.sel.bg.lv2}" />
+            </Trigger>
+            <Trigger Property="IsChecked" Value="True">
+                <Setter Property="Background" Value="{StaticResource color.item-state.sel.bg.lv2}" />
+            </Trigger>
+            <Trigger Property="IsEnabled" Value="False">
+                <Setter Property="Background" Value="Transparent" />
+                <Setter Property="Foreground" Value="{StaticResource color.sys.text.neutral.dis}" />
+            </Trigger>
+        </Style.Triggers>-->
     </Style>
 
     <Style x:Key="HomePageCompressBtn" TargetType="Button">

+ 1 - 1
PDF Office/Styles/ToggleButton.xaml

@@ -1,6 +1,6 @@
 <ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
     <!--  Design Token for subtool  -->
-    <Style x:Key="subToobar" TargetType="{x:Type ToggleButton}">
+    <Style x:Key="SubToolbarTgb" TargetType="{x:Type ToggleButton}">
         <Setter Property="FocusVisualStyle" Value="{x:Null}" />
         <Setter Property="Background" Value="Transparent" />
         <Setter Property="BorderThickness" Value="0" />

+ 10 - 11
PDF Office/Themes/Generic.xaml

@@ -12,26 +12,25 @@
                     <Border Background="White" CornerRadius="8">
                         <Grid Background="Transparent">
                             <Grid.RowDefinitions>
-                                <RowDefinition Height="48" />
+                                <RowDefinition Height="50" />
                                 <RowDefinition Height="*" />
                                 <RowDefinition Height="64" />
                             </Grid.RowDefinitions>
-                            <Border Background="Transparent" BorderThickness="0,0,0,1">
-                                <Border.BorderBrush>
-                                    <SolidColorBrush Opacity="0.2" Color="Gray" />
-                                </Border.BorderBrush>
+                            <Border Background="Transparent">
                                 <TextBlock
-                                    Margin="16,0,0,0"
+                                    Margin="16,0"
                                     VerticalAlignment="Center"
                                     FontSize="16"
                                     FontWeight="SemiBold"
                                     Text="{TemplateBinding Header}" />
                             </Border>
-                            <ContentPresenter Grid.Row="1" Content="{TemplateBinding Content}" />
-                            <Border Grid.Row="2" BorderThickness="0,1,0,0">
-                                <Border.BorderBrush>
-                                    <SolidColorBrush Opacity="0.2" Color="Gray" />
-                                </Border.BorderBrush>
+                            <ContentPresenter
+                                Grid.Row="1"
+                                Content="{TemplateBinding Content}"
+                                Focusable="False"
+                                RecognizesAccessKey="True"
+                                SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
+                            <Border Grid.Row="2">
                                 <ContentControl Content="{TemplateBinding BottmBar}" />
                             </Border>
                         </Grid>

+ 57 - 24
PDF Office/Views/PropertyPanel/AnnotPanel/DynamicPropertyDialog.xaml

@@ -1,28 +1,18 @@
-<UserControl x:Class="PDF_Office.Views.PropertyPanel.AnnotPanel.DynamicPropertyDialog"
-             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
-             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" d:DataContext="{d:DesignInstance Type=annotpanel:DynamicPropertyDialogViewModel}"
-             mc:Ignorable="d" 
-             Width="500"
-             Height="300">
+<UserControl
+    x:Class="PDF_Office.Views.PropertyPanel.AnnotPanel.DynamicPropertyDialog"
+    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+    xmlns:annotpanel="clr-namespace:PDF_Office.ViewModels.PropertyPanel.AnnotPanel"
+    xmlns:cus="clr-namespace:PDF_Office.CustomControl"
+    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
+    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"
+    Width="500"
+    Height="300"
+    d:DataContext="{d:DesignInstance Type={x:Type annotpanel:DynamicPropertyDialogViewModel}}"
+    mc:Ignorable="d">
     <cus:DialogContent Header="动态图章">
-        <cus:DialogContent.Content>
-            <StackPanel Height="50" Grid.Row="1" HorizontalAlignment="Center" Orientation="Horizontal">
-                <CheckBox Name="chkAuthor" IsChecked="{Binding IsChecked}" VerticalAlignment="Center" FontFamily="Seoge UI" FontSize="14" Margin="0 0 0 8" Content="Author" Padding="7 0 0 0" />
-                <TextBox x:Name="txtAuthor" VerticalContentAlignment="Center" IsEnabled="{Binding ElementName=chkAuthor, Path=IsChecked}" Text="{Binding Author,Mode=TwoWay}" Width="152" Height="32" HorizontalAlignment="Right" Margin="0 0 0 8"/>
-                <TextBlock x:Name="lbCreateDate" Grid.Row="1" FontFamily="Seoge UI" FontSize="14" Foreground="Black" VerticalAlignment="Center" Margin="27 0 0 0" Text="Date"/>
-                <ComboBox Name="txtCreateDate" SelectedIndex="{Binding SelectedIndex}" Grid.Row="1" Background ="Transparent"  Width="152" BorderThickness="1" BorderBrush="#FFE2E3E6" HorizontalAlignment="Right" ItemsSource="{Binding DateFormatList}">
-                    <ComboBox.ItemTemplate>
-                        <DataTemplate >
-                            <ComboBoxItem Content="{Binding }">
-                            </ComboBoxItem>
-                        </DataTemplate>
-                    </ComboBox.ItemTemplate>
-                </ComboBox>
-            </StackPanel>
-        </cus:DialogContent.Content>
         <cus:DialogContent.BottmBar>
             <Grid>
                 <Grid.ColumnDefinitions>
@@ -47,5 +37,48 @@
                     Content="取消" />
             </Grid>
         </cus:DialogContent.BottmBar>
+        <StackPanel
+            Grid.Row="1"
+            Height="50"
+            HorizontalAlignment="Center"
+            Orientation="Horizontal">
+            <CheckBox
+                x:Name="chkAuthor"
+                Margin="0,0,0,8"
+                Padding="7,0,0,0"
+                VerticalAlignment="Center"
+                Content="Author"
+                FontFamily="Seoge UI"
+                FontSize="14"
+                IsChecked="{Binding IsChecked}" />
+            <TextBox
+                x:Name="txtAuthor"
+                Width="152"
+                Height="32"
+                Margin="0,0,0,8"
+                HorizontalAlignment="Right"
+                VerticalContentAlignment="Center"
+                IsEnabled="{Binding IsChecked, ElementName=chkAuthor}"
+                Text="{Binding Author, Mode=TwoWay}" />
+            <TextBlock
+                x:Name="lbCreateDate"
+                Grid.Row="1"
+                Margin="27,0,0,0"
+                VerticalAlignment="Center"
+                FontFamily="Seoge UI"
+                FontSize="14"
+                Foreground="Black"
+                Text="Date" />
+            <ComboBox
+                x:Name="txtCreateDate"
+                Grid.Row="1"
+                Width="152"
+                HorizontalAlignment="Right"
+                Background="Transparent"
+                BorderBrush="#FFE2E3E6"
+                BorderThickness="1"
+                ItemsSource="{Binding DateFormatList}"
+                SelectedIndex="{Binding SelectedIndex}" />
+        </StackPanel>
     </cus:DialogContent>
 </UserControl>

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

@@ -148,7 +148,7 @@
                     Height="28"
                     BorderThickness="0"
                     IsChecked="{Binding IsPropertyOpen}"
-                    Style="{StaticResource subToobar}"
+                    Style="{StaticResource SubToolbarTgb}"
                     ToolTip="Property">
                     <Path
                         Width="20"