本文整理汇总了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();
}
}
示例2: DrawerIcon_Tapped
private void DrawerIcon_Tapped(object sender, TappedRoutedEventArgs e)
{
if (DrawerLayout.IsDrawerOpen)
DrawerLayout.CloseDrawer();
else
DrawerLayout.OpenDrawer();
}
示例3: TextBlock_Tapped_1
private void TextBlock_Tapped_1(object sender, TappedRoutedEventArgs e)
{
if (this.Frame != null)
{
this.Frame.Navigate(typeof(BasicPage1));
}
}
示例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();
}
}
示例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;
}
示例6: mediaMain_Tapped_1
private void mediaMain_Tapped_1(object sender, TappedRoutedEventArgs e)
{
if (mediaMain.CurrentState == MediaElementState.Playing)
mediaMain.Pause();
else
mediaMain.Play();
}
示例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)
{
}
}
示例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);
}
示例9: Win8_CodeCamp_Tapped
private void Win8_CodeCamp_Tapped(object sender, TappedRoutedEventArgs e)
{
if (this.Frame != null)
{
this.Frame.Navigate(typeof(CodeCamp));
}
}
示例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;
}
}
示例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();
}
示例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;
}
示例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();
}
}
示例14: OnTapped
private void OnTapped(object sender, TappedRoutedEventArgs e)
{
if (Click != null)
Click(sender, e);
if (Command != null && Command.CanExecute(sender))
Command.Execute(sender);
}
示例15: PressedonChuck
private void PressedonChuck(object sender, TappedRoutedEventArgs e)
{
if (this.Frame != null)
{
this.Frame.Navigate(typeof(ChuckN));
}
}