2025-09-02 11:27:57 +08:00

46 lines
1.7 KiB
XML

<UserControl
x:Class="CAD.Extend.Views.CustomControl.customWindowTitleBar"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:CAD.Extend.Views.CustomControl"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
d:DesignHeight="450"
d:DesignWidth="800"
mc:Ignorable="d">
<!-- 引用外部资源字典 -->
<UserControl.Resources>
<!-- 使用相对路径引用 CustomStyles.xaml -->
<ResourceDictionary Source="pack://application:,,,/CAD.Extend;component/Views/Style/CustomStyles.xaml" />
</UserControl.Resources>
<Border
Height="30"
VerticalAlignment="Top"
Background="{StaticResource ColorPrimary}"
MouseDown="Border_MouseDown">
<Grid>
<Label
x:Name="lblTitle"
Height="30"
VerticalContentAlignment="Center"
d:Content="标题栏文字"
Content="{Binding title, Mode=TwoWay}"
FontSize="12"
Foreground="White" />
<Button
Width="30"
Height="30"
HorizontalAlignment="Right"
VerticalAlignment="Center"
Background="Transparent"
BorderBrush="Transparent"
Command="{Binding CloseCommand}"
CommandParameter="{Binding RelativeSource={RelativeSource AncestorType=Window}}"
Content="✖"
Foreground="White" />
</Grid>
</Border>
</UserControl>