refactor: 移除 BoardMenuFrame 控件并内联实现图像选项面板
将 BoardMenuFrame 自定义控件及其样式从项目中移除,改为直接在 MainWindow.xaml 中内联实现图像选项面板的布局和样式,以简化代码结构并减少自定义控件的使用
This commit is contained in:
@@ -1,141 +0,0 @@
|
|||||||
using System.Windows;
|
|
||||||
using System.Windows.Controls;
|
|
||||||
using System.Windows.Controls.Primitives;
|
|
||||||
using System.Windows.Input;
|
|
||||||
using System.Windows.Media;
|
|
||||||
|
|
||||||
namespace Ink_Canvas.Controls
|
|
||||||
{
|
|
||||||
[TemplatePart(Name = PartCloseImage, Type = typeof(UIElement))]
|
|
||||||
[TemplatePart(Name = PartAnimationRoot, Type = typeof(UIElement))]
|
|
||||||
public class BoardMenuFrame : ContentControl
|
|
||||||
{
|
|
||||||
private const string PartCloseImage = "PART_CloseImage";
|
|
||||||
private const string PartAnimationRoot = "PART_AnimationRoot";
|
|
||||||
|
|
||||||
public static readonly DependencyProperty TitleProperty =
|
|
||||||
DependencyProperty.Register(nameof(Title), typeof(object), typeof(BoardMenuFrame), new PropertyMetadata(null));
|
|
||||||
|
|
||||||
public static readonly DependencyProperty TitleFontSizeProperty =
|
|
||||||
DependencyProperty.Register(nameof(TitleFontSize), typeof(double), typeof(BoardMenuFrame), new PropertyMetadata(11d));
|
|
||||||
|
|
||||||
public static readonly DependencyProperty HeaderHeightProperty =
|
|
||||||
DependencyProperty.Register(nameof(HeaderHeight), typeof(double), typeof(BoardMenuFrame), new PropertyMetadata(48d));
|
|
||||||
|
|
||||||
public static readonly DependencyProperty PanelCornerRadiusProperty =
|
|
||||||
DependencyProperty.Register(nameof(PanelCornerRadius), typeof(CornerRadius), typeof(BoardMenuFrame), new PropertyMetadata(new CornerRadius(5)));
|
|
||||||
|
|
||||||
public static readonly DependencyProperty HeaderCornerRadiusProperty =
|
|
||||||
DependencyProperty.Register(nameof(HeaderCornerRadius), typeof(CornerRadius), typeof(BoardMenuFrame), new PropertyMetadata(new CornerRadius(6, 6, 0, 0)));
|
|
||||||
|
|
||||||
public static readonly DependencyProperty PanelBackgroundProperty =
|
|
||||||
DependencyProperty.Register(nameof(PanelBackground), typeof(Brush), typeof(BoardMenuFrame), new PropertyMetadata(null));
|
|
||||||
|
|
||||||
public static readonly DependencyProperty HeaderBackgroundProperty =
|
|
||||||
DependencyProperty.Register(nameof(HeaderBackground), typeof(Brush), typeof(BoardMenuFrame),
|
|
||||||
new PropertyMetadata(new SolidColorBrush((Color)ColorConverter.ConvertFromString("#2563eb"))));
|
|
||||||
|
|
||||||
public static readonly DependencyProperty HeaderBorderBrushProperty =
|
|
||||||
DependencyProperty.Register(nameof(HeaderBorderBrush), typeof(Brush), typeof(BoardMenuFrame),
|
|
||||||
new PropertyMetadata(new SolidColorBrush((Color)ColorConverter.ConvertFromString("#1e3a8a"))));
|
|
||||||
|
|
||||||
public static readonly DependencyProperty IsOpenProperty =
|
|
||||||
DependencyProperty.Register(nameof(IsOpen), typeof(bool), typeof(BoardMenuFrame), new PropertyMetadata(false));
|
|
||||||
|
|
||||||
public static readonly DependencyProperty PlacementTargetProperty =
|
|
||||||
DependencyProperty.Register(nameof(PlacementTarget), typeof(UIElement), typeof(BoardMenuFrame), new PropertyMetadata(null));
|
|
||||||
|
|
||||||
public static readonly DependencyProperty PlacementProperty =
|
|
||||||
DependencyProperty.Register(nameof(Placement), typeof(PlacementMode), typeof(BoardMenuFrame), new PropertyMetadata(PlacementMode.Custom));
|
|
||||||
|
|
||||||
public static readonly DependencyProperty CustomPopupPlacementCallbackProperty =
|
|
||||||
DependencyProperty.Register(nameof(CustomPopupPlacementCallback), typeof(CustomPopupPlacementCallback), typeof(BoardMenuFrame),
|
|
||||||
new PropertyMetadata((CustomPopupPlacementCallback)PlaceCenteredAbove));
|
|
||||||
|
|
||||||
private static CustomPopupPlacement[] PlaceCenteredAbove(Size popupSize, Size targetSize, Point offset)
|
|
||||||
{
|
|
||||||
return new[]
|
|
||||||
{
|
|
||||||
new CustomPopupPlacement(
|
|
||||||
new Point((targetSize.Width - popupSize.Width) / 2 + offset.X,
|
|
||||||
-popupSize.Height + offset.Y),
|
|
||||||
PopupPrimaryAxis.Horizontal),
|
|
||||||
new CustomPopupPlacement(
|
|
||||||
new Point((targetSize.Width - popupSize.Width) / 2 + offset.X,
|
|
||||||
targetSize.Height - offset.Y),
|
|
||||||
PopupPrimaryAxis.Horizontal)
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
public static readonly DependencyProperty PopupHorizontalOffsetProperty =
|
|
||||||
DependencyProperty.Register(nameof(PopupHorizontalOffset), typeof(double), typeof(BoardMenuFrame), new PropertyMetadata(0d));
|
|
||||||
|
|
||||||
public static readonly DependencyProperty PopupVerticalOffsetProperty =
|
|
||||||
DependencyProperty.Register(nameof(PopupVerticalOffset), typeof(double), typeof(BoardMenuFrame), new PropertyMetadata(-4d));
|
|
||||||
|
|
||||||
public object Title { get => GetValue(TitleProperty); set => SetValue(TitleProperty, value); }
|
|
||||||
public double TitleFontSize { get => (double)GetValue(TitleFontSizeProperty); set => SetValue(TitleFontSizeProperty, value); }
|
|
||||||
public double HeaderHeight { get => (double)GetValue(HeaderHeightProperty); set => SetValue(HeaderHeightProperty, value); }
|
|
||||||
public CornerRadius PanelCornerRadius { get => (CornerRadius)GetValue(PanelCornerRadiusProperty); set => SetValue(PanelCornerRadiusProperty, value); }
|
|
||||||
public CornerRadius HeaderCornerRadius { get => (CornerRadius)GetValue(HeaderCornerRadiusProperty); set => SetValue(HeaderCornerRadiusProperty, value); }
|
|
||||||
public Brush PanelBackground { get => (Brush)GetValue(PanelBackgroundProperty); set => SetValue(PanelBackgroundProperty, value); }
|
|
||||||
public Brush HeaderBackground { get => (Brush)GetValue(HeaderBackgroundProperty); set => SetValue(HeaderBackgroundProperty, value); }
|
|
||||||
public Brush HeaderBorderBrush { get => (Brush)GetValue(HeaderBorderBrushProperty); set => SetValue(HeaderBorderBrushProperty, value); }
|
|
||||||
public bool IsOpen { get => (bool)GetValue(IsOpenProperty); set => SetValue(IsOpenProperty, value); }
|
|
||||||
public UIElement PlacementTarget { get => (UIElement)GetValue(PlacementTargetProperty); set => SetValue(PlacementTargetProperty, value); }
|
|
||||||
public PlacementMode Placement { get => (PlacementMode)GetValue(PlacementProperty); set => SetValue(PlacementProperty, value); }
|
|
||||||
public CustomPopupPlacementCallback CustomPopupPlacementCallback
|
|
||||||
{
|
|
||||||
get => (CustomPopupPlacementCallback)GetValue(CustomPopupPlacementCallbackProperty);
|
|
||||||
set => SetValue(CustomPopupPlacementCallbackProperty, value);
|
|
||||||
}
|
|
||||||
public double PopupHorizontalOffset { get => (double)GetValue(PopupHorizontalOffsetProperty); set => SetValue(PopupHorizontalOffsetProperty, value); }
|
|
||||||
public double PopupVerticalOffset { get => (double)GetValue(PopupVerticalOffsetProperty); set => SetValue(PopupVerticalOffsetProperty, value); }
|
|
||||||
|
|
||||||
public event MouseButtonEventHandler CloseMouseDown;
|
|
||||||
public event MouseButtonEventHandler CloseMouseUp;
|
|
||||||
|
|
||||||
public UIElement AnimationTarget { get; private set; }
|
|
||||||
|
|
||||||
private UIElement _closeImage;
|
|
||||||
|
|
||||||
static BoardMenuFrame()
|
|
||||||
{
|
|
||||||
DefaultStyleKeyProperty.OverrideMetadata(typeof(BoardMenuFrame), new FrameworkPropertyMetadata(typeof(BoardMenuFrame)));
|
|
||||||
VisibilityProperty.OverrideMetadata(typeof(BoardMenuFrame),
|
|
||||||
new FrameworkPropertyMetadata(Visibility.Collapsed, OnVisibilityChanged));
|
|
||||||
}
|
|
||||||
|
|
||||||
private static void OnVisibilityChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
|
|
||||||
{
|
|
||||||
((BoardMenuFrame)d).IsOpen = (Visibility)e.NewValue == Visibility.Visible;
|
|
||||||
}
|
|
||||||
|
|
||||||
public override void OnApplyTemplate()
|
|
||||||
{
|
|
||||||
base.OnApplyTemplate();
|
|
||||||
if (_closeImage != null)
|
|
||||||
{
|
|
||||||
_closeImage.MouseDown -= CloseImage_MouseDown;
|
|
||||||
_closeImage.MouseUp -= CloseImage_MouseUp;
|
|
||||||
}
|
|
||||||
_closeImage = GetTemplateChild(PartCloseImage) as UIElement;
|
|
||||||
if (_closeImage != null)
|
|
||||||
{
|
|
||||||
_closeImage.MouseDown += CloseImage_MouseDown;
|
|
||||||
_closeImage.MouseUp += CloseImage_MouseUp;
|
|
||||||
}
|
|
||||||
AnimationTarget = GetTemplateChild(PartAnimationRoot) as UIElement;
|
|
||||||
}
|
|
||||||
|
|
||||||
private void CloseImage_MouseDown(object sender, MouseButtonEventArgs e)
|
|
||||||
{
|
|
||||||
CloseMouseDown?.Invoke(sender, e);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void CloseImage_MouseUp(object sender, MouseButtonEventArgs e)
|
|
||||||
{
|
|
||||||
CloseMouseUp?.Invoke(sender, e);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
+88
-68
@@ -1899,76 +1899,96 @@
|
|||||||
IconGeometry="F1 M24,24z M0,0z M19,3H5C3.9,3 3,3.9 3,5v14c0,1.1 0.9,2 2,2h14c1.1,0 2-0.9 2-2V5C21,3.9 20.1,3 19,3zM19,19H5V5h14V19z M17,7c-1.1,0-2,0.9-2,2s0.9,2 2,2 2-0.9 2-2S18.1,7 17,7zM7,17l2.5-3.01 1.96,2.36 2.54-3.21L17,17H7z"
|
IconGeometry="F1 M24,24z M0,0z M19,3H5C3.9,3 3,3.9 3,5v14c0,1.1 0.9,2 2,2h14c1.1,0 2-0.9 2-2V5C21,3.9 20.1,3 19,3zM19,19H5V5h14V19z M17,7c-1.1,0-2,0.9-2,2s0.9,2 2,2 2-0.9 2-2S18.1,7 17,7zM7,17l2.5-3.01 1.96,2.36 2.54-3.21L17,17H7z"
|
||||||
ButtonMouseUp="InsertImageOptions_MouseUp" />
|
ButtonMouseUp="InsertImageOptions_MouseUp" />
|
||||||
<!--插入图片菜单-->
|
<!--插入图片菜单-->
|
||||||
<localControls:BoardMenuFrame x:Name="BoardImageOptionsPanel" Visibility="Visible" ClipToBounds="True"
|
<Border>
|
||||||
PlacementTarget="{Binding ElementName=BoardInsertImage}"
|
<Grid RenderTransformOrigin="0,1" Margin="-133,-172,13,55">
|
||||||
PanelCornerRadius="5" HeaderCornerRadius="6,6,0,0" TitleFontSize="11"
|
<Border Visibility="Collapsed" ClipToBounds="True" d:Visibility="Visible"
|
||||||
PanelBackground="{DynamicResource FloatBarBackground}" Opacity="1"
|
x:Name="BoardImageOptionsPanel"
|
||||||
Title="{i18n:I18n Key=Board_SelectImage}"
|
CornerRadius="5" Background="{DynamicResource FloatBarBackground}"
|
||||||
CloseMouseDown="Border_MouseDown"
|
Opacity="1"
|
||||||
CloseMouseUp="CloseImageOptionsPanel_MouseUp">
|
BorderBrush="#2563eb" BorderThickness="1">
|
||||||
<ikw:SimpleStackPanel Margin="6,4,6,4" Spacing="2">
|
<ikw:SimpleStackPanel Margin="0">
|
||||||
<!-- Screenshot Option -->
|
<Border BorderBrush="#1e3a8a" BorderThickness="0,0,0,1"
|
||||||
<Border MouseDown="Border_MouseDown" MouseUp="ImageOptionScreenshot_MouseUp"
|
CornerRadius="6,6,0,0"
|
||||||
Background="Transparent" CornerRadius="3" Padding="6,4">
|
Background="#2563eb" Margin="-1,-1,-1,1">
|
||||||
<Border.Style>
|
<Canvas Height="24" ClipToBounds="True">
|
||||||
<Style TargetType="Border">
|
<TextBlock Text="{i18n:I18n Key=Board_SelectImage}" Canvas.Left="8" Foreground="White"
|
||||||
<Setter Property="Background" Value="Transparent"/>
|
Padding="0,5"
|
||||||
<Style.Triggers>
|
FontSize="11" FontWeight="Bold"
|
||||||
<Trigger Property="IsMouseOver" Value="True">
|
TextAlignment="Center" />
|
||||||
<Setter Property="Background" Value="#f0f9ff"/>
|
<Image Margin="100,4,0,0"
|
||||||
</Trigger>
|
Source="/Resources/new-icons/close-white.png"
|
||||||
</Style.Triggers>
|
RenderOptions.BitmapScalingMode="HighQuality"
|
||||||
</Style>
|
Height="16" Width="16"
|
||||||
</Border.Style>
|
MouseDown="Border_MouseDown"
|
||||||
<ikw:SimpleStackPanel Orientation="Horizontal" Spacing="6">
|
MouseUp="CloseImageOptionsPanel_MouseUp" />
|
||||||
<Image Height="16" Width="16">
|
</Canvas>
|
||||||
<Image.Source>
|
</Border>
|
||||||
<DrawingImage>
|
<ikw:SimpleStackPanel Margin="6,4,6,4" Spacing="2">
|
||||||
<DrawingImage.Drawing>
|
<!-- Screenshot Option -->
|
||||||
<DrawingGroup ClipGeometry="M0,0 V24 H24 V0 H0 Z">
|
<Border MouseDown="Border_MouseDown" MouseUp="ImageOptionScreenshot_MouseUp"
|
||||||
<GeometryDrawing Brush="#2563eb"
|
Background="Transparent" CornerRadius="3" Padding="6,4">
|
||||||
Geometry="{Binding Source={x:Static icons:XamlGraphicsIconGeometries.ScreenshotIconGeometry}, Converter={StaticResource StringToGeometryConverter}}"/>
|
<Border.Style>
|
||||||
</DrawingGroup>
|
<Style TargetType="Border">
|
||||||
</DrawingImage.Drawing>
|
<Setter Property="Background" Value="Transparent"/>
|
||||||
</DrawingImage>
|
<Style.Triggers>
|
||||||
</Image.Source>
|
<Trigger Property="IsMouseOver" Value="True">
|
||||||
</Image>
|
<Setter Property="Background" Value="#f0f9ff"/>
|
||||||
<TextBlock Text="{i18n:I18n Key=Board_Screenshot}" FontSize="10"
|
</Trigger>
|
||||||
Foreground="{DynamicResource TextForeground}" VerticalAlignment="Center"/>
|
</Style.Triggers>
|
||||||
|
</Style>
|
||||||
|
</Border.Style>
|
||||||
|
<ikw:SimpleStackPanel Orientation="Horizontal" Spacing="6">
|
||||||
|
<Image Height="16" Width="16">
|
||||||
|
<Image.Source>
|
||||||
|
<DrawingImage>
|
||||||
|
<DrawingImage.Drawing>
|
||||||
|
<DrawingGroup ClipGeometry="M0,0 V24 H24 V0 H0 Z">
|
||||||
|
<GeometryDrawing Brush="#2563eb"
|
||||||
|
Geometry="{Binding Source={x:Static icons:XamlGraphicsIconGeometries.ScreenshotIconGeometry}, Converter={StaticResource StringToGeometryConverter}}"/>
|
||||||
|
</DrawingGroup>
|
||||||
|
</DrawingImage.Drawing>
|
||||||
|
</DrawingImage>
|
||||||
|
</Image.Source>
|
||||||
|
</Image>
|
||||||
|
<TextBlock Text="{i18n:I18n Key=Board_Screenshot}" FontSize="10"
|
||||||
|
Foreground="{DynamicResource TextForeground}" VerticalAlignment="Center"/>
|
||||||
|
</ikw:SimpleStackPanel>
|
||||||
|
</Border>
|
||||||
|
<!-- Select Image Option -->
|
||||||
|
<Border MouseDown="Border_MouseDown" MouseUp="ImageOptionSelectFile_MouseUp"
|
||||||
|
Background="Transparent" CornerRadius="3" Padding="6,4">
|
||||||
|
<Border.Style>
|
||||||
|
<Style TargetType="Border">
|
||||||
|
<Setter Property="Background" Value="Transparent"/>
|
||||||
|
<Style.Triggers>
|
||||||
|
<Trigger Property="IsMouseOver" Value="True">
|
||||||
|
<Setter Property="Background" Value="#f0f9ff"/>
|
||||||
|
</Trigger>
|
||||||
|
</Style.Triggers>
|
||||||
|
</Style>
|
||||||
|
</Border.Style>
|
||||||
|
<ikw:SimpleStackPanel Orientation="Horizontal" Spacing="6">
|
||||||
|
<Image Height="16" Width="16">
|
||||||
|
<Image.Source>
|
||||||
|
<DrawingImage>
|
||||||
|
<DrawingImage.Drawing>
|
||||||
|
<DrawingGroup ClipGeometry="M0,0 V24 H24 V0 H0 Z">
|
||||||
|
<GeometryDrawing Brush="#2563eb"
|
||||||
|
Geometry="F1 M24,24z M0,0z M19,3H5C3.9,3 3,3.9 3,5v14c0,1.1 0.9,2 2,2h14c1.1,0 2-0.9 2-2V5C21,3.9 20.1,3 19,3zM19,19H5V5h14V19z M17,7c-1.1,0-2,0.9-2,2s0.9,2 2,2 2-0.9 2-2S18.1,7 17,7zM7,17l2.5-3.01 1.96,2.36 2.54-3.21L17,17H7z"/>
|
||||||
|
</DrawingGroup>
|
||||||
|
</DrawingImage.Drawing>
|
||||||
|
</DrawingImage>
|
||||||
|
</Image.Source>
|
||||||
|
</Image>
|
||||||
|
<TextBlock Text="{i18n:I18n Key=Board_SelectImage}" FontSize="10"
|
||||||
|
Foreground="{DynamicResource TextForeground}" VerticalAlignment="Center"/>
|
||||||
|
</ikw:SimpleStackPanel>
|
||||||
|
</Border>
|
||||||
|
</ikw:SimpleStackPanel>
|
||||||
</ikw:SimpleStackPanel>
|
</ikw:SimpleStackPanel>
|
||||||
</Border>
|
</Border>
|
||||||
<!-- Select Image Option -->
|
</Grid>
|
||||||
<Border MouseDown="Border_MouseDown" MouseUp="ImageOptionSelectFile_MouseUp"
|
</Border>
|
||||||
Background="Transparent" CornerRadius="3" Padding="6,4">
|
|
||||||
<Border.Style>
|
|
||||||
<Style TargetType="Border">
|
|
||||||
<Setter Property="Background" Value="Transparent"/>
|
|
||||||
<Style.Triggers>
|
|
||||||
<Trigger Property="IsMouseOver" Value="True">
|
|
||||||
<Setter Property="Background" Value="#f0f9ff"/>
|
|
||||||
</Trigger>
|
|
||||||
</Style.Triggers>
|
|
||||||
</Style>
|
|
||||||
</Border.Style>
|
|
||||||
<ikw:SimpleStackPanel Orientation="Horizontal" Spacing="6">
|
|
||||||
<Image Height="16" Width="16">
|
|
||||||
<Image.Source>
|
|
||||||
<DrawingImage>
|
|
||||||
<DrawingImage.Drawing>
|
|
||||||
<DrawingGroup ClipGeometry="M0,0 V24 H24 V0 H0 Z">
|
|
||||||
<GeometryDrawing Brush="#2563eb"
|
|
||||||
Geometry="F1 M24,24z M0,0z M19,3H5C3.9,3 3,3.9 3,5v14c0,1.1 0.9,2 2,2h14c1.1,0 2-0.9 2-2V5C21,3.9 20.1,3 19,3zM19,19H5V5h14V19z M17,7c-1.1,0-2,0.9-2,2s0.9,2 2,2 2-0.9 2-2S18.1,7 17,7zM7,17l2.5-3.01 1.96,2.36 2.54-3.21L17,17H7z"/>
|
|
||||||
</DrawingGroup>
|
|
||||||
</DrawingImage.Drawing>
|
|
||||||
</DrawingImage>
|
|
||||||
</Image.Source>
|
|
||||||
</Image>
|
|
||||||
<TextBlock Text="{i18n:I18n Key=Board_SelectImage}" FontSize="10"
|
|
||||||
Foreground="{DynamicResource TextForeground}" VerticalAlignment="Center"/>
|
|
||||||
</ikw:SimpleStackPanel>
|
|
||||||
</Border>
|
|
||||||
</ikw:SimpleStackPanel>
|
|
||||||
</localControls:BoardMenuFrame>
|
|
||||||
<controls:BoardToolbarButton x:Name="BoardUndo"
|
<controls:BoardToolbarButton x:Name="BoardUndo"
|
||||||
Label="{i18n:I18n Key=Board_Undo}"
|
Label="{i18n:I18n Key=Board_Undo}"
|
||||||
IconGeometry="F1 M24,24z M0,0z M8.71408,16.8493L0.874451,9.00964 8.71408,1.17001 8.71408,7.42358 15.7239,7.42358C16.7074,7.42358 17.6791,7.62744 18.583,8.02124 19.4866,8.41493 20.3023,8.98966 20.9857,9.70849 21.6689,10.4271 22.2069,11.276 22.5726,12.2047 22.9383,13.1333 23.1256,14.126 23.1256,15.1268 23.1256,16.1276 22.9383,17.1203 22.5726,18.0489 22.2069,18.9776 21.6689,19.8264 20.9857,20.5451 20.3023,21.2639 19.4866,21.8387 18.583,22.2324 17.6791,22.6262 16.7074,22.83 15.7239,22.83L10.437,22.83 10.437,19.6579 15.7239,19.6579C16.2679,19.6579 16.8086,19.5453 17.3159,19.3243 17.8235,19.1031 18.29,18.7767 18.6867,18.3594 19.0835,17.942 19.4023,17.4422 19.6211,16.8866 19.8399,16.3308 19.9534,15.7326 19.9534,15.1268 19.9534,14.5209 19.8399,13.9227 19.6211,13.367 19.4023,12.8114 19.0835,12.3115 18.6867,11.8941 18.29,11.4769 17.8235,11.1505 17.3159,10.9293 16.8086,10.7083 16.2679,10.5957 15.7239,10.5957L8.71408,10.5957 8.71408,16.8493z"
|
IconGeometry="F1 M24,24z M0,0z M8.71408,16.8493L0.874451,9.00964 8.71408,1.17001 8.71408,7.42358 15.7239,7.42358C16.7074,7.42358 17.6791,7.62744 18.583,8.02124 19.4866,8.41493 20.3023,8.98966 20.9857,9.70849 21.6689,10.4271 22.2069,11.276 22.5726,12.2047 22.9383,13.1333 23.1256,14.126 23.1256,15.1268 23.1256,16.1276 22.9383,17.1203 22.5726,18.0489 22.2069,18.9776 21.6689,19.8264 20.9857,20.5451 20.3023,21.2639 19.4866,21.8387 18.583,22.2324 17.6791,22.6262 16.7074,22.83 15.7239,22.83L10.437,22.83 10.437,19.6579 15.7239,19.6579C16.2679,19.6579 16.8086,19.5453 17.3159,19.3243 17.8235,19.1031 18.29,18.7767 18.6867,18.3594 19.0835,17.942 19.4023,17.4422 19.6211,16.8866 19.8399,16.3308 19.9534,15.7326 19.9534,15.1268 19.9534,14.5209 19.8399,13.9227 19.6211,13.367 19.4023,12.8114 19.0835,12.3115 18.6867,11.8941 18.29,11.4769 17.8235,11.1505 17.3159,10.9293 16.8086,10.7083 16.2679,10.5957 15.7239,10.5957L8.71408,10.5957 8.71408,16.8493z"
|
||||||
|
|||||||
@@ -1,61 +0,0 @@
|
|||||||
<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