Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -87,11 +87,30 @@ internal bool FromKeyboard
}
}

internal virtual bool ShouldShowOnKeyboardFocus
/// <summary>
/// The DependencyProperty for the ShouldShowOnKeyboardFocus property.
/// Default: true
/// </summary>
public static readonly DependencyProperty ShouldShowOnKeyboardFocusProperty =
DependencyProperty.Register(
nameof(ShouldShowOnKeyboardFocus),
typeof(bool),
typeof(ToolTip),
new FrameworkPropertyMetadata(BooleanBoxes.TrueBox));

/// <summary>
/// Whether or not the tooltip should show on Keyboard focus.
/// </summary>
[Bindable(true), Category("Behavior")]
public bool ShouldShowOnKeyboardFocus
{
get
{
return true;
return (bool)GetValue(ShouldShowOnKeyboardFocusProperty);
}
set
{
SetValue(ShouldShowOnKeyboardFocusProperty, BooleanBoxes.Box(value));
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,13 @@ static RibbonToolTip()
DefaultStyleKeyProperty.OverrideMetadata(ownerType, new FrameworkPropertyMetadata(ownerType));
IsOpenProperty.OverrideMetadata(ownerType, new FrameworkPropertyMetadata(new PropertyChangedCallback(OnIsOpenChanged), new CoerceValueCallback(CoerceIsOpen)));
PlacementTargetProperty.OverrideMetadata(ownerType, new FrameworkPropertyMetadata(OnPlacementTargetPropertyChanged));

// DDVSO 614397: Tooltips should show on Keyboard focus.
// Override from tooltip, we don't want RibbonToolTips to show on Keyboard
// focus to keep this consistent with other Microsoft products.
// If a user needs to bring up a RibbonToolTip this change also
// introduces Ctrl+Shift+F10 as a shortcut for tooltips.
ShouldShowOnKeyboardFocusProperty.OverrideMetadata(ownerType, new FrameworkPropertyMetadata(false));
}

/// <summary>
Expand Down Expand Up @@ -128,16 +135,6 @@ private void OnPlacementTargetMouseLeave(object sender, MouseEventArgs e)

#region Public Properties

// DDVSO 614397: Tooltips should show on Keyboard focus.
// Override from tooltip, we don't want RibbonToolTips to show on Keyboard
// focus to keep this consistent with other Microsoft products.
// If a user needs to bring up a RibbonToolTip this change also
// introduces Ctrl+Shift+F10 as a shortcut for tooltips.
internal override bool ShouldShowOnKeyboardFocus
{
get { return false; }
}

/// <summary>
/// Gets or sets the Title property.
/// </summary>
Expand Down