009_DI-Elec/newFront/c#前端/SWS.CustomControl/customWindowTitleBar.xaml
2025-08-15 15:33:20 +08:00

38 lines
1.3 KiB
XML

<UserControl
x:Class="SWS.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:SWS.CustomControl"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
d:DesignHeight="450"
d:DesignWidth="800"
mc:Ignorable="d">
<Border
Height="30"
VerticalAlignment="Top"
Background="#026BE3"
MouseDown="Border_MouseDown">
<Grid>
<Label
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>