Skip to content
This repository has been archived by the owner on Sep 5, 2024. It is now read-only.

Set toaster position using local bind. Fixes #21 #22

Merged
merged 1 commit into from
Jul 13, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions src/Sample/Pages/Index.razor
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@
<div class="form-group row">
<label for="position" class="col-sm-6 col-form-label">Position</label>
<div class="col-sm-5">
<select id="position" class="form-control form-control-sm" @bind="toaster.Configuration.PositionClass">
<option value="toast-top-left">Top left</option>
<select id="position" class="form-control form-control-sm" @bind="_positionClass">
<option value="toast-top-left" selected>Top left</option>
<option value="toast-top-center">Top center</option>
<option value="toast-top-right">Top right</option>
<option value="toast-top-full-width">Top full width</option>
Expand Down Expand Up @@ -122,6 +122,8 @@
@code {
private string _title = "Test Title";
private string _message = "Test Message";
private string _positionClass;

private bool _showProgressBar;
private bool _showCloseIcon;
private bool _actionOnClick;
Expand All @@ -148,6 +150,7 @@

public void Show(ToastType type)
{
toaster.Configuration.PositionClass = _positionClass;
toaster.Add(type, _message, _title, config =>
{
config.ShowCloseIcon = _showCloseIcon;
Expand Down