Skip to content

Commit

Permalink
Fixes #25 by checking if Menu is present in Ribbon
Browse files Browse the repository at this point in the history
  • Loading branch information
batzen committed Nov 27, 2014
1 parent 17fbb39 commit 9f06225
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions Fluent/Services/KeyTipService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -371,6 +371,11 @@ private void Show()

private Backstage GetBackstage()
{
if (this.ribbon.Menu == null)
{
return null;
}

var control = this.ribbon.Menu as Backstage ?? UIHelper.FindImmediateVisualChild<Backstage>(this.ribbon.Menu, obj => obj.Visibility == Visibility.Visible && obj.IsOpen);

if (control == null)
Expand All @@ -385,6 +390,11 @@ private Backstage GetBackstage()

private ApplicationMenu GetApplicationMenu()
{
if (this.ribbon.Menu == null)
{
return null;
}

var control = this.ribbon.Menu as ApplicationMenu ?? UIHelper.FindImmediateVisualChild<ApplicationMenu>(this.ribbon.Menu, obj => obj.Visibility == Visibility.Visible);

if (control == null)
Expand Down

0 comments on commit 9f06225

Please sign in to comment.