Skip to content

Commit

Permalink
Fixes #223 by adding check for ResizeMode
Browse files Browse the repository at this point in the history
  • Loading branch information
batzen committed Dec 16, 2015
1 parent 81cd23c commit 8aa811e
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions Fluent.Ribbon/Controls/RibbonContextualTabGroup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ static RibbonContextualTabGroup()
}

// Coerce object style
static object OnCoerceStyle(DependencyObject d, object basevalue)
private static object OnCoerceStyle(DependencyObject d, object basevalue)
{
if (basevalue == null)
{
Expand Down Expand Up @@ -304,14 +304,11 @@ protected override void OnMouseLeftButtonUp(MouseButtonEventArgs e)
if (e.ClickCount == 1
&& firstVisibleItem != null)
{
if (firstVisibleItem.TabControlParent != null)
{
var currentSelectedItem = firstVisibleItem.TabControlParent.SelectedItem as RibbonTabItem;
var currentSelectedItem = firstVisibleItem.TabControlParent?.SelectedItem as RibbonTabItem;

if (currentSelectedItem != null)
{
currentSelectedItem.IsSelected = false;
}
if (currentSelectedItem != null)
{
currentSelectedItem.IsSelected = false;
}

e.Handled = true;
Expand Down Expand Up @@ -343,6 +340,11 @@ protected override void OnMouseDoubleClick(MouseButtonEventArgs e)
return;
}

if (this.parentWidow.ResizeMode == ResizeMode.NoResize)
{
return;
}

this.parentWidow.WindowState = this.parentWidow.WindowState == WindowState.Maximized
? WindowState.Normal
: WindowState.Maximized;
Expand All @@ -363,4 +365,4 @@ private void OnParentWindowStateChanged(object sender, EventArgs e)
this.IsWindowMaximized = this.parentWidow.WindowState == WindowState.Maximized;
}
}
}
}

0 comments on commit 8aa811e

Please sign in to comment.