-
-
Notifications
You must be signed in to change notification settings - Fork 51
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add RenderFragment content to ToastMessage (#965)
* Add RenderFragment content to ToastMessage * Toasts demo updated. --------- Co-authored-by: Nathan Phillips <[email protected]> Co-authored-by: Vikram Reddy <[email protected]>
- Loading branch information
1 parent
535023e
commit d971eae
Showing
5 changed files
with
24 additions
and
0 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
16 changes: 16 additions & 0 deletions
16
BlazorBootstrap.Demo.RCL/Components/Pages/Toasts/Toasts_Demo_07_Toast_With_Content.razor
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,16 @@ | ||
<Toasts class="p-3" Messages="messages" /> | ||
|
||
<Button Class="btn btn-primary" @onclick="ShowToast">Toast with Content</Button> | ||
|
||
@code { | ||
List<ToastMessage> messages = []; | ||
|
||
private void ShowToast() => | ||
messages.Add( | ||
new ToastMessage | ||
{ | ||
Type = ToastType.Info, | ||
Title = "Blazor Bootstrap", | ||
Content = @<div>Hello, world! This is a toast message. <button class="btn btn-sm btn-primary mt-2" @onclick="ShowToast">Show more toast</button></div>, | ||
}); | ||
} |
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
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
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