Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions MaterialDesignThemes.Wpf/TabAssist.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,20 +16,20 @@ public static class TabAssist

public static bool GetHasUniformTabWidth(DependencyObject element) => (bool)element.GetValue(HasUniformTabWidthProperty);

internal static bool GetBindableIsItemsHost(DependencyObject obj)
=> (bool)obj.GetValue(BindableIsItemsHostProperty);
internal static Visibility GetBindableIsItemsHost(DependencyObject obj)
=> (Visibility)obj.GetValue(BindableIsItemsHostProperty);

internal static void SetBindableIsItemsHost(DependencyObject obj, bool value)
internal static void SetBindableIsItemsHost(DependencyObject obj, Visibility value)
=> obj.SetValue(BindableIsItemsHostProperty, value);

internal static readonly DependencyProperty BindableIsItemsHostProperty =
DependencyProperty.RegisterAttached("BindableIsItemsHost", typeof(bool), typeof(TabAssist), new PropertyMetadata(false, OnBindableIsItemsHostChanged));
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 = (bool)e.NewValue;
panel.IsItemsHost = (Visibility)e.NewValue == Visibility.Visible;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -50,14 +50,14 @@
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
Focusable="False"
wpf:TabAssist.BindableIsItemsHost="{Binding IsVisible, RelativeSource={RelativeSource Self}}"
wpf:TabAssist.BindableIsItemsHost="{Binding Visibility, RelativeSource={RelativeSource Self}}"
KeyboardNavigation.TabIndex="1"
Rows="1" />
<VirtualizingStackPanel x:Name="HeaderPanel"
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
Focusable="False"
wpf:TabAssist.BindableIsItemsHost="{Binding IsVisible, RelativeSource={RelativeSource Self}}"
wpf:TabAssist.BindableIsItemsHost="{Binding Visibility, RelativeSource={RelativeSource Self}}"
KeyboardNavigation.TabIndex="1"
Orientation="Horizontal" />
</StackPanel>
Expand Down