How do i control KeyTip 'scoping' inside a Backstage panel?

Ribbon for WPF Forum

Posted 6 years ago by Anargyros Tomaras
Version: 14.1.0601
Avatar

What options do i have for defining my own custom KeyTip scoping rules?
Do i need to use TaskTabItems?
Can i flag any kind of Panel as a KeyTipScope and have it's children's KeyTips appear
when the Pane's Access Key is pressed?

Also, how come the KeyTip feature comes with the restriction that uielements need to inherit from a control that
implements IKeyTipTarget?
Wouldn't it be more flexible if it was solved using an Attached Property of type IKeyTipTarget so i can
KeyTip-Enable any kind of UIElement i want without having to build my own uielement inheritance structure?

Besides that, is there a way for me to know more technical details about this feature?

[Modified 6 years ago]

Comments (3)

Posted 6 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar

We don't really have any documentation at the moment for extending to custom controls.  But you can use the KeyTipService.IsKeyTipScope to mark controls that are a scope.  And if an element supports key tips, it can implement IKeyTipTarget and should have the KeyTipService.KeyTipAccessText attached property set.  Sorry but the interface is needed since a method needs to be called on it.  I believe that if you do those things, you can get custom controls working with key tips.


Actipro Software Support

Posted 6 years ago by Anargyros Tomaras
Avatar

I understand that the interface is needed but i was wondering why instead of the KeyTipService doing a "UIElement as IKeyTipTarget" check only cant it also do a "UIElement.GetValue(KeyTipService.KeyTipTargetProperty) != null" check to figure out if an element supports tips? This way i can attach a KeyTipTarget implementation on my existing controls. Ofc the interface would change slightlly so it gets the actual element as parameter for example 

interface IKeyTipTarget { bool NotifyTipAccessed(UIElement element, string keyTipAccessText); }

Answer - Posted 6 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar

At the time all the key tip logic was written (pre-Backstage), there wasn't really a place to inject custom controls into the Ribbon other than the controls we had pre-built, which implemented the interface.  Backstage allows a little more flexibility since you can put custom controls on the tabs.  Note that you don't need to use the interface though.  I believe key tips will still work with a control if it doesn't implement the interface, and it will fall back to focusing the control.


Actipro Software Support

The latest build of this product (v2019.1 build 0684) was released 16 days ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.