I am putting some custom controls, e.g. drop down buttons, custom menu items, none of them are inherited from any Tool button. When I press Alt to access their key tip, seems like they have been automatically assign.
Q1: how can i change the key tip content?
Q2: when i press a key tip for a custom drop down, it can be only be focused. How can i interfere with the behavior to make the drop down open?
Thanks, Nathan
Examples:
<igRibbon:XamRibbon.Tabs> <igRibbon:RibbonTabItem Header="Shared_Tab_Format_Header"> <igRibbon:RibbonGroup VerticalAlignment="Top" Caption="Shared_Tab_Format_Group_GlobalFont_Caption" Id="FontGlobal"> <StackPanel Margin="0,0,0,0" VerticalAlignment="Top" Orientation="Horizontal"> <ns:MenuButton igRibbon:RibbonGroup.MaximumSize="ImageOnly" igRibbon:RibbonToolHelper.KeyTip="CC" ButtonType="Segmented">
<igRibbon:MenuTool.SmallImage> <BitmapImage UriSource="/WpfApplication2;component/Resources/rebalance_session_16.png" /> </igRibbon:MenuTool.SmallImage> <ns:MenuItemEx Header="Hello" IsCheckable="True" /> <ns:MenuItemEx Header="Hello1" /> <ns:MenuItemEx Header="Hello2" InputGestureText="CTRL+R"/> </ns:MenuButton> <igRibbon:LabelTool x:Name="lb" HorizontalAlignment="Right" Caption="Good!" /> </StackPanel> </igRibbon:RibbonGroup> </igRibbon:RibbonTabItem> </igRibbon:XamRibbon.Tabs>
Indeed, ns:MenuItemEx is my a control inherited from MenuItem, IKeyTip.
ns:MenuButton is a menu button which is inherited from ItemsControl and IKeyTipContainer. The drop down which contains MenuItemEx will show up after pressing 'CC', achieved by codes below:
public IKeyTip[] GetKeyTips() { var keyTips = new List<IKeyTip>(); if (Items.Count == 0) return keyTips.ToArray();
foreach (var sub in Items) { var keyTip = sub as IKeyTip; if (keyTip == null) continue;
keyTips.Add(keyTip); }
_dropdownPopup.IsOpen = true; return keyTips.ToArray(); }
but after pop up showing up, there is no key tip for MenuItemEx at all.
Let me know if any questions.
Thanks,
Nathan
Hello Nathan,
Can you possibly send a small sample that can reproduce your problem?
Thank you,
Mihoko Kamiishi
I can manage to open the drop down and set my custom KeyTip, but still have 1 issue:
I have another custom control (like MenuItemEx) in my drop down, how can i set key tip onto those MenuItemEx?
I found an interface IKeyTip, but failed to add KeyTip to it.
Any ideas please?