public void ShowInAppNotify(string text, int duration = 1800) { try { InAppNotify.Show(text, duration); } catch { } }
internal async void PopMessage(string msg) { await Dispatcher.RunAsync(CoreDispatcherPriority.High, () => { InAppNotify.Content = msg; InAppNotify.Show(); }); dismissTimer?.Cancel(); dismissTimer = ThreadPoolTimer.CreateTimer(async(x) => { await Dispatcher.RunAsync(CoreDispatcherPriority.High, () => { InAppNotify.Dismiss(); }); }, TimeSpan.FromMilliseconds(3000)); }
public void ShowInAppNotify(string text, int duration = 1800) { try { InAppNotify.Show(text, duration); //// Show notification using a DataTemplate //object inAppNotificationWithButtonsTemplate; //bool isTemplatePresent = Resources.TryGetValue("InAppNotificationWithButtonsTemplate", out inAppNotificationWithButtonsTemplate); //if (isTemplatePresent && inAppNotificationWithButtonsTemplate is DataTemplate) //{ // InAppNotify.Show(inAppNotificationWithButtonsTemplate as DataTemplate); //} } catch { } }
internal async void ThrowException(Windows.UI.Xaml.UnhandledExceptionEventArgs e) { await Dispatcher.RunAsync(CoreDispatcherPriority.High, () => { InAppNotify.Content = " Error occured: " + e.Message + "\r\n- " + e.Exception.GetType().ToString(); InAppNotify.Show(); }); dismissTimer?.Cancel(); dismissTimer = ThreadPoolTimer.CreateTimer(async(x) => { await Dispatcher.RunAsync(CoreDispatcherPriority.High, () => { InAppNotify.Dismiss(); }); }, TimeSpan.FromMilliseconds(3000)); }