private void Show(ToastData data, DataTemplate template = null) { if (template == null) { template = this.Resources["iconToastTemplate"] as DataTemplate; } container.ContentTemplate = template; container.Content = data; if (DevUtil.DeviceFamily == DeviceFamilyType.Desktop) { if (data.Type == ToastIconType.None) { root.Height = 50; root.Width = 280; } else { root.Height = 170; root.Width = 270; } } if (ParentDialog == null) { MDilog.Show(this, true, false, false, true); } DispatcherUtil.Run(() => { VisualStateManager.GoToState(this, "ShowState", true); TryStartTimer(); }); }
public static void ShowToast(string description, ToastIconType type, string title = null) { var _data = new ToastData() { Title = title, Description = description, Type = type }; _instance.Show(_data); }