Exemplo n.º 1
0
 public void ShowInAppNotify(string text, int duration = 1800)
 {
     try
     {
         InAppNotify.Show(text, duration);
     }
     catch { }
 }
Exemplo n.º 2
0
        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));
        }
Exemplo n.º 3
0
        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 { }
        }
Exemplo n.º 4
0
        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));
        }