Category / Section
How to collapse the RibbonBar panel in WPF Ribbon control?
1 min read
Using reflection, you can access and modify the PanelState property to hide the panel of RibbonBar in WPF Ribbon control
C#
Type ribbonBarType = typeof(RibbonBar);
PropertyInfo panelStateProperty = ribbonBarType.GetProperty("PanelState", BindingFlags.Public |BindingFlags.Instance); panelStateProperty.SetValue(ribbonBar, RibbonBarState.Collapsed, null); |