Toasts
Transient notifications stacked in a corner of the window, above page content and overlays, auto-dismissed after 5 seconds by default (ToastOptions.Duration) unless sticky.
Hosting the toasts
A ToastContainer bound to the same ToastService renders them. It wraps the content it sits above, so wrapping the whole window keeps the toasts on top of everything:
<feedback:ToastContainer Toasts="{Binding Toasts}">
<!-- the whole app -->
</feedback:ToastContainer>
The container creates a ToastService of its own when none is bound; bind one from your shell view model to share it with the pages, behind IToastService.
When the app also uses an OverlayContainer, wrap it inside the ToastContainer so toasts stay above the modal overlays:
<feedback:ToastContainer Toasts="{Binding Toasts}">
<nav:OverlayContainer Overlays="{Binding Overlays}">
<!-- the whole app -->
</nav:OverlayContainer>
</feedback:ToastContainer>
Toast types
Show them from an injected IToastService (in Joufflu.Feedback):
toasts.Info("A neutral message.", "Heads up");
toasts.Success("Saved.");
toasts.Warning("Careful.");
toasts.Error("Failed.");
toasts.Show(new ToastOptions { Message = "Sticky", Duration = TimeSpan.Zero });
A Duration of TimeSpan.Zero makes a toast sticky: it stays until the user closes it.
Loading toast
A loading toast shows a spinner and stays until updated. Change its type, title, message or duration from the returned instance once the work progresses or ends:
ToastInstance toast = toasts.Loading("Preparing…", "Uploading files");
toast.Message = "File 1 of 3";
// once done
toast.Type = ToastType.Success;
toast.Title = "Upload complete";
toast.Message = "3 files uploaded.";
toast.Duration = TimeSpan.FromSeconds(5); // starts the auto-dismiss
Every ToastInstance can be updated this way, not only loading ones. Changing Duration restarts the countdown from that moment. toasts.Close(toast) removes a toast early.
Position
The ToastContainer’s Position picks the corner the stack sits in: TopRight (the default), TopLeft, BottomRight or BottomLeft. The newest toast always sits closest to that corner, so the stack grows away from it. Bind it to change corners at runtime — the gallery’s Toasts page does exactly that.
<feedback:ToastContainer Toasts="{Binding Toasts}" Position="BottomRight">
<!-- the whole app -->
</feedback:ToastContainer>