Question

I want to customize normal WPF Ribbon layout. As shown below I want to remove the command area of ribbon control.

enter image description here

Please suggest any way to achieve this.

Was it helpful?

Solution

I got the solution from this link

    void ribbon_Loaded(object sender, RoutedEventArgs e)
    {
        Grid child = VisualTreeHelper.GetChild((DependencyObject)sender, 0) as Grid;
        if (child != null)
        {
            child.RowDefinitions[0].Height = new GridLength(0);
        }
    }

OTHER TIPS

If you want to move the Quick Access Toolbar spacing you can change the main window to be a RibbonWindow. This will move the Quick Access Toolbar to the top title bar. If there are no items, it will be hidden.

XAML:

<ribbon1:RibbonWindow x:Class="Example.MainWindow"
   xmlns:ribbon1="clr-namespace:System.Windows.Controls.Ribbon;
      assembly=System.Windows.Controls.Ribbon"
   ...

Codebehind:

namespace Example
{
   public partial class MainWindow : RibbonWindow
   {
      ...
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top