Table of Contents

Interface ISnackbarService

Namespace
Wpf.Ui
Assembly
Wpf.Ui.dll

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

TimeSpan

Methods

GetSnackbarPresenter()

Provides direct access to the ContentPresenter

SnackbarPresenter? GetSnackbarPresenter()

Returns

SnackbarPresenter

Snackbar currently in use.

SetSnackbarPresenter(SnackbarPresenter)

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.

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.