Interface ISnackbarService
Represents a contract with the service that provides global Snackbar.
public interface ISnackbarService
- Extension Methods
Properties
DefaultTimeOut
Gets or sets a time for which the Snackbar should be visible. (By default 2 seconds)
TimeSpan DefaultTimeOut { get; set; }
Property Value
Methods
GetSnackbarPresenter()
Provides direct access to the ContentPresenter
SnackbarPresenter? GetSnackbarPresenter()
Returns
- SnackbarPresenter
Snackbar currently in use.
SetSnackbarPresenter(SnackbarPresenter)
Sets the SnackbarPresenter
void SetSnackbarPresenter(SnackbarPresenter contentPresenter)
Parameters
contentPresenter
SnackbarPresenterContentPresenter inside of which the snackbar will be placed. The new Snackbar will replace the current Content.
Show(string, string, ControlAppearance, IconElement?, TimeSpan)
Shows the snackbar. If it is already visible, firstly hides it for a moment, changes its content, and then shows it again.
void Show(string title, string message, ControlAppearance appearance, IconElement? icon, TimeSpan timeout)
Parameters
title
stringName displayed on top of snackbar.
message
stringMessage inside the snackbar.
appearance
ControlAppearanceDisplay style.
icon
IconElementAdditional icon on the left.
timeout
TimeSpanThe time after which the snackbar should disappear.