开发者

How to disable hide/unhide in WPF Ribbon Control

开发者 https://www.devze.com 2023-03-16 15:45 出处:网络
I am using the latest Ribbon Control from MS. When one double click the Tab Header, the whole Ribbon will hide the content and show only the header text. I want to disable this hide/unhide feature. So

I am using the latest Ribbon Control from MS. When one double click the Tab Header, the whole Ribbon will hide the content and show only the header text. I want to disable this hide/unhide feature. So even if user double click Tab Header, the Ribbon remain as it is.

I think it should be the OnMouseDoubleClick Ev开发者_如何学运维ent in RibbonTab but have no clue how to override it. Am I suppose to give it a x:Name to each and every RibbonTab then write an empty method ribbonTab1_OnMouseDoubleClick to each Ribbon Tab?


Use the PreviewMouseDoubleClick event in the Ribbon:

PreviewMouseDoubleClick="ribbon_PreviewMouseDoubleClick"

and then in the handler, mark the event as handled:

private void ribbon_PreviewMouseDoubleClick(object sender, MouseButtonEventArgs e)
{
    e.Handled = true;
}
0

精彩评论

暂无评论...
验证码 换一张
取 消