private void imageBack_Tapped(object sender, TappedRoutedEventArgs e) { int n = --audioView.SelectedIndex; string tempUrl = (audioView.Items[n] as VKAudio).url; PalyTrack(tempUrl); }
private void butFav_Tapped(object sender, TappedRoutedEventArgs e) { var p = e.GetPosition(null); Bang(p); if (ChangeViewState != null) ChangeViewState("AddFavourite", null); }
/// <summary> /// if they hitt search button event, will search for what the user wants /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private async void Button_Tapped_Search(object sender, TappedRoutedEventArgs e) { //find out whether the fileter box is checked try { _searchWithFilter = (bool)FilterCheck.IsChecked; //get the location from a search input and set values in the location object MyLocation location = new MyLocation(_map, _mapLayer, this, _searchWithFilter, key); location._searcher = SearchInput.Text; location._radius = _changedRadius; //if searching with filter, find the filter value if (_searchWithFilter) { //pick filter location.findFilter(_filter); } //instantiate VM and call search by filter viewmodel = new VM(this); viewmodel.search(true, location); } catch(Exception ex) { //display exception var messageDialog = new MessageDialog(ex.Message); messageDialog.ShowAsync(); } }
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(); } }
private void TextBlock_Tapped_1(object sender, TappedRoutedEventArgs e) { if (this.Frame != null) { this.Frame.Navigate(typeof(BasicPage1)); } }
private async void Submit_Tapped(object sender, TappedRoutedEventArgs e) { if (string.IsNullOrWhiteSpace(comment.Text)) { new MessageDialog("Your comment is empty.", "Error").ShowAsync(); return; } using (var client = new HttpClient()) { var param = new Dictionary<string, string>(); param.Add("comment", comment.Text); param.Add("id", id.ToString()); try { var resp = await client.PostAsync("http://173.250.206.173:8080/findR/php/input/updateComments.php", new FormUrlEncodedContent(param)); var content = await resp.Content.ReadAsStringAsync(); new MessageDialog($"Your comment \"{comment.Text}\" has been posted.", "Sucess").ShowAsync(); Frame.GoBack(); } catch { new MessageDialog("Something Went Wrong.", "Something Went Wrong").ShowAsync(); } } }
private void DrawerIcon_Tapped(object sender, TappedRoutedEventArgs e) { if (DrawerLayout.IsDrawerOpen) DrawerLayout.CloseDrawer(); else DrawerLayout.OpenDrawer(); }
private void itemPanel_Tapped(object sender, TappedRoutedEventArgs e) { FrameworkElement senderElement = sender as FrameworkElement; FlyoutBase flyoutBase = FlyoutBase.GetAttachedFlyout(senderElement); flyoutBase.ShowAt(senderElement); }
private async void ShowSummaryButton_OnTapped(object sender, TappedRoutedEventArgs e) { var ctrl = new VoteSummaryCtrl(); ctrl.DataContext = _viewModel.VoteSet; SummaryBorder.Child = ctrl; SummaryGrid.Visibility = Visibility.Visible; }
//Tile events private void UIElement_OnTapped(object sender, TappedRoutedEventArgs e) { if (_isWorking == false) //prevent multiple operations on the same object == null reference exceptions { _isWorking = true; try //Hacky, very very hacky :( { CleanupMap(); var x = (TruckObject) TruckGallery.SelectedItem; var pushpin2 = new Pushpin(); pushpin2.Text = "!"; MapLayer.SetPosition(pushpin2, new Location(Convert.ToDouble(x.LocLat), Convert.ToDouble(x.LocLong))); MyMap.Children.Add(pushpin2); } catch { } _isWorking = false; } }
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(); } }
private async void OnIdentityProviderTapped(object sender, TappedRoutedEventArgs e) { var identityProvider = (IdentityProvider)((FrameworkElement)e.OriginalSource).DataContext; var webAuthenticationResult = await WebAuthenticationBroker.AuthenticateAsync( WebAuthenticationOptions.None, new Uri(identityProvider.LoginUrl), new Uri("http://authentication.brainthud.com/api/federationcallback/end")); var start = webAuthenticationResult.ResponseData.LastIndexOf('=') + 1; var nameIdentifier = webAuthenticationResult.ResponseData.Substring(start, webAuthenticationResult.ResponseData.Length - start); var cookies = this.getCookies(nameIdentifier); var uri = new Uri(@"http://www.brainthud.com/api/Cards/"); var cookieContainer = new CookieContainer(); foreach(var cookie in cookies) { var cookieItem = new Cookie(cookie.Key, cookie.Value); cookieContainer.Add(uri, cookieItem); } var handler = new HttpClientHandler(); handler.CookieContainer =cookieContainer; var client = new HttpClient(handler); var response = client.GetAsync(uri).Result; var result = response.Content.ReadAsStringAsync().Result; var x = result; }
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) { } }
private async void Item1_Tapped(object sender, TappedRoutedEventArgs e) { var grid = sender as Grid; if (grid != null) { string menuItemName = grid.Name; MessageDialog dialog = null; CoreDispatcher dispatcher = CoreWindow.GetForCurrentThread().Dispatcher; switch (menuItemName) { case "Item1": DrawerLayout.CloseDrawer(); break; case "Item2": DrawerLayout.CloseDrawer(); await dispatcher.RunAsync(CoreDispatcherPriority.Normal, () => Frame.Navigate(typeof(Page2))); break; case "Item3": await Windows.System.Launcher.LaunchUriAsync(new Uri("https://zing.vn/", UriKind.Absolute)); break; case "Item4": await dispatcher.RunAsync(CoreDispatcherPriority.Normal, () => Frame.Navigate(typeof(Page3))); break; } if (dialog != null) await dialog.ShowAsync(); } }
private void mediaMain_Tapped_1(object sender, TappedRoutedEventArgs e) { if (mediaMain.CurrentState == MediaElementState.Playing) mediaMain.Pause(); else mediaMain.Play(); }
private void IjusttappedBritney(object sender, TappedRoutedEventArgs e) { if (this.Frame != null) { this.Frame.Navigate(typeof(IlzeSpirsa)); } }
private void PressedonChuck(object sender, TappedRoutedEventArgs e) { if (this.Frame != null) { this.Frame.Navigate(typeof(ChuckN)); } }
private async void updateStatus(object sender, TappedRoutedEventArgs e) { PostButton.IsEnabled = false; App.Progress.IsActive = true; App.Progress.Visibility = Windows.UI.Xaml.Visibility.Visible; FacebookClient _fb = new FacebookClient(session.accessToken); dynamic parameters = new ExpandoObject(); parameters.access_token = session.accessToken; string postText = ""; StatusText.Document.GetText(Windows.UI.Text.TextGetOptions.None, out postText); parameters.message = postText.Replace("\r", ""); dynamic result = null; try { result = await _fb.PostTaskAsync("me/feed", parameters); } catch (FacebookOAuthException ex) { Debug.WriteLine("Problem: " + ex.StackTrace); App.Progress.IsActive = false; App.Progress.Visibility = Windows.UI.Xaml.Visibility.Collapsed; return; } App.Progress.IsActive = false; App.Progress.Visibility = Windows.UI.Xaml.Visibility.Collapsed; statusBtn.closePostStatus(); }
private void UserNameSaveIcon_OnTapped(object sender, TappedRoutedEventArgs e) { var localData = ApplicationData.Current.LocalSettings; var roamData = ApplicationData.Current.RoamingSettings; if (!localData.Values.ContainsKey("UserName") && !roamData.Values.ContainsKey("UserName")) { localData.Values.Add("UserName", UserNameTextBox.Text); roamData.Values.Add("UserName", UserNameTextBox.Text); } else { localData.Values.Remove("UserName"); roamData.Values.Remove("UserName"); localData.Values.Add("UserName", UserNameTextBox.Text); roamData.Values.Add("UserName", UserNameTextBox.Text); } UserNameEditIcon.Visibility = Visibility.Visible; UserNameSaveIcon.Visibility = Visibility.Collapsed; UserNameTextBox.Visibility = Visibility.Collapsed; UserNameTextBlock.Visibility = Visibility.Visible; UserNameTextBlock.Text = UserNameTextBox.Text; var cspvm = new CallandSettingsPageViewModel(); cspvm.UserNameSaver(UserNameTextBlock.Text); }
private void BackTapped(object sender, TappedRoutedEventArgs e) { if (this.Frame.CanGoBack) { this.Frame.GoBack(); } }
//public bool CurrentPostTab = true; private void RightBar_Tapped(object sender, TappedRoutedEventArgs e) { //if (CurrentPostTab) //{ //DoubleAnimation animation = new DoubleAnimation(); //animation.From = RightBar.Width; //animation.To = LeftBar.Width; //animation.Duration = TimeSpan.FromMilliseconds(200); //animation.EnableDependentAnimation = true; ////QuadraticEase ease = new QuadraticEase(); ////ease.EasingMode = EasingMode.EaseIn; ////animation.EasingFunction = ease; //DoubleAnimation animation1 = new DoubleAnimation(); //animation1.From = LeftBar.Width; //animation1.To = RightBar.Width; //animation1.Duration = TimeSpan.FromMilliseconds(200); //animation1.EnableDependentAnimation = true; ////QuadraticEase ease1 = new QuadraticEase(); ////ease1.EasingMode = EasingMode.EaseOut; ////animation1.EasingFunction = ease1; //Storyboard storyboard = new Storyboard(); //Storyboard.SetTarget(animation, RightBar); //Storyboard.SetTargetProperty(animation, "Width"); //storyboard.Children.Add(animation); //Storyboard.SetTarget(animation1, LeftBar); //Storyboard.SetTargetProperty(animation1, "Width"); //storyboard.Children.Add(animation1); //storyboard.Begin(); //CurrentPostTab = false; //} }
private async void OnButtonCheckClicked(object sender, TappedRoutedEventArgs tappedRoutedEventArgs) { provinceTextBlock.Text = String.Empty; stateTextBlock.Text = String.Empty; try { string registerNumber = FindRegisterNumber(textBoxRegisterNumber.Text); RegisterData registerDataFound = _registerDataBase.GetRegisterDataByRegisterNumber(registerNumber); if (registerDataFound == null) { throw new Exception("Nie znaleziono podanej rejestracji"); } provinceTextBlock.Text = "Województwo : " + registerDataFound.Province; stateTextBlock.Text = "Powiat : " + registerDataFound.State; } catch (Exception ex) { MessageDialog msgbox = new MessageDialog("Błąd : " + ex.Message); await msgbox.ShowAsync(); } }
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); }
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; } }
private void backButton_Tapped(object sender, TappedRoutedEventArgs e) { var fr = new Frame(); fr.Navigate(typeof(MainPage)); Window.Current.Content = fr; Window.Current.Activate(); }
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(); } }
/* 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; }
private void Win8_CodeCamp_Tapped(object sender, TappedRoutedEventArgs e) { if (this.Frame != null) { this.Frame.Navigate(typeof(CodeCamp)); } }
private void OnTapped(object sender, TappedRoutedEventArgs e) { if (Click != null) Click(sender, e); if (Command != null && Command.CanExecute(sender)) Command.Execute(sender); }
private void Grid_Tapped(object sender, TappedRoutedEventArgs e) { if (bottomBar.Visibility == Visibility.Visible) bottomBar.Visibility = Visibility.Collapsed; else bottomBar.Visibility = Visibility.Visible; }
private async void ContentShadow_Tapped(object sender, Windows.UI.Xaml.Input.TappedRoutedEventArgs e) { HideSamplePicker(); await SetHamburgerMenuSelection(); }
private void CloseButton_Tapped(object sender, Windows.UI.Xaml.Input.TappedRoutedEventArgs e) { this.Owner.CloseColumnsFlyout(); }
private void OnProcessingResultGridTapped(object sender, Windows.UI.Xaml.Input.TappedRoutedEventArgs e) { processingResultGrid.Visibility = Windows.UI.Xaml.Visibility.Collapsed; }
/** * 前のマーカー位置へシーク */ private void OnPrevMarker(object sender, Windows.UI.Xaml.Input.TappedRoutedEventArgs e) { mMarkerView.PrevMark(mSlider.Value, mMarkerView); e.Handled = true; }
private void Expander_Tapped(object sender, Windows.UI.Xaml.Input.TappedRoutedEventArgs e) { FindName("G"); }
private void ShareNavigationViewItemTapped(object sender, Windows.UI.Xaml.Input.TappedRoutedEventArgs e) { Singleton <BroadcastCenter> .Instance.Send(this, "status_create"); }
private void SupprimerEnseignementTapped(object sender, Windows.UI.Xaml.Input.TappedRoutedEventArgs e) { enseignementSelect.Parent.Children.Remove(enseignementSelect); enseignement.delete(enseignementSelect); }
private void Tap(object sender, Windows.UI.Xaml.Input.TappedRoutedEventArgs e) { ProcessAll(); }
private void showDownloads(object sender, Windows.UI.Xaml.Input.TappedRoutedEventArgs e) { //Frame.Navigate(typeof(SavedManga)); }
private void Flag4_Tapped(object sender, Windows.UI.Xaml.Input.TappedRoutedEventArgs e) { InitAnswerDialog(4); }
private void AppBarButton_Tapped_1(object sender, Windows.UI.Xaml.Input.TappedRoutedEventArgs e) { ShowStoryline(StorylineGrid.DataContext as Storyline); }
private void backToStartClicked(object sender, Windows.UI.Xaml.Input.TappedRoutedEventArgs e) { //go back to the previous page Frame.Navigate(typeof(StartPage)); }
private void ImageViewShadow_Tapped(object sender, Windows.UI.Xaml.Input.TappedRoutedEventArgs e) { ImageViewAnimationClose.Begin(); }
private void BtnBack_Tapped(object sender, Windows.UI.Xaml.Input.TappedRoutedEventArgs e) { ShowStorylines(); }
}//End of AddPushpin method //Pin_Tapped method display message box void Pin_Tapped(object sender, Windows.UI.Xaml.Input.TappedRoutedEventArgs e) { Message("This is your location.", ""); } //End of Pin_Tapped method
private void AppBarButton_Tapped(object sender, Windows.UI.Xaml.Input.TappedRoutedEventArgs e) { ShowStorylines(); }
private void ListViewItem_Tapped(object sender, Windows.UI.Xaml.Input.TappedRoutedEventArgs e) { Helpers.UIHelper.OpenLinkAsync((sender as FrameworkElement)?.Tag as string); }
private void grdBig_Tapped(object sender, Windows.UI.Xaml.Input.TappedRoutedEventArgs e) { ImageViewAnimationOpen.Begin(); }
private void ButtonRetry_Tapped(object sender, Windows.UI.Xaml.Input.TappedRoutedEventArgs e) { }
private void btnLeft_Tapped(object sender, Windows.UI.Xaml.Input.TappedRoutedEventArgs e) { DismissWindow(); LeftClick?.Invoke(this, e); }
private void GoToDashboard(object sender, Windows.UI.Xaml.Input.TappedRoutedEventArgs e) { Frame.Navigate(typeof(DashboardPage)); }
private void GridCardItem_Tapped(object sender, Windows.UI.Xaml.Input.TappedRoutedEventArgs e) { }
private void AppBarButton_Tapped(object sender, Windows.UI.Xaml.Input.TappedRoutedEventArgs e) { login(usernameTextBox.Text, passwordBox.Password, null); }
private void FlipViewBanner_Tapped(object sender, Windows.UI.Xaml.Input.TappedRoutedEventArgs e) { }
private void M_paneToggleControl_Tapped(object sender, Windows.UI.Xaml.Input.TappedRoutedEventArgs e) { Debug.WriteLine($"{nameof(SplitViewService)} - {nameof(M_paneToggleControl_Tapped)}"); TogglePane(); }
private void map_Tapped(object sender, Windows.UI.Xaml.Input.TappedRoutedEventArgs e) { slowView = false; }
private void BackButton_Tapped(object sender, Windows.UI.Xaml.Input.TappedRoutedEventArgs e) { //AM ViewBuildings.Begin(); }
private void BtnRegister_Tapped(object sender, Windows.UI.Xaml.Input.TappedRoutedEventArgs e) { // TODO: Add event handler implementation here. }
private void btnBack_Click(object sender, Windows.UI.Xaml.Input.TappedRoutedEventArgs e) { Frame.GoBack(); }
private void ButtonClose_Tapped(object sender, Windows.UI.Xaml.Input.TappedRoutedEventArgs e) { CloseTapped?.Invoke(sender, e); }