当前位置: 首页>>代码示例>>C#>>正文


C# Input.TappedRoutedEventArgs类代码示例

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


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

示例1: PostCommentButton_Tapped

 private async void PostCommentButton_Tapped(object sender, TappedRoutedEventArgs e)
 {
     string body;
     CommentTextBox.Document.GetText(Windows.UI.Text.TextGetOptions.None, out body);
     if (!AuthenticationService.IsLogin)
     {
         MessageDialog messageDialog = new MessageDialog("请先登录");
         await messageDialog.ShowAsync();
         AuthenticationService.RedictLoginPage();
         return;
     }
     PostNewsComment postNewsComment = new PostNewsComment();
     postNewsComment.ContentId = this.NewsCommentViewModel.News.Id;
     postNewsComment.Content = body;
     postNewsComment.StrComment = "";
     postNewsComment.ParentCommentId = this.NewsCommentViewModel.News.Id;
     postNewsComment.Title = this.NewsCommentViewModel.News.Title;
     PostResult postBlogCommentResponse = await NewsService.PostCommentAsync(postNewsComment);
     if (!postBlogCommentResponse.IsSuccess)
     {
         MessageDialog messageDialog = new MessageDialog(postBlogCommentResponse.Message);
         await messageDialog.ShowAsync();
         //其他异常则不处理
         if (postBlogCommentResponse.Message.Contains("登录"))
         {
             AuthenticationService.RedictLoginPage();
         }
         return;
     }
     else
     {
         this.NewsCommentViewModel.Refresh();
     }
 }
开发者ID:GuojieLin,项目名称:CnBlogs,代码行数:34,代码来源:NewsCommentListPage.xaml.cs

示例2: DrawerIcon_Tapped

 private void DrawerIcon_Tapped(object sender, TappedRoutedEventArgs e)
 {
     if (DrawerLayout.IsDrawerOpen)
         DrawerLayout.CloseDrawer();
     else
         DrawerLayout.OpenDrawer();
 }
开发者ID:AkshayGupta94,项目名称:ProjectAukatFinal,代码行数:7,代码来源:Feedback.xaml.cs

示例3: TextBlock_Tapped_1

 private void TextBlock_Tapped_1(object sender, TappedRoutedEventArgs e)
 {
     if (this.Frame != null)
     {
         this.Frame.Navigate(typeof(BasicPage1));
     }
 }
开发者ID:ebajaruns,项目名称:Edgarsss,代码行数:7,代码来源:WinCodeCampEvaluationGrid.xaml.cs

示例4: Button_Tapped_1

        private async void Button_Tapped_1(object sender, TappedRoutedEventArgs e)
        {

            bool cleared = false;
            MessageDialog mBox = new MessageDialog("Selecting yes will clear all the air quality data stored by the app.", "Clear User Data");
            var cmd = new UICommandInvokedHandler((command) =>
            {
                var temp = command.Label;
            });

            mBox.Commands.Add(new UICommand(
                      "Yes", cmd));
            mBox.Commands.Add(new UICommand(
                                  "No", cmd));

            var returnCmd = await mBox.ShowAsync();

            if (String.Equals(returnCmd.Label, "Yes"))
                cleared = await airDB.clear();
            else
                return;

            if (cleared)
            {
                MessageDialog mBox2 = new MessageDialog("User Data Cleared", "User Data");
                mBox2.ShowAsync();
            }
            else
            {
                MessageDialog mBox2 = new MessageDialog("Failed to Clear User Data (there may be none to clear)", "User Data");
                mBox2.ShowAsync();
            }
        }
开发者ID:rssktt,项目名称:FairAir,代码行数:33,代码来源:SettingsPage.xaml.cs

示例5: ShowSummaryButton_OnTapped

 private async void ShowSummaryButton_OnTapped(object sender, TappedRoutedEventArgs e)
 {
     var ctrl = new VoteSummaryCtrl();
     ctrl.DataContext = _viewModel.VoteSet;
     SummaryBorder.Child = ctrl;
     SummaryGrid.Visibility = Visibility.Visible;
 }
开发者ID:jayway,项目名称:Kelly-Win8-XAML,代码行数:7,代码来源:MainPage.xaml.cs

示例6: mediaMain_Tapped_1

 private void mediaMain_Tapped_1(object sender, TappedRoutedEventArgs e)
 {
     if (mediaMain.CurrentState == MediaElementState.Playing)
         mediaMain.Pause();
     else
         mediaMain.Play();
 }
开发者ID:modulexcite,项目名称:windows8,代码行数:7,代码来源:VideoPage.xaml.cs

示例7: calloutButton_Tapped

 void calloutButton_Tapped(object sender, TappedRoutedEventArgs e)
 {
     try
     {
         if (calloutButton != null)
         {
             object parent = VisualTreeHelper.GetParent(calloutButton);
             while (!(parent is Page || parent is FlatNavigationPage))
                 if (parent != null)
                     parent = VisualTreeHelper.GetParent(parent as DependencyObject);
                 else break;
             if (parent != null)
             {
                 Page page = parent as Page;
                 if (page != null)
                 {
                     if (page.TopAppBar != null)
                     {
                         page.TopAppBar.IsOpen = true;
                     }
                     if (page.BottomAppBar != null)
                     {
                         page.BottomAppBar.IsOpen = true;
                     }
                 }
             }
         }
     }
     catch (Exception)
     {
     }
 }
开发者ID:CuiXiaoDao,项目名称:cnblogs-UAP,代码行数:32,代码来源:AppCommandsCalloutButton.cs

示例8: MenuAjustes_Tapped

 private void MenuAjustes_Tapped(object sender, TappedRoutedEventArgs e)
 {
     var ajuste = sender as StackPanel;
     string s = Paginas.FirstOrDefault(c => c.Titulo.Equals(ajuste.Name.Substring(4))).ClassType;
     var t = Type.GetType(s);
     ScenarioFrame.Navigate(t);
 }
开发者ID:carloshenriquecarniatto,项目名称:Podcasts,代码行数:7,代码来源:MainPage.xaml.cs

示例9: Win8_CodeCamp_Tapped

 private void Win8_CodeCamp_Tapped(object sender, TappedRoutedEventArgs e)
 {
     if (this.Frame != null)
     {
         this.Frame.Navigate(typeof(CodeCamp));
     }
 }
开发者ID:ebajaruns,项目名称:Edgarsss,代码行数:7,代码来源:ITRatingGrid.xaml.cs

示例10: flipView_Tapped

        private async void flipView_Tapped(object sender, TappedRoutedEventArgs e)
        {
            try
            {
                // try to cast source as content presenter
                var content = e.OriginalSource as ContentPresenter;

                if (content == null) return;

                // Send data to Event Hub
                var eventData = new Event
                {
                    Id = "iotboothdevice",
                    Timecreated = DateTime.UtcNow.ToString("mm:dd:yyyy hh:mm"),
                    Value = content.Content.ToString()
                };

                var result = await _connectionManager.SendEvent(eventData); // send message over event hub
                if (!result) return;
                var message = string.Format("Last Successful Message sent at: {0}", DateTime.UtcNow);

                textBlock.Text = message;
                //var dialog = new MessageDialog("Thanks for visiting the IoT booth!");
                //await dialog.ShowAsync();
                InitializeFlipView();
            }
            catch (Exception ex)
            {
                textBlock.Text = ex.Message;
            }
        }
开发者ID:niksacmsft,项目名称:IoT.Samples.Universal.EventIngest,代码行数:31,代码来源:MainPage.xaml.cs

示例11: backButton_Tapped

 private void backButton_Tapped(object sender, TappedRoutedEventArgs e)
 {
     var fr = new Frame();
     fr.Navigate(typeof(MainPage));
     Window.Current.Content = fr;
     Window.Current.Activate();
 }
开发者ID:kfwls,项目名称:ftdCruncher,代码行数:7,代码来源:ComparePage.xaml.cs

示例12: Todo_Tapped

        /* Items tab */

        private void Todo_Tapped(object sender, TappedRoutedEventArgs e)
        {
            var todo = (TodoItem)((FrameworkElement)sender).Tag;

            this.todoDetails = new TodoDetailsViewModel(todo);
            this.DataContext = this.todoDetails;
        }
开发者ID:avisprince,项目名称:UniversalTodoApp,代码行数:9,代码来源:TodoDetails.xaml.cs

示例13: PostCommentButton_Tapped

 private async void PostCommentButton_Tapped(object sender, TappedRoutedEventArgs e)
 {
     string body;
     CommentTextBox.Document.GetText(Windows.UI.Text.TextGetOptions.None, out body);
     if (!AuthenticationService.IsLogin)
     {
         MessageDialog messageDialog = new MessageDialog("请先登录");
         await messageDialog.ShowAsync();
         AuthenticationService.RedictLoginPage();
         return;
     }
     PostBlogComment postBlogComment = new PostBlogComment();
     postBlogComment.BlogApp = this.BlogCommentViewModel.Blog.BlogApp;
     postBlogComment.Body = body;
     postBlogComment.ParentCommentId = "0";
     postBlogComment.PostId = this.BlogCommentViewModel.Blog.Id;
     PostResult postBlogCommentResponse = await BlogService.PostCommentAsync(postBlogComment);
     if (!postBlogCommentResponse.IsSuccess)
     {
         MessageDialog messageDialog = new MessageDialog(postBlogCommentResponse.Message);
         await messageDialog.ShowAsync();
         //其他异常则不处理
         if (postBlogCommentResponse.Message.Contains("登录"))
         {
             AuthenticationService.RedictLoginPage();
         }
         return;
     }
     else
     {
         //TODO:使用API,评论不会马上刷出来,需要改成http获取进行解析才可以实时显示最新评论
         //{ "Id":0,"IsSuccess":false,"Message":"请先登录!","Data":null}
         this.BlogCommentViewModel.Refresh();
     }
 }
开发者ID:GuojieLin,项目名称:CnBlogs,代码行数:35,代码来源:BlogCommentListPage.xaml.cs

示例14: OnTapped

		private void OnTapped(object sender, TappedRoutedEventArgs e)
		{
			if (Click != null)
				Click(sender, e);
			if (Command != null && Command.CanExecute(sender))
				Command.Execute(sender);
		}
开发者ID:fstn,项目名称:WindowsPhoneApps,代码行数:7,代码来源:RolloverButton.cs

示例15: PressedonChuck

 private void PressedonChuck(object sender, TappedRoutedEventArgs e)
 {
     if (this.Frame != null)
     {
         this.Frame.Navigate(typeof(ChuckN));
     }
 }
开发者ID:ebajaruns,项目名称:Edgarsss,代码行数:7,代码来源:GroupX.xaml.cs


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