Method Build
Build(VisualElement, string, NotificationDuration)
Build and return a Toast UI element.
The method will find the best suitable parent view which will contain the Toast element.
Declaration
public static Toast Build(VisualElement referenceView, string text, NotificationDuration duration)
Parameters
| Type | Name | Description |
|---|---|---|
| VisualElement | referenceView | An arbitrary VisualElement which is currently present in the UI panel. |
| string | text | The raw message or Localization dictionary key for the message to be displayed inside the Toast. |
| NotificationDuration | duration |
Returns
| Type | Description |
|---|---|
| Toast | The Toast instance, if no exception has occured. |
Remarks
The snackbar is not displayed directly, you have to call Show().
Exceptions
| Type | Condition |
|---|---|
| ArgumentException | The provided view is not contained in a valid UI panel. |