Hi!
We're using a RibbonWindow for our application, with some customizations - we've overriden the ArrangeOverride method in the window in order to place the ribbon tabs over the window titlebar:
protected override Size ArrangeOverride(Size arrangeBounds)
{
Size size = base.ArrangeOverride(arrangeBounds);
try
{
Grid TitleBar = this.Template.FindName("PART_TitleBar", (FrameworkElement)this) as Grid;
if (TitleBar != null)
{
double TitleBarHeight = TitleBar.ActualHeight + 4.0;
this.ribbon.ApplicationMenu.Margin = new Thickness(0.0, TitleBarHeight, 0.0, 0.0);
this.ribbon.Margin = new Thickness(0.0, -TitleBarHeight, 0.0, 0.0);
}
}
catch (Exception ex)
{
}
return size;
}
This works perfectly if system scaling is disabled (set to 100%, please see screenshot below):
https://www.dropbox.com/s/x046ihyx28gqfpc/100scaling.png?dl=0
The problem shows up when using any sort of scaling, as the ribbon seems to be drawn under the actual window titlebar. I've modified the margin using Snoop to show this effect (please see screenshot below):
https://www.dropbox.com/s/o10gwyvtl672xvp/125scaling.png?dl=0
I can't seem to figure out why this is happening and what's different when using scaling. I've tried messing around with a lot of properties, but haven't managed to fix this. How can I place the ribbon tabs over the window titlebar, even when using scaling?
Regards,
Cristian