Class Snackbar
Snackbar inform user of a process that an app has performed or will perform. It appears temporarily, towards the bottom of the window.
public class Snackbar : ContentControl, IAnimatable, IFrameworkInputElement, IInputElement, ISupportInitialize, IQueryAmbient, IAddChild, IAppearanceControl, IIconControl
- Inheritance
-
Snackbar
- Implements
- Inherited Members
Constructors
Snackbar(SnackbarPresenter)
Initializes a new instance of the Snackbar class with a specified presenter.
public Snackbar(SnackbarPresenter presenter)
Parameters
presenter
SnackbarPresenterThe SnackbarPresenter to manage the snackbar's display and interactions.
Fields
AppearanceProperty
Identifies the Appearance dependency property.
public static readonly DependencyProperty AppearanceProperty
Field Value
ClosedEvent
Identifies the Closed routed event.
public static readonly RoutedEvent ClosedEvent
Field Value
ContentForegroundProperty
Identifies the ContentForeground dependency property.
public static readonly DependencyProperty ContentForegroundProperty
Field Value
IconProperty
Identifies the Icon dependency property.
public static readonly DependencyProperty IconProperty
Field Value
IsCloseButtonEnabledProperty
Identifies the IsCloseButtonEnabled dependency property.
public static readonly DependencyProperty IsCloseButtonEnabledProperty
Field Value
IsShownProperty
Identifies the IsShown dependency property.
public static readonly DependencyProperty IsShownProperty
Field Value
OpenedEvent
Identifies the Opened routed event.
public static readonly RoutedEvent OpenedEvent
Field Value
SlideTransformProperty
Identifies the SlideTransform dependency property.
public static readonly DependencyProperty SlideTransformProperty
Field Value
TemplateButtonCommandProperty
Identifies the TemplateButtonCommand dependency property.
public static readonly DependencyProperty TemplateButtonCommandProperty
Field Value
TimeoutProperty
Identifies the Timeout dependency property.
public static readonly DependencyProperty TimeoutProperty
Field Value
TitleProperty
Identifies the Title dependency property.
public static readonly DependencyProperty TitleProperty
Field Value
TitleTemplateProperty
Identifies the TitleTemplate dependency property.
public static readonly DependencyProperty TitleTemplateProperty
Field Value
Properties
Appearance
Gets or sets the Appearance of the control, if available.
[Bindable(true)]
public ControlAppearance Appearance { get; set; }
Property Value
ContentForeground
Gets or sets the foreground of the Content.
[Bindable(true)]
public Brush ContentForeground { get; set; }
Property Value
Icon
Gets or sets the icon
[Bindable(true)]
public IconElement? Icon { get; set; }
Property Value
IsCloseButtonEnabled
Gets or sets a value indicating whether the Snackbar close button should be visible.
public bool IsCloseButtonEnabled { get; set; }
Property Value
IsShown
Gets or sets a value indicating whether the Snackbar is visible.
public bool IsShown { get; set; }
Property Value
Presenter
protected SnackbarPresenter Presenter { get; }
Property Value
SlideTransform
Gets or sets the transform.
public TranslateTransform? SlideTransform { get; set; }
Property Value
TemplateButtonCommand
Gets the command triggered after clicking the button in the template.
public IRelayCommand TemplateButtonCommand { get; }
Property Value
Timeout
Gets or sets a time for which the Snackbar should be visible.
public TimeSpan Timeout { get; set; }
Property Value
Title
Gets or sets the title of the Snackbar.
public object? Title { get; set; }
Property Value
TitleTemplate
Gets or sets the title template of the Snackbar.
public DataTemplate? TitleTemplate { get; set; }
Property Value
Methods
Hide()
Hides the Snackbar
protected virtual void Hide()
OnClosed()
protected virtual void OnClosed()
OnIsShownChanged(DependencyPropertyChangedEventArgs)
protected void OnIsShownChanged(DependencyPropertyChangedEventArgs e)
Parameters
OnOpened()
protected virtual void OnOpened()
Show()
Shows the Snackbar
public virtual void Show()
Show(bool)
Shows the Snackbar
public virtual void Show(bool immediately)
Parameters
immediately
bool
ShowAsync()
Shows the Snackbar.
public virtual Task ShowAsync()
Returns
ShowAsync(bool)
Shows the Snackbar.
public virtual Task ShowAsync(bool immediately)
Parameters
immediately
bool
Returns
Events
Closed
Occurs when the snackbar is about to close.
public event TypedEventHandler<Snackbar, RoutedEventArgs> Closed
Event Type
Opened
Occurs when the snackbar is about to open.
public event TypedEventHandler<Snackbar, RoutedEventArgs> Opened