-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Expand file tree
/
Copy pathTabAssist.cs
More file actions
48 lines (35 loc) · 2.27 KB
/
TabAssist.cs
File metadata and controls
48 lines (35 loc) · 2.27 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
namespace MaterialDesignThemes.Wpf;
public static class TabAssist
{
public static readonly DependencyProperty HasFilledTabProperty = DependencyProperty.RegisterAttached(
"HasFilledTab", typeof(bool), typeof(TabAssist), new PropertyMetadata(false));
public static void SetHasFilledTab(DependencyObject element, bool value)
=> element.SetValue(HasFilledTabProperty, value);
public static bool GetHasFilledTab(DependencyObject element)
=> (bool)element.GetValue(HasFilledTabProperty);
public static readonly DependencyProperty HasUniformTabWidthProperty = DependencyProperty.RegisterAttached(
"HasUniformTabWidth", typeof(bool), typeof(TabAssist), new PropertyMetadata(false));
public static void SetHasUniformTabWidth(DependencyObject element, bool value)
=> element.SetValue(HasUniformTabWidthProperty, value);
public static bool GetHasUniformTabWidth(DependencyObject element)
=> (bool)element.GetValue(HasUniformTabWidthProperty);
public static readonly DependencyProperty HeaderPanelMarginProperty = DependencyProperty.RegisterAttached(
"HeaderPanelMargin", typeof(Thickness), typeof(TabAssist), new PropertyMetadata(default(Thickness)));
public static void SetHeaderPanelMargin(DependencyObject element, Thickness value)
=> element.SetValue(HeaderPanelMarginProperty, value);
public static Thickness GetHeaderPanelMargin(DependencyObject element)
=> (Thickness) element.GetValue(HeaderPanelMarginProperty);
public static Visibility GetBindableIsItemsHost(DependencyObject obj)
=> (Visibility)obj.GetValue(BindableIsItemsHostProperty);
public static void SetBindableIsItemsHost(DependencyObject obj, Visibility value)
=> obj.SetValue(BindableIsItemsHostProperty, value);
public static readonly DependencyProperty BindableIsItemsHostProperty =
DependencyProperty.RegisterAttached("BindableIsItemsHost", typeof(Visibility), typeof(TabAssist), new PropertyMetadata(Visibility.Collapsed, OnBindableIsItemsHostChanged));
private static void OnBindableIsItemsHostChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
{
if (d is Panel panel)
{
panel.IsItemsHost = (Visibility)e.NewValue == Visibility.Visible;
}
}
}