PWA Fundvelo der Caritas.
選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

Toaster.cs 890B

1234567891011121314151617181920212223242526272829303132
  1. using MatBlazor;
  2. using System;
  3. using System.Collections.Generic;
  4. using System.Linq;
  5. using System.Threading.Tasks;
  6. namespace CaritasPWA.Shared.Services {
  7. public class Toaster {
  8. private readonly IMatToaster matToaster;
  9. public Toaster(IMatToaster toaster) {
  10. this.matToaster = toaster;
  11. }
  12. public void ShowInfo(string title, string message, string icon = "") {
  13. matToaster.Add(message, MatBlazor.MatToastType.Info, title, icon);
  14. }
  15. public void ShowWarning(string title, string message, string icon = "") {
  16. matToaster.Add(message, MatBlazor.MatToastType.Warning, title, icon);
  17. }
  18. public void ShowError(string title, string message, string icon = "") {
  19. matToaster.Add(message, MatBlazor.MatToastType.Danger, title, icon);
  20. }
  21. }
  22. }