private void BtnDisplayMultiple_Click(object sender, EventArgs e) { for (var i = 1; i <= (int)numofToasts.Value; i++) { Toast.Build(this, $"This is Toast {i}").Show(); } }
private void BtnSimpeWithCustomText_Click(object sender, EventArgs e) { if (!_isDisplayedSimple2) { Toast.Build(this, string.IsNullOrEmpty(txtText.Text) ? "Hello, I am Toast!" : txtText.Text).Show(); _isDisplayedSimple2 = !_isDisplayedSimple2; } }
private async void BtnShowToastDemo_Click(object sender, EventArgs e) { if (!_isDisplayedSimple1) { Toast.Build(this, "Hello, I am Toast!", "").Show(); _isDisplayedSimple1 = true; await Task.Delay(1000); _isDisplayedSimple1 = false; } }
private void BtnToastTextImage_Click(object sender, EventArgs e) { if (picThumbnail.Image == null) { MessageBox.Show("Please choose an image", "Image required"); return; } if (string.IsNullOrEmpty(txttextImage.Text)) { txttextImage.Text = "Hello! I'm Toast! :)"; } var toast = Toast.Build(this, txttextImage.Text, picThumbnail.Image); toast.OnClick += Toast_OnClick; toast.Show(); }
private void BtnToastWithAnimation_Click(object sender, EventArgs e) { Toast.Build(this, string.IsNullOrEmpty(txtAnimation.Text) ? "Hello, I am Toast!" : txtAnimation.Text, rFade.Checked ? Animation.FADE : Animation.SLIDE).Show(); }