Files
Future/Example/Custom4Behavior.xaml
2025-08-30 17:19:57 +08:00

22 lines
1.1 KiB
XML

<Window x:Class="Example.Custom4Behavior"
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:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:Example"
xmlns:b="http://schemas.microsoft.com/xaml/behaviors"
mc:Ignorable="d"
Title="Custom4Behavior" Height="450" Width="800" Background="Silver" Foreground="White">
<b:Interaction.Behaviors>
<local:CustomTitleBar TitleHeight="40" TitleBar="{Binding ElementName=TitleBar, Mode=OneWay}" HoverBrush="{DynamicResource {x:Static SystemColors.ActiveCaptionBrushKey}}" Title="窗口行为测试" Header="中心标题测试"/>
</b:Interaction.Behaviors>
<Grid Background="White">
<Grid.RowDefinitions>
<RowDefinition Height="40"/>
<RowDefinition />
</Grid.RowDefinitions>
<Border x:Name="TitleBar" Grid.Row="0"/>
<Border x:Name="ClientArea" Grid.Row="1"/>
</Grid>
</Window>