Skip to content

Commit

Permalink
Fixing selection issues for ribbon tabs
Browse files Browse the repository at this point in the history
  • Loading branch information
batzen committed Mar 31, 2018
1 parent c1220c8 commit 99fd3f3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Fluent.Ribbon/Controls/RibbonTabItem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -784,10 +784,10 @@ private static void OnIsSelectedChanged(DependencyObject d, DependencyPropertyCh
var newValue = (bool)e.NewValue;
if (newValue)
{
if (container.TabControlParent != null
if (container.TabControlParent?.SelectedTabItem != null
&& ReferenceEquals(container.TabControlParent.SelectedTabItem, container) == false)
{
((RibbonTabItem)container.TabControlParent.SelectedItem).IsSelected = false;
container.TabControlParent.SelectedTabItem.IsSelected = false;
}

container.OnSelected(new RoutedEventArgs(Selector.SelectedEvent, container));
Expand Down

0 comments on commit 99fd3f3

Please sign in to comment.