refactor: 优化动画逻辑和UI组件结构
重构动画帮助类以支持自定义动画目标 简化颜色滑块更新逻辑 调整浮动工具栏显示逻辑 新增BoardMenuFrame自定义控件
This commit is contained in:
@@ -0,0 +1,61 @@
|
||||
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:controls="clr-namespace:Ink_Canvas.Controls">
|
||||
<Style TargetType="{x:Type controls:BoardMenuFrame}">
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="{x:Type controls:BoardMenuFrame}">
|
||||
<Popup IsOpen="{Binding IsOpen, RelativeSource={RelativeSource TemplatedParent}}"
|
||||
PlacementTarget="{TemplateBinding PlacementTarget}"
|
||||
Placement="{TemplateBinding Placement}"
|
||||
CustomPopupPlacementCallback="{TemplateBinding CustomPopupPlacementCallback}"
|
||||
HorizontalOffset="{TemplateBinding PopupHorizontalOffset}"
|
||||
VerticalOffset="{TemplateBinding PopupVerticalOffset}"
|
||||
AllowsTransparency="True"
|
||||
StaysOpen="True"
|
||||
PopupAnimation="None">
|
||||
<Border x:Name="PART_AnimationRoot"
|
||||
BorderBrush="{TemplateBinding HeaderBackground}"
|
||||
BorderThickness="1"
|
||||
CornerRadius="{TemplateBinding PanelCornerRadius}"
|
||||
Background="{TemplateBinding PanelBackground}">
|
||||
<DockPanel LastChildFill="True">
|
||||
<Border DockPanel.Dock="Top"
|
||||
Background="{TemplateBinding HeaderBackground}"
|
||||
BorderBrush="{TemplateBinding HeaderBorderBrush}"
|
||||
BorderThickness="0,0,0,1"
|
||||
CornerRadius="{TemplateBinding HeaderCornerRadius}"
|
||||
Height="{TemplateBinding HeaderHeight}"
|
||||
Margin="-1,-1,-1,0">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto" />
|
||||
<ColumnDefinition Width="*" />
|
||||
<ColumnDefinition Width="Auto" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<ContentPresenter Grid.Column="0"
|
||||
Content="{TemplateBinding Title}"
|
||||
VerticalAlignment="Center"
|
||||
HorizontalAlignment="Left"
|
||||
Margin="8,0,0,0"
|
||||
TextElement.FontSize="{TemplateBinding TitleFontSize}"
|
||||
TextElement.FontWeight="Bold"
|
||||
TextElement.Foreground="White" />
|
||||
<Image Grid.Column="2"
|
||||
x:Name="PART_CloseImage"
|
||||
Source="/Resources/new-icons/close-white.png"
|
||||
Width="16" Height="16"
|
||||
RenderOptions.BitmapScalingMode="HighQuality"
|
||||
VerticalAlignment="Center"
|
||||
Margin="0,0,8,0" />
|
||||
</Grid>
|
||||
</Border>
|
||||
<ContentPresenter Margin="12" />
|
||||
</DockPanel>
|
||||
</Border>
|
||||
</Popup>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
</ResourceDictionary>
|
||||
Reference in New Issue
Block a user