-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7556438
commit 896446e
Showing
4 changed files
with
32 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,14 @@ | ||
using Microsoft.JSInterop; | ||
using Newtonsoft.Json; | ||
using SiemensIXBlazor.Objects; | ||
|
||
namespace SiemensIXBlazor.Components | ||
{ | ||
public partial class Toast | ||
{ | ||
public async void ShowToast(string message, string messageSeverity) | ||
public async void ShowToast(ToastConfig config) | ||
{ | ||
await JSRuntime.InvokeVoidAsync("showMessage", message, messageSeverity); | ||
await JSRuntime.InvokeVoidAsync("showMessage", JsonConvert.SerializeObject(config)); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
using System; | ||
using Newtonsoft.Json; | ||
|
||
namespace SiemensIXBlazor.Objects | ||
{ | ||
public class ToastConfig | ||
{ | ||
[JsonProperty("autoClose")] | ||
public bool AutoClose { get; set; } = true; | ||
[JsonProperty("autoCloseDelay")] | ||
public int AutoCloseDelay { get; set; } = 5000; | ||
[JsonProperty("icon")] | ||
public string? Icon { get; set; } | ||
[JsonProperty("iconColor")] | ||
public string? IconColor { get; set; } | ||
[JsonProperty("message")] | ||
public string? Message { get; set; } | ||
[JsonProperty("title")] | ||
public string? Title { get; set; } | ||
[JsonProperty("type")] | ||
public string Type { get; set; } = "info"; | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.