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

Toaster.cs 965B

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