Table of Contents

Class SnackbarService

Namespace
Wpf.Ui
Assembly
Wpf.Ui.dll

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

TimeSpan

Methods

GetSnackbarPresenter()

Provides direct access to the ContentPresenter

public SnackbarPresenter? GetSnackbarPresenter()

Returns

SnackbarPresenter

Snackbar currently in use.

SetSnackbarPresenter(SnackbarPresenter)

public void SetSnackbarPresenter(SnackbarPresenter contentPresenter)

Parameters

contentPresenter SnackbarPresenter

ContentPresenter 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 string

Name displayed on top of snackbar.

message string

Message inside the snackbar.

appearance ControlAppearance

Display style.

icon IconElement

Additional icon on the left.

timeout TimeSpan

The time after which the snackbar should disappear.