-
Notifications
You must be signed in to change notification settings - Fork 3.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature - Blurry Dialog Background #3738
Feature - Blurry Dialog Background #3738
Conversation
This reverts commit ede38d4.
-added DialogBackgroundBlurConverter -Blurry Background working for both the "normal" DialogHost Style and the "MaterialDesignEmbeddedDialogHost"
return new BlurEffect() { Radius = blurRadius }; | ||
} | ||
|
||
return null; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the "Build and Test" failing because I am returning null from this converter?
Should this rather be DependencyProperty.UnsetValue
or Binding.DoNothing
?
I am never sure on which one to use.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@corvinsz It's the analyzers yelling at you here. Basically you need to add a ? to the return type, the values
parameter, and the parameter
parameter to indicate nullability.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for clarifying @nicolaihenriksen
I'm still doing alot of .NET Framework 4.x work due to legacy projects and I always forget about the nullability in .NET 5+
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very nicely done. One small comment then I think we can merge this.
src/MaterialDesignThemes.Wpf/Converters/DialogBackgroundBlurConverter.cs
Outdated
Show resolved
Hide resolved
…nverter.cs converter nullability Co-authored-by: Kevin B <Keboo@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome job, thank you!
I recently came across @Keboo 's video (C#/Blazor - Trying out MudBlazor on an app) about MudBlazor, where they have implemented a Dialog that blurs the background if opened.
This is my aproach of implementing the above mechanism in MDIX.
API proposal
I added 2 new dependency properties to the
DialogHost.cs
:Bool
False
double
I essentially just added the 2 new dependency properties above, and some logic to apply a
BlurEffect
on theDialogHost
sContentPresenter
.The logic is contained in the newly added converter
DialogBackgroundBlurConverter
.I don't know why GitHub shows the images in the column "Default Style" in a smaller format, all images are the same exact size :-((Apparently it's just the preview of the markdown that is not display it correctly)