I currently use WPF Ribbon Window and enable Aero in current window like the following photo. I like to hide title that is "Pattern Tester" because there is not enough of space to show it. But I still need original windows control box and current title (even it will be hidden) that will be shown in task manager and other ralated program like task switcher and taskbar.
相关问题
- VNC control for WPF application
- WPF Binding from System.Windows.SystemParameters.P
- XAML: Applying styles to nested controls
- How can I add a horizontal line (“goal line”) for
- How to properly change a resource dictionary
I accidentally found the answer for this question when I read & download source code in thread about WPF Title Bar Text Hardly Readable in RibbonWindow. The easiest way to solve this problem is just hidden Ribbon Title Panel control via application resource dictionary.
However, the Ribbon Contextual Tab is also hidden. For fixing this bug, I should set the content of Content Presenter of Ribbon Title Panel to empty string when current window is loaded.
The remaining question, I don't know why I cannot the following style instead of hardcode in window onload event.
In the Load event of the window, add the next line:
((System.Windows.UIElement)((System.Windows.FrameworkElement)(this.RibbonMain.Template.FindName("PART_TitleHost", this.RibbonMain) as ContentPresenter).Parent).Parent).Visibility = Visibility.Collapsed;