Kinnara / ModernWpf

Modern styles and controls for your WPF applications
MIT License
4.5k stars 448 forks source link

FluentWPF sample is broken #68

Open wmrutten opened 4 years ago

wmrutten commented 4 years ago

Hello Kinnara,

thank you for creating and sharing this awesome library! Quite impressive.

I'm trying to implement a navigation window with Acrylic brush and Theme support. It appears like rendering/styling of the FluentWPFSample application has been broken in the current release (8.3.0).

The AcrylicBrush is working, however the current ModernWPF DefaultWindowStyle seems to override some of the brushes. Removing the default window style restore the acrylic effect, but breaks theme support.

Cheers, keep up the good work,

Michel

andrew-boyarshin commented 4 years ago

I've hit this issue as well. To fix it I've dropped using FluentWPF default styles. Instead, I wrote a custom window style (derived from ModernWPF style) that essentially adds the acrylic layers (3 window-size visuals) to the ModernWPF window template, instead of retemplating the whole thing as AcrylicWindow does. The only missing bit was calling EnableBlur from FluentWPF internals, which I was forced to make public. I can post my solution tomorrow, but it would be better to have this built in ModernWPF instead (then, it could follow WinUI more closely).

wmrutten commented 4 years ago

Hi @andrew-boyarshin,

thanks for chipping in, that sounds promising. Definitely interested in your approach.

For now, I have managed to override the default pane background brush, to uncover the window acrylic brush:

<SolidColorBrush x:Key="NavigationViewExpandedPaneBackground" Color="Transparent" />

The FluentWPF.ExtendViewIntoTitleBar property allows me to extend the acrylic brush into the titlebar. It's a start, but I need to look further into menu styling & theme support.

andrew-boyarshin commented 4 years ago

@wmrutten take a look at my approach in the demo I've extracted from my CodeWanda project (public sources don't include UI due to the use of 3rd party components). It is a very rough code extraction (not cleaned up to be minimal, contains things specific to my project, targets .NET 5 preview builds, has extra stuff in nuget.config), but it still might be useful, and it contains the most important part in /Demo/Common folder. Note, that acrylic styling is opt-in in my solution.

Kinnara commented 4 years ago

Now that we're going to have NavigationView in v0.9, it's a good time to explore the possibilities of introducing support for acrylic.

wmrutten commented 4 years ago

Wow, NavigationView support would be really great. Looking forward to the next release!

Best regards, Michel

poochie89 commented 4 years ago

@andrew-boyarshin i was not able to get your demo to work, it gives me a black window. Is it possible to get a full working sample?

andrew-boyarshin commented 4 years ago

@poochie89 this demo is already outdated, but it was working at the time of posting that comment. It uses, for instance, MahApps navigation drawer instead of ModernWPF one, so I don't recommend basing any new apps on that sample I've posted.

poochie89 commented 4 years ago

ok thx for the quick response

mhmd-azeez commented 4 years ago

@Kinnara Hi, is there any sample on using the Acrylic brush with NavigationView in 0.9? Btw, thank you for the project. It's an excellent WPF toolkit