microsoft / fluentui-blazor

Microsoft Fluent UI Blazor components library. For use with ASP.NET Core Blazor applications
https://www.fluentui-blazor.net
MIT License
3.73k stars 359 forks source link

How to make Toast show using the templated code? #964

Closed dannypang closed 10 months ago

dannypang commented 10 months ago

Hi I am new to the Blazor FluentUI and have been trying very hard to figure out how to make the Toast showing on the UI.

I followed the instructions and put in the FluentToastProvider in the end of the MainLayout.razor. But, there is not showing any toast.

I used the templates to generate the skeleton code but I can't make it to work. Can any of you please help? Is there any examples that show how it works?

Thanks a lot.

vnbaaij commented 10 months ago

Hi,

Please see the examples at https://www.fluentui-blazor.net/Toast

gsnyder87 commented 10 months ago

I agree that something is missing from the documentation on how to get the toast to work.
I have the FluentToastProvider MaxToastCount="10"added to my mainLayout page and am Injecting IToastService onto my component, but the toast never shows up when activating the ToastService.ShowToast method.

MSFTJim commented 7 months ago

I had the same issue, I think I was not clear after reading the docs on adding render mode. I added it globally to the app.razor and it worked properly. I then tested by adding rendermode to just the toast component, and that also worked.

Here is an example: <FluentToastProvider @rendermode="InteractiveServer" MaxToastCount="10" />

Hope that helps some folks!!