lepoco / wpfui

WPF UI provides the Fluent experience in your known and loved WPF framework. Intuitive design, themes, navigation and new immersive controls. All natively and effortlessly.
https://wpfui.lepo.co
MIT License
7.03k stars 666 forks source link

Snackbar no longer appears when setting Opacity via App.xaml style #1087

Open jonmotos opened 1 month ago

jonmotos commented 1 month ago

Describe the bug

I am attempting to set the opacity of all my snackbars to 1 (fully opaque) in order to prevent display oddities that occur when displaying snackbars over other controls (pictured, perhaps another bug?) image

When setting the opacity to 1 via App.xaml Application.Resources, snackbars no longer appear at all.

To Reproduce

  1. Create a SnackbarPresenter via Grid

    <Grid>
    <ContentPresenter/>
    <SnackbarPresenter/>
    </Grid>
  2. Set the Snackbar style in Application.Resources

    <Application ...>
    <Application.Resources>
    <ResourceDictionary>
      <Style TargetType="ui:Snackbar">
        <Setter Property="Opacity" Value="0"/>
      </Style>
    </ResourceDictionary>
    </Application.Resources>
    </Application>
  3. Set the Snackbar content via SnackbarService

Expected behavior

I would expect the opacity of the Snackbar to be 1 and the Snackbar to appear as usual.

Screenshots

No response

OS version

Windows 11

.NET version

Net8.0-Windows

WPF-UI NuGet version

3.0.4

Additional context

It appears ANY property set this way prevents a snackbar from appearing. At the end of the day, what I really want to be able to do is have a clear way to prevent the snackbar from having any transparency. I believe by default it should be opaque. I would be happy to add an example Snackbar usage to the documentation.