Table of Contents

Interface IToastService

Namespace
BSGameLib.UI.Toasts
Assembly
BSGameLib.UI.dll

Short messages shown near the bottom of the window, over whatever is on screen, that go away on their own.

public interface IToastService

Remarks

For the one-line outcomes a screen reports - "Could not connect", "That name is taken", "Connecting..." - which used to be a status label inside each form. A label in the layout had to have a row reserved for it, sat wherever that row ended up (off the bottom edge of a tall form), and kept its last message until something cleared it. A toast is drawn by the UI root, above every view and outside every layout, in menus and in game alike.

A channel groups the toasts one source raises: a new toast on a channel replaces the one already showing there, so "Connecting..." turns into "Could not connect" rather than the two stacking up. Toasts with no channel stack, newest at the bottom.

Properties

Style

How the toasts look.

ToastStyle Style { get; set; }

Property Value

ToastStyle

Methods

Clear()

Takes down every toast.

void Clear()

Dismiss(string)

Takes down the toast on channel, if there is one.

void Dismiss(string channel)

Parameters

channel string

Show(string, ToastKind, string)

Shows message, replacing any toast on the same channel.

void Show(string message, ToastKind kind = ToastKind.Info, string channel = null)

Parameters

message string
kind ToastKind
channel string