You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Connected.Components/Components/Snackbar/SnackbarConfiguration.cs

75 lines
1.4 KiB

2 years ago
//Copyright(c) Alessandro Ghidini.All rights reserved.
//Changes and improvements Copyright (c) The MudBlazor Team.
namespace Connected.Components;
public class SnackbarConfiguration : CommonSnackbarOptions
{
private bool _newestOnTop;
private bool _preventDuplicates;
private int _maxDisplayedSnackbars;
private string _positionClass;
private bool _clearAfterNavigation;
internal event Action OnUpdate;
public bool NewestOnTop
{
get => _newestOnTop;
set
{
_newestOnTop = value;
OnUpdate?.Invoke();
}
}
public bool PreventDuplicates
{
get => _preventDuplicates;
set
{
_preventDuplicates = value;
OnUpdate?.Invoke();
}
}
public int MaxDisplayedSnackbars
{
get => _maxDisplayedSnackbars;
set
{
_maxDisplayedSnackbars = value;
OnUpdate?.Invoke();
}
}
public string PositionClass
{
get => _positionClass;
set
{
_positionClass = value;
OnUpdate?.Invoke();
}
}
public bool ClearAfterNavigation
{
get => _clearAfterNavigation;
set
{
_clearAfterNavigation = value;
OnUpdate?.Invoke();
}
}
public SnackbarConfiguration()
{
PositionClass = Defaults.Classes.Position.TopRight;
NewestOnTop = false;
PreventDuplicates = true;
MaxDisplayedSnackbars = 5;
}
}