• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# ToastPrompt类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中ToastPrompt的典型用法代码示例。如果您正苦于以下问题:C# ToastPrompt类的具体用法?C# ToastPrompt怎么用?C# ToastPrompt使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



ToastPrompt类属于命名空间,在下文中一共展示了ToastPrompt类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: InitializePrompt

        private void InitializePrompt()
        {
            //var reuseObject = ReuseObject.IsChecked.GetValueOrDefault(false);

            if (_prompt != null)
            {
                _prompt.Completed -= PromptCompleted;
            }

            //if (!reuseObject || _prompt == null)
            {
                _prompt = new ToastPrompt();
            }

            // this is me manually resetting stuff due to the reusability test
            // you don't need to do this.
            // fontsize, foreground, background won't manually be reset

            //_prompt.TextWrapping = TextWrapping.NoWrap;
            //_prompt.ImageSource = null;
            //_prompt.ImageHeight = double.NaN;
            //_prompt.ImageWidth = double.NaN;
            //_prompt.Stretch = Stretch.None;
            //_prompt.IsAppBarVisible = false;
            //_prompt.TextOrientation = System.Windows.Controls.Orientation.Horizontal;

            //_prompt.Message = string.Empty;
            //_prompt.Title = string.Empty;

            _prompt.Completed += PromptCompleted;
        }
开发者ID:selaromdotnet,项目名称:Coding4FunToolkit,代码行数:31,代码来源:ToastPrompts.xaml.cs


示例2: ShowMessage

        public static void ShowMessage(string message, string title = "", Action action = null)
        {
            if (_popupOpen)
            {
                return;
            }

            var prompt = new ToastPrompt
            {
                Title = title,
                Message = message,
                Foreground = new SolidColorBrush(Colors.White),
                TextWrapping = TextWrapping.Wrap
            };

            if (action != null)
            {
                prompt.Tap += (s, e) => action();
            }

            prompt.Completed += (sender, eventArgs) =>
            {
                _popupOpen = false;
            };

            _popupOpen = true;
            prompt.Show();
        }
开发者ID:EchoDemon,项目名称:MediaBrowser.WindowsPhone,代码行数:28,代码来源:App.xaml.cs


示例3: Execute

        public void Execute(object parameter)
        {
            MediaItemsListModelItem mediaItem = parameter as MediaItemsListModelItem;

            switch (mediaItem.ItemState)
            {
                case MediaItemState.Local:
                    // TEMPORARY: log media item playback
                    App.Engine.StatisticsManager.LogMediaPlayback(mediaItem);
                    if (mediaItem.IsChanged)
                    {
                        mediaItem.IsChanged = false;
                        Library.markItemWatched(mediaItem.Id);
                    }
                    NedEngine.Utils.NavigateTo("/MediaItemsViewerPage.xaml?id=" + mediaItem.Id);
                    break;
                case MediaItemState.Downloading:
                    ToastPrompt toast = new ToastPrompt();
                    toast.Message = String.Format("{0} is already queued for download", mediaItem.Title == String.Empty ? "Item" : mediaItem.Title);
                    toast.Show();
                    break;
                case MediaItemState.Remote:
                    AddItemToQueueCommand.GetCommand().Execute(mediaItem);
                    break;
                default:
                    System.Diagnostics.Debug.Assert(false, "Unknown media item state when media item requested - unable to make decision what to do");
                    break;
            }
        }
开发者ID:nokiaeducationdelivery,项目名称:ned-mobile-client-for-WP,代码行数:29,代码来源:MediaItemRequestedCommand.cs


示例4: ShowCoding4FunToastNotify

        /// <summary>
        /// User Coding4Fun Component build user define toast nofity 
        /// </summary>
        /// <param name="message">Message</param>
        /// <param name="title">Title</param>
        /// <param name="timeout">Time Out</param>
        /// <param name="foregroundColor">Forground Color</param>
        /// <param name="backgroundColor">Background Color</param>
        public void ShowCoding4FunToastNotify(string message, string title, int timeout = 2000, double fontSize = 20, SolidColorBrush forgroundColor = null, SolidColorBrush backgroundColor = null)
        {
            ToastPrompt toastPrompt = new ToastPrompt()
            {
                Message = message,
                Title = title,
                IsTimerEnabled = true,
                MillisecondsUntilHidden = timeout,
                IsAppBarVisible = true,
                FontSize = fontSize
            };

            if (forgroundColor == null)
                toastPrompt.Foreground = new SolidColorBrush(Colors.White);
            else
                toastPrompt.Foreground = forgroundColor;

            if (backgroundColor == null)
                toastPrompt.Background = new SolidColorBrush(new RgbConvertToColorHelper().GetColorFromHexString("1BA1E2")); //new SolidColorBrush(Colors.Green);
            else
                toastPrompt.Background = backgroundColor;

            toastPrompt.TextOrientation = System.Windows.Controls.Orientation.Horizontal;
            toastPrompt.Show();
        }
开发者ID:rodmanwu,项目名称:dribbble-for-windows-phone-8,代码行数:33,代码来源:ToastNotifyHelper.cs


示例5: MainPage_Loaded

 private void MainPage_Loaded(object sender, RoutedEventArgs e)
 {
     ServiceLocator.Dispatcher = new DispatchAdapter();
     loginViewModel = new LoginViewModel();
     progressBar = new PerformanceProgressBar();
     progressBar.IsIndeterminate = true;
     ServiceLocator.Messenger.Subscribe<BaseViewMessage>(m =>
     {
         switch (m.Content.message)
         {
             case BaseViewMessage.MessageTypes.CONNECTION_ERROR:
                 ServiceLocator.Dispatcher.invoke(() => 
                 {
                     ToastPrompt toast = new ToastPrompt();
                     toast.Message = "Erro de conexão";
                     toast.Show();
                     if (ContentPanel.Children.Contains(progressBar))
                         this.ContentPanel.Children.Remove(progressBar);
                 });
                 break;
             case BaseViewMessage.MessageTypes.LOGIN_CONNECTION_OK:
                 getCourses();
                 break;
             case BaseViewMessage.MessageTypes.COURSE_CONNECTION_OK:
                 ServiceLocator.Dispatcher.invoke(() =>
                 {
                     NavigationService.Navigate(new Uri("/Views/CoursePage.xaml", UriKind.Relative));
                 });
                 break;
             default:
                 break;
         }
     });
 }
开发者ID:paulombcosta,项目名称:mono-mobilis,代码行数:34,代码来源:MainPage.xaml.cs


示例6: NotificationChannel_HttpNotificationReceived

        void NotificationChannel_HttpNotificationReceived(object sender, HttpNotificationEventArgs e)
        {
            var title = string.Empty;
            var message = string.Empty;
            using (var reader = new StreamReader(e.Notification.Body, Encoding.UTF8))
            {
                var temp = reader.ReadToEnd();
                var data = temp.Split(';');
                title = data[1];
                message = data[0];
            }

            Dispatcher.BeginInvoke(async () =>
            {
                var toast = new ToastPrompt()
                {
                    Background = new SolidColorBrush(Colors.White),
                    Foreground = new SolidColorBrush(Colors.Black),
                    Title = title,
                    FontSize = 30,
                    Message = message,
                    TextOrientation = System.Windows.Controls.Orientation.Vertical,
                    ImageSource = new BitmapImage(new Uri("/Assets/ApplicationIcon.png", UriKind.RelativeOrAbsolute))
                };

                toast.Show();

                _timer = new DispatcherTimer() { Interval = new TimeSpan(0, 0, 5) };
                _timer.Tick += timer_Tick;
                _timer.Start();
            });
        }
开发者ID:quicksilver65,项目名称:Skadoosh,代码行数:32,代码来源:ParticipateLive.xaml.cs


示例7: SaveStore

 //保存商家
 private bool SaveStore(string name)
 {
     try
     {
         if (name == "")
         {
             MessageBox.Show("商家名称不能为空!");
             return false;
         }
         else
         {
             Store store = new Store()
             {
                 Name = name
             };
             App.storeHelper.AddNew(store);
         }
     }
     catch (Exception e)
     {
         MessageBox.Show(e.Message);
         return false;
     }
     ToastPrompt tp = new ToastPrompt();
     SolidColorBrush brush = new SolidColorBrush(Color.FromArgb(255, 255, 255, 255));
     tp.Foreground = brush;
     tp.Background = PageTitle.Foreground;
     tp.Message = "保存成功";
     tp.Show();
     return true;
 }
开发者ID:TomHGTang,项目名称:AccountBook,代码行数:32,代码来源:StoreSetting.xaml.cs


示例8: Show

        public static void Show(string message)
        {
            ToastPrompt prompt = new ToastPrompt();

            prompt.Message = message;
            prompt.Show();
        }
开发者ID:anytao,项目名称:ModernReader,代码行数:7,代码来源:OkrToast.cs


示例9: webClient_DownloadStringCompleted

 void webClient_DownloadStringCompleted(object sender, DownloadStringCompletedEventArgs e)
 {
     RootObject root = new RootObject();
     MemoryStream ms = new MemoryStream(Encoding.UTF8.GetBytes(e.Result));
     DataContractJsonSerializer ser = new DataContractJsonSerializer(root.GetType());
     ms.Position = 0;
     root = ser.ReadObject(ms) as RootObject;
     ms.Close();
     #region Saving to storage
     if (settings.Contains("root"))
     {
         settings.Remove("root");
         settings.Add("root", root);
         settings.Save();
         Global.Root = root;
     }
     else
     {
         settings.Add("root", root);
         settings.Save();
         Global.Root = root;
     }
     #endregion
     #region Toastprompt
     Grid grid = this.LayoutRoot.Children[1] as Grid;
     ToastPrompt tp = new ToastPrompt();
     tp.Title = "Synch success";
     tp.Message = "Downloaded " + root.words.Count + " words" ;
     tp.VerticalAlignment = System.Windows.VerticalAlignment.Center;
     tp.FontFamily = new FontFamily("Verdana");
     tp.FontSize = 22;
     tp.MillisecondsUntilHidden = 3000;
     tp.Show();
     #endregion
 }
开发者ID:jnowicki,项目名称:WP-EduWords,代码行数:35,代码来源:MainPage.xaml.cs


示例10: Toast

 protected void Toast(string title, string message = null)
 {
     ToastPrompt toast = new ToastPrompt();
     toast.Title = title;
     if (!string.IsNullOrEmpty(message)) toast.Message = message;
     toast.Show();
 }
开发者ID:dozer47528,项目名称:WP7-GPS-Tracker,代码行数:7,代码来源:MainPage.xaml.cs


示例11: SaveAndCloseClick

        private void SaveAndCloseClick(object sender, RoutedEventArgs e)
        {
            var title = channelName.Text;
            ToastPrompt toast = new ToastPrompt();
            toast.Foreground = App.WhiteColor;
            toast.MillisecondsUntilHidden = 1500;

            if (String.IsNullOrWhiteSpace(title)&&title.Length < 3)
            {
                toast.Message = AppResources.channel_title_error;
                toast.Show();
                return;
            }

            string address = channelLink.Text;
            if (String.IsNullOrWhiteSpace(address) || address.Equals("about:blank") ||
                !(address.Length > 7 && address.StartsWith("http://") ||
                  address.Length > 8 && address.StartsWith("https://")))
            {
                toast.Message = AppResources.add_message_error;
                toast.Show();
                return;
            }

            App.ViewModel.Channel.Title=title;
            App.ViewModel.Channel.URL=address;
            App.ViewModel.MoveChannel(App.ViewModel.Channel, channelListPicker.SelectedIndex);

            toast.Message = AppResources.channel_edit_done;
            toast.Show();

            NavigationService.GoBack();
        }
开发者ID:wegorich,项目名称:RSS-Reader-WindowsPhone,代码行数:33,代码来源:EditChannel.xaml.cs


示例12: OnNavigatedTo

        protected override void OnNavigatedTo(System.Windows.Navigation.NavigationEventArgs e)
        {
			var toast = new ToastPrompt { Message = "attempt to get OnNavigatedTo failure" };
            toast.Show();

            base.OnNavigatedTo(e);
        }
开发者ID:selaromdotnet,项目名称:Coding4FunToolkit,代码行数:7,代码来源:PromptStressTest.xaml.cs


示例13: CreateErrorNotification

 public void CreateErrorNotification(Exception exception)
 {
     if (_scheduler == null)
         return;
     Task.Factory.StartNew(() =>
         {
             if (exception is System.Net.WebException)
             {
                 ToastPrompt toast = new ToastPrompt();
                 toast.Title = "Baconography";
                 toast.Message = "We're having a hard time connecting to reddit";
                 toast.ImageSource = new BitmapImage(new Uri("Assets\\ApplicationIconSmall.png", UriKind.RelativeOrAbsolute));
                 toast.TextWrapping = System.Windows.TextWrapping.Wrap;
                 toast.Show();
                 Messenger.Default.Send<ConnectionStatusMessage>(new ConnectionStatusMessage { IsOnline = false, UserInitiated = false });
             }
             else if (exception.Message == "NotFound")
             {
                 CreateNotification("There doesnt seem to be anything here");
             }
             else
             {
                 ToastPrompt toast = new ToastPrompt();
                 toast.Title = "Baconography";
                 toast.Message = "We're having a hard time connecting to reddit, you might want to try again later";
                 toast.ImageSource = new BitmapImage(new Uri("Assets\\ApplicationIconSmall.png", UriKind.RelativeOrAbsolute));
                 toast.TextWrapping = System.Windows.TextWrapping.Wrap;
                 toast.Show();
             }
         }, System.Threading.CancellationToken.None, TaskCreationOptions.None, _scheduler); 
 }
开发者ID:Synergex,项目名称:Baconography,代码行数:31,代码来源:NotificationService.cs


示例14: GetReviewCompleted

 void GetReviewCompleted(object s, ViewModels.DoubanSearchCompletedEventArgs args)
 {
     App.SubjectReviewViewModel.GetReviewCompleted -= GetReviewCompleted;
     Deployment.Current.Dispatcher.BeginInvoke(() =>
     {
         if (args.IsSuccess)
         {
             contentContainer.Visibility = Visibility.Visible;
             contentContainer.IsEnabled = false;
             DataContext = args.Result;
             this.SetProgressIndicator(false);
             contentContainer.IsEnabled = true;
             foreach (var content in App.SubjectReviewViewModel.ReveiwContentList)
             {
                 TextBlock tb = new TextBlock();
                 //tb.Width = 445;
                 tb.TextWrapping = TextWrapping.Wrap;
                 tb.Foreground = new SolidColorBrush(Colors.Black);
                 tb.FontSize = (double)App.Current.Resources["PhoneFontSizeMedium"];
                 tb.Text = content;
                 spContent.Children.Add(tb);
             }
             contentContainer.ScrollToVerticalOffset(0);
         }
         else
         {
             ToastPrompt toast = new ToastPrompt();
             toast.Message = args.Message;
             toast.Show();
         }
     });
 }
开发者ID:Hcs66,项目名称:WinDou,代码行数:32,代码来源:SubjectReviewView.xaml.cs


示例15: SaveClick

        private void SaveClick(object sender, EventArgs e)
        {
            string address = RssLink.Text;

            if (String.IsNullOrWhiteSpace(address) || address.Equals("about:blank") ||
                !(address.Length > 7 && address.StartsWith("http://") ||
                  address.Length > 8 && address.StartsWith("https://")))
            {
                ToastPrompt toast = new ToastPrompt();
                toast.Foreground = App.WhiteColor;
                toast.MillisecondsUntilHidden = 1500;
                toast.Message = AppResources.add_message_error;
                toast.Show();
                return;
            }
            try
            {
                App.ViewModel.AddChannelCommand.DoExecute(address);
                ToastPrompt toast = new ToastPrompt();
                toast.Foreground = App.WhiteColor;
                toast.MillisecondsUntilHidden = 1500;
                toast.Message = AppResources.add_message;
                toast.Show();
            }
            catch (Exception)
            {
                ToastPrompt toast = new ToastPrompt();
                toast.MillisecondsUntilHidden = 1500;
                toast.Message = AppResources.add_message_error;
                toast.Foreground = App.WhiteColor;
                toast.Show();
            }
        }
开发者ID:wegorich,项目名称:RSS-Reader-WindowsPhone,代码行数:33,代码来源:AddChannel.xaml.cs


示例16: btn_selectRoadMaps_Click

        /// <summary>
        /// Selectionne les roadmaps en fonction d'un intervalle de temps
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btn_selectRoadMaps_Click(object sender, RoutedEventArgs e)
        {
            if (!App.IsConnected())
            {
                MessageBox.Show("Vous n'êtes pas connecté à internet");
                return;
            }

            collection.Items.Clear();
            IRoadMapManager manager = new RoadMapManager();
            manager.AllRoadMapsReceived += (o, eRoadMapReceived) =>
            {
                if (eRoadMapReceived.Error)
                {
                    MessageBox.Show(eRoadMapReceived.MessageError);
                    this.enableInterface();
                    return;
                }
                for (int i=0; i < eRoadMapReceived.RoadMaps.Count; i++)
                {
                    var roadmap = eRoadMapReceived.RoadMaps[i];
                    collection.Items.Add(new DateAndPositions(i, roadmap));
                }
                manager.AllRoadMapsReceived = null;
                this.enableInterface();

                ToastPrompt toast = new ToastPrompt();
                toast.Title = "Résultats";
                toast.Message = eRoadMapReceived.RoadMaps.Count + " feuille(s) de route récupérée(s)";
                toast.Show();
            };
            if (!IsolatedStorageSettings.ApplicationSettings.Contains("latiAdrDepart") ||
                !IsolatedStorageSettings.ApplicationSettings.Contains("longiAdrDepart")||
                !IsolatedStorageSettings.ApplicationSettings.Contains("VilleDepart") ||
                !IsolatedStorageSettings.ApplicationSettings.Contains("latiAdrArriver")||
                !IsolatedStorageSettings.ApplicationSettings.Contains("longiAdrArriver")||
                !IsolatedStorageSettings.ApplicationSettings.Contains("VilleArriver") ||
                !IsolatedStorageSettings.ApplicationSettings.Contains("ConsoCarburant")||
                !IsolatedStorageSettings.ApplicationSettings.Contains("PrixCarburant"))
            {
                MessageBox.Show("Veillez à paramètrer correctement l'application avant d'utiliser l'export Excel. Les villes de départ et d'arrivée sont manquantes");
                NavigationService.Navigate(new Uri("/Page/PivotParam.xaml", UriKind.Relative));
                return;
            }

            ReferenceMeeting start = new ReferenceMeeting(this.dateFrom.Value.Value, new Location()
            {
                Latitude = (double)settings["latiAdrDepart"],
                Longitude = (double)settings["longiAdrDepart"]
            }) { City = (string)settings["VilleDepart"], Subject = "Start" };
            ReferenceMeeting end = new ReferenceMeeting(this.dateFrom.Value.Value, new Location()
            {
                Latitude = (double)settings["latiAdrArriver"],
                Longitude = (double)settings["longiAdrArriver"]
            }) { City = (string)settings["VilleArriver"], Subject = "End" };

            this.disableInterface();
            manager.GetAllRoadMapsAsync(this.dateFrom.Value.Value, this.dateTo.Value.Value, start, end);
        }
开发者ID:BenJoyenConseil,项目名称:planmyway,代码行数:64,代码来源:SelectDate.xaml.cs


示例17: ShowError

 public void ShowError(string message, string title = null)
 {
     ToastPrompt toast = new ToastPrompt();
     toast.Title = !string.IsNullOrEmpty(title) ? title : AppResources.ApplicationTitle;
     toast.Message = message;
     toast.Background = new SolidColorBrush(Colors.Red);
     toast.Show();
 }
开发者ID:Ontropix,项目名称:whowhat,代码行数:8,代码来源:ToastService.cs


示例18: Show

 public void Show()
 {
     Deployment.Current.Dispatcher.BeginInvoke(() =>
     {
         var toast = new ToastPrompt { Message = "Saved!" };
         toast.Show();
     });
 }
开发者ID:petermorlion,项目名称:EightBitCamera,代码行数:8,代码来源:ShowSavedMessageCommand.cs


示例19: ShowToastMessage

 public void ShowToastMessage(string message)
 {
     Deployment.Current.Dispatcher.BeginInvoke(() =>
     {
         ToastPrompt toast = new ToastPrompt();
         toast.Title = message;
         toast.Show();
     });
 }
开发者ID:pieterderycke,项目名称:CloudFox,代码行数:9,代码来源:MessageService.cs


示例20: SendToast

 public void SendToast(string message)
 {
     Deployment.Current.Dispatcher.BeginInvoke(() =>
     {
         var toast = new ToastPrompt();
         toast.Message = message;
         toast.Show();
     });
 }
开发者ID:Tolulope,项目名称:MeetupManager,代码行数:9,代码来源:WP8MessageDialog.cs



注:本文中的ToastPrompt类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Toggle类代码示例发布时间:2022-05-24
下一篇:
C# Tnum类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap