Skip to content

Commit 490e36a

Browse files
committed
added new TabAssist.TabHeaderCursor attached property
1 parent d1153c3 commit 490e36a

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

src/MaterialDesignThemes.Wpf/TabAssist.cs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ public static void SetHeaderPanelMargin(DependencyObject element, Thickness valu
2727
=> element.SetValue(HeaderPanelMarginProperty, value);
2828

2929
public static Thickness GetHeaderPanelMargin(DependencyObject element)
30-
=> (Thickness) element.GetValue(HeaderPanelMarginProperty);
30+
=> (Thickness)element.GetValue(HeaderPanelMarginProperty);
3131

3232
internal static Visibility GetBindableIsItemsHost(DependencyObject obj)
3333
=> (Visibility)obj.GetValue(BindableIsItemsHostProperty);
@@ -45,4 +45,13 @@ private static void OnBindableIsItemsHostChanged(DependencyObject d, DependencyP
4545
panel.IsItemsHost = (Visibility)e.NewValue == Visibility.Visible;
4646
}
4747
}
48+
49+
public static Cursor GetTabHeaderCursor(DependencyObject obj)
50+
=> (Cursor)obj.GetValue(TabHeaderCursorProperty);
51+
52+
public static void SetTabHeaderCursor(DependencyObject obj, Cursor value)
53+
=> obj.SetValue(TabHeaderCursorProperty, value);
54+
55+
public static readonly DependencyProperty TabHeaderCursorProperty =
56+
DependencyProperty.RegisterAttached("TabHeaderCursor", typeof(Cursor), typeof(TabAssist), new PropertyMetadata(Cursors.Hand));
4857
}

src/MaterialDesignThemes.Wpf/Themes/MaterialDesignTheme.TabControl.xaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,7 @@
291291
Duration="0" />
292292
</Storyboard>
293293
</ControlTemplate.Resources>
294-
<Grid x:Name="Root" Cursor="Hand">
294+
<Grid x:Name="Root" Cursor="{Binding Path=(wpf:TabAssist.TabHeaderCursor), RelativeSource={RelativeSource AncestorType={x:Type TabControl}}}">
295295
<!-- This is the Header label ColorZone. -->
296296
<wpf:ColorZone x:Name="ColorZoneHeader"
297297
HorizontalAlignment="Stretch"

0 commit comments

Comments
 (0)