mirror of
https://gitee.com/akwkevin/aistudio.-wpf.-diagram
synced 2026-04-13 04:36:37 +08:00
项目结构调整
This commit is contained in:
43
Others/Dragablz/DragablzDemo/CustomHeader.xaml
Normal file
43
Others/Dragablz/DragablzDemo/CustomHeader.xaml
Normal file
@@ -0,0 +1,43 @@
|
||||
<UserControl x:Class="DragablzDemo.CustomHeader"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:dragablzDemo="clr-namespace:DragablzDemo"
|
||||
xmlns:dragablz="clr-namespace:Dragablz;assembly=Dragablz"
|
||||
mc:Ignorable="d"
|
||||
d:DesignHeight="300" d:DesignWidth="300"
|
||||
d:DataContext="{d:DesignInstance dragablzDemo:CustomHeaderViewModel, IsDesignTimeCreatable=False}">
|
||||
|
||||
<!--
|
||||
Illustrates how to add a custom header, without completely rewriting the DragablzItem header template.
|
||||
|
||||
Note that rewriting the DragablzItem header template is a perfectly valid thing to do, but this allows
|
||||
customisation of existing templates.
|
||||
-->
|
||||
|
||||
<UserControl.Resources>
|
||||
<Style TargetType="{x:Type Thumb}" x:Key="InvisibleThumbStyle">
|
||||
<Setter Property="Background" Value="Transparent" />
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate>
|
||||
<Grid Background="{TemplateBinding Background}" />
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
</UserControl.Resources>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<Grid>
|
||||
<TextBlock Text="{Binding Header}" />
|
||||
<!-- you should provide your own Thumb, which will be used to monitor dragging -->
|
||||
<Thumb Style="{DynamicResource InvisibleThumbStyle}"
|
||||
dragablz:DragablzItem.IsCustomThumb="True" />
|
||||
</Grid>
|
||||
<CheckBox IsChecked="{Binding IsSelected}" ToolTip="Embed your own controls" />
|
||||
<Button ToolTip="Manually add a close button"
|
||||
Command="dragablz:TabablzControl.CloseItemCommand"
|
||||
>X</Button>
|
||||
</StackPanel>
|
||||
</UserControl>
|
||||
Reference in New Issue
Block a user