Exemplo n.º 1
0
        public static void ShowToastr(ToastrType toastrType, string message, string title = null, ToastrOptions options = null)
        {
            switch (toastrType)
            {
            case ToastrType.Success:
                JsRuntime.InvokeAsync <string>("toastrInterop.success", message, title, JsonConvert.SerializeObject(toastrOptions ?? options.ToInternal()));
                break;

            case ToastrType.Info:
                JsRuntime.InvokeAsync <string>("toastrInterop.info", message, title, JsonConvert.SerializeObject(toastrOptions ?? options.ToInternal()));
                break;

            case ToastrType.Warning:
                JsRuntime.InvokeAsync <string>("toastrInterop.warning", message, title, JsonConvert.SerializeObject(toastrOptions ?? options.ToInternal()));
                break;

            case ToastrType.Error:
                JsRuntime.InvokeAsync <string>("toastrInterop.error", message, title, JsonConvert.SerializeObject(toastrOptions ?? options.ToInternal()));
                break;

            default:
                break;
            }
        }
Exemplo n.º 2
0
 private static void ConfigOptions(ToastrOptions extOptions)
 {
     Interop.toastrOptions = extOptions.ToInternal();
 }