1

I've tried to set a style as explained in this answer but the title bar remains visible.

enter image description here

Any ideas ?

Environment : WPF 4.5 application / Visual Studio 2012 / Windows 8

Community
  • 1
  • 1
aybe
  • 15,516
  • 9
  • 57
  • 105

2 Answers2

1

You can do it in code behind on the Loaded event. Loaded="Ribbon_OnLoaded"

private void Ribbon_OnLoaded(object sender, RoutedEventArgs e)
    {
        int childControlCount = VisualTreeHelper.GetChildrenCount((System.Windows.Controls.Ribbon.Ribbon)sender);

        if (childControlCount != 0)
        {
            for (int i = 0;
                i < VisualTreeHelper.GetChildrenCount((System.Windows.Controls.Ribbon.Ribbon)sender);
                i++)
            {
                DependencyObject child = VisualTreeHelper.GetChild((System.Windows.Controls.Ribbon.Ribbon)sender, i);

                if (child is Grid)
                {
                    ((Grid)child).RowDefinitions[0].Height = new GridLength(0);
                }
            }
        }
    }
James_UK_DEV
  • 519
  • 1
  • 6
  • 17
0

The content needs to be hosted inside a RibbonWindow instead.

aybe
  • 15,516
  • 9
  • 57
  • 105
  • If I use the RibbonWindow, then indeed the problem is fixed but suddently it gets the Win2000 look. I'm running Win8x64. – Rik De Peuter Jul 22 '14 at 09:15
  • Sorry but how can you get the Win2K look in Win 8 ? You should ask a question, post a screenshot and some code so people can help you better. – aybe Jul 22 '14 at 18:37