Class SnackbarService
A service that provides methods related to displaying the Snackbar.
public class SnackbarService : ISnackbarService
- Inheritance
-
SnackbarService
- Implements
- Inherited Members
- Extension Methods
Properties
DefaultTimeOut
Gets or sets a time for which the Snackbar should be visible. (By default 2 seconds)
public TimeSpan DefaultTimeOut { get; set; }
Property Value
Methods
GetSnackbarPresenter()
Provides direct access to the ContentPresenter
public SnackbarPresenter? GetSnackbarPresenter()
Returns
- SnackbarPresenter
Snackbar currently in use.
SetSnackbarPresenter(SnackbarPresenter)
Sets the SnackbarPresenter
public 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.
public 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.