Example #1
0
        public void BuildToastSettings(NoJSToastLevel level, string message, string headerTitle)
        {
            switch (level)
            {
            case NoJSToastLevel.Info:
                BackgroundCssClass = $"bg-info";
                IconCssClass       = "info";
                Heading            = headerTitle;// "Info";
                break;

            case NoJSToastLevel.Success:
                BackgroundCssClass = $"bg-success";
                IconCssClass       = "check";
                Heading            = headerTitle; //"Success";
                break;

            case NoJSToastLevel.Warning:
                BackgroundCssClass = $"bg-warning";
                IconCssClass       = "exclamation";
                Heading            = headerTitle;// "Warning";
                break;

            case NoJSToastLevel.Error:
                BackgroundCssClass = $"bg-danger";
                IconCssClass       = "times";
                Heading            = headerTitle; // "Error";
                break;
            }

            Message = message;
        }
Example #2
0
 public void ShowToast(string message, NoJSToastLevel level, string headerTitle)
 {
     BuildToastSettings(level, message, headerTitle);
     IsVisible = true;
     //StateHasChanged();
     InvokeAsync(() =>
     {
         StateHasChanged();
     });
 }
 public void ShowToast(string message, NoJSToastLevel level, double interval, string headerTitle)
 {
     OnShow?.Invoke(message, level, headerTitle);
     StartCountdown(interval);
 }