mrousavy / Toast

:bread: The rounded and animated Android Toast for .NET WPF/XAML

Home Page:https://mrousavy.github.io/Toast/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Toast

Android Toast for WPF

Download the Demo (.exe)

NuGet

Buy Me a Coffee at ko-fi.com

How to use

1. Add Binaries

2. Add the reference

  • XAML Window
<Window x:Class="ToastDemo.MainWindow"
     [...]
     ----IMPORTANT LINE!----
     xmlns:toast="clr-namespace:Toast;assembly=Toast"
     [...] >
  • C# (using)
using Toast;
  • VB (using)
Imports Toast

3. Add Toast to Window/User Control

  • XAML
<toast:Toast x:Name="myToast" Message="Hello World!" Duration="0:0:0:5"/>
  • C#
// (Or in code)
Toast myToast = new Toast();
myToast.DurationToast = Toast.Toast.ToastDuration.Long;
myToast.Message = "Hello World!";

someControl.Children.Add(myToast);
someOtherControl.Content = myToast;

4. Set desired Parameters

  • Toast.Duration/Toast.DurationToast: The display-time of this Toast
  • Toast.Message/Toast.Content: The Message to display (Can also be a {Binding})
  • Toast.DurationAnimation: The duration of the fade-in/out animation

5. Show Toast

myToast.Show();

6. (Optional) Hide Toast manually:

myToast.Hide();

Screenshots

Thanks for using Toast!

About

:bread: The rounded and animated Android Toast for .NET WPF/XAML

https://mrousavy.github.io/Toast/

License:MIT License


Languages

Language:C# 92.3%Language:HTML 7.7%