This project is read-only.

Issue Avalon.Aero + MS Ribbon for WPF = display bug

Nov 23, 2010 at 5:36 PM
Edited Nov 23, 2010 at 5:40 PM

Good day. Just started learning WPF, has faced the following problem. When using Avalon. Aero + Microsoft Ribbon control has some errors displaying the interface. The problem probably in the styles, but I yet don't have knowledge to solve it. I will be very grateful for the help and sorry for my english :)

Test project

Screenshots

Aero style

Uploaded with ImageShack.us

Wizard97 style

Uploaded with ImageShack.us

Nov 23, 2010 at 9:41 PM
Edited Nov 23, 2010 at 9:45 PM

Hello.

This happens because of two main reasons:

  1. The wizard uses DwmExtendFrameIntoClientArea Win API function to create the glass header. It was supposed that the wizard control in always located at the top of the window (like in Microsoft guidelines), so only the top margin of the window frame is extended into client area. That's why the area behind the wizard header is black when it's not located at the top of the window.
  2. RibbonWindow actually seems to be a borderless window. It emulates the borders by using DwmExtendFrameIntoClientArea too. This is the cause of the black borders.

The problem can be fixed rather easily.

If you want to have a transparent header you should find the lines 151-157 in AeroWizardHeader.cs:

var margins = new WinApi.Margins
    {
        Left = 0,
        Right = 0,
        Top = (int)Math.Round(this.ActualHeight * dpiY, MidpointRounding.AwayFromZero),
        Bottom = 0
    };
and replace them with the following:
var margins = new WinApi.Margins(true);

If you would like to use your own brush for the header, you can remove the lines 150-159 from AeroWizardHeader.cs and also remove AeroWizardHeader style from the Aero.NormalColor.xaml. Then you will be able to set the header background in Generic.xaml.

I've also created a work item in order to support different header rendering modes for Aero Wizard Header.

Nov 24, 2010 at 9:26 AM

Has understood and solved the problem, thanks for the help :)