diff --git a/Changelog.md b/Changelog.md index 6e3839c1d..b6e52b1b0 100644 --- a/Changelog.md +++ b/Changelog.md @@ -45,6 +45,7 @@ - [#269](../../issues/269) - Show underscore of header text on RibbonTabItem - [#272](../../issues/272) - Changing RibbonThemeColorBrush does not change background of ItemsPanel in Backstage - [#274](../../issues/274) - RadioButton Icon and LargeIcon + - [#280](../../issues/280) - Keytips of the Ribbon overlay StartScreen - OpenBackstage command was not acting on the correct backstage in a multiple backstage scenario (thanks to @maurosampietro) - ### Enhancements diff --git a/Fluent.Ribbon/Services/KeyTipService.cs b/Fluent.Ribbon/Services/KeyTipService.cs index 16005528e..193187f37 100644 --- a/Fluent.Ribbon/Services/KeyTipService.cs +++ b/Fluent.Ribbon/Services/KeyTipService.cs @@ -395,7 +395,8 @@ private void Show() // Special behavior for backstage var specialControl = this.GetBackstage() - ?? (DependencyObject)this.GetApplicationMenu(); + ?? this.GetApplicationMenu() + ?? this.GetStartScreen(); if (specialControl != null) { @@ -407,14 +408,14 @@ private void Show() } } - private Backstage GetBackstage() + private DependencyObject 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); + var control = this.ribbon.Menu as Backstage ?? UIHelper.FindImmediateVisualChild(this.ribbon.Menu, obj => obj.Visibility == Visibility.Visible); if (control == null) { @@ -426,7 +427,7 @@ private Backstage GetBackstage() : null; } - private ApplicationMenu GetApplicationMenu() + private DependencyObject GetApplicationMenu() { if (this.ribbon.Menu == null) { @@ -445,6 +446,20 @@ private ApplicationMenu GetApplicationMenu() : null; } + private DependencyObject GetStartScreen() + { + var control = this.ribbon.StartScreen; + + if (control == null) + { + return null; + } + + return control.IsOpen + ? control + : null; + } + private void DirectlyForwardToSpecialControl(DependencyObject specialControl) { var keys = KeyTip.GetKeys(specialControl);