From 9f06225ad711284e8fe001f10edb52c1dc0fc94c Mon Sep 17 00:00:00 2001 From: batzen Date: Thu, 27 Nov 2014 23:14:45 +0100 Subject: [PATCH] Fixes #25 by checking if Menu is present in Ribbon --- Fluent/Services/KeyTipService.cs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Fluent/Services/KeyTipService.cs b/Fluent/Services/KeyTipService.cs index 8bcc780f4..70a9549df 100644 --- a/Fluent/Services/KeyTipService.cs +++ b/Fluent/Services/KeyTipService.cs @@ -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(this.ribbon.Menu, obj => obj.Visibility == Visibility.Visible && obj.IsOpen); if (control == null) @@ -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(this.ribbon.Menu, obj => obj.Visibility == Visibility.Visible); if (control == null)