Reputation: 16672
I've tried to set a style as explained in this answer but the title bar remains visible.
Any ideas ?
Environment : WPF 4.5 application / Visual Studio 2012 / Windows 8
Upvotes: 1
Views: 1515
Reputation: 519
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);
}
}
}
}
Upvotes: 1