private void OnSingleTapped(object sender, TappedRoutedEventArgs e) { var tabPosition = e.GetPosition(this).ToMapsui(); OnInfo(InvokeInfo(tabPosition, tabPosition, 1)); }
async void item_tapped(object sender, TappedRoutedEventArgs e) { var item = (sender as Grid); Manga m = (sender as Grid).DataContext as Manga; model.CurrentManga = m; if (!m.Saved) { model.Provider.GetChapters(m); } //var pos = item.TransformToVisual(Window.Current.Content); //Point screenCoords = pos.TransformPoint(new Point(0, 0)); screenCoords = e.GetPosition(canvas); innerPos = e.GetPosition(item); var inner = item.Children[0]; var context = (inner as Grid).DataContext; item.Children.Remove(inner); canvas.Children.Add(inner); (inner as Grid).DataContext = context; (inner as Grid).Children[1].Visibility = Windows.UI.Xaml.Visibility.Collapsed; (inner as Grid).Children[2].Visibility = Windows.UI.Xaml.Visibility.Collapsed; Canvas.SetLeft(inner, screenCoords.X - innerPos.X); Canvas.SetTop(inner, screenCoords.Y - innerPos.Y); Storyboard st = new Storyboard(); ExponentialEase ease = new ExponentialEase(); DoubleAnimation xanim = new DoubleAnimation(); Storyboard.SetTargetProperty(xanim, "(Canvas.Left)"); xanim.EasingFunction = ease; xanim.From = screenCoords.X - innerPos.X; xanim.To = 0; xanim.Duration = TimeSpan.FromSeconds(0.5); DoubleAnimation yanim = new DoubleAnimation(); Storyboard.SetTargetProperty(yanim, "(Canvas.Top)"); yanim.EasingFunction = ease; yanim.From = screenCoords.Y - innerPos.Y; yanim.To = 0; yanim.Duration = TimeSpan.FromSeconds(0.5); DoubleAnimation w = new DoubleAnimation(); w.EnableDependentAnimation = true; w.EasingFunction = ease; Storyboard.SetTargetProperty(w, "Width"); w.From = item.ActualWidth; w.To = canvas.ActualWidth; w.Duration = TimeSpan.FromSeconds(0.3); DoubleAnimation h = new DoubleAnimation(); h.EasingFunction = ease; h.EnableDependentAnimation = true; Storyboard.SetTargetProperty(h, "Height"); h.From = item.ActualHeight; h.To = 400; h.Duration = TimeSpan.FromSeconds(0.3); Storyboard.SetTarget(st, inner); st.Children.Add(xanim); st.Children.Add(yanim); st.Children.Add(w); st.Children.Add(h); (inner as Grid).Tag = item; st.Completed += async(a, b) => { //chapters.ItemsSource = model.CurrentManga.Chapters; if (m == null) { return; } //svar v = new NavigationThemeTransition(); //v.DefaultNavigationTransitionInfo = null; Frame.Navigate(typeof(MangaPage), model, null); //chapters.Visibility = Visibility.Visible; //grid.Visibility = Visibility.Visible; //introInfo.Begin(); }; st.Begin(); }
void DataGridRenderer_Tap(object sender, TappedRoutedEventArgs e) { tab.SingleTap(e.GetPosition(this).X, e.GetPosition(this).Y); e.Handled = false; }
private void OnTapped(object sender, TappedRoutedEventArgs e) { Map.InvokeInfo(e.GetPosition(this).ToMapsui(), _renderer.SymbolCache); }
private void gameCanvas_Tapped(object sender, TappedRoutedEventArgs e) { game.addTower(e.GetPosition(this).X, e.GetPosition(this).Y); }
private void animationView_Tapped(object sender, TappedRoutedEventArgs e) { var p = e.GetPosition(animationView); animationView.doTouch(p.X, p.Y); }
private void RadialSlider_Tapped(object sender, TappedRoutedEventArgs e) { SetValueFromPoint(e.GetPosition(this)); ValueChanged?.Invoke(this, EventArgs.Empty); }
private static void OnTap(object sender, TappedRoutedEventArgs e) { Grid c = sender as Grid; ICommand cmd = c.GetValue(SelectionTappedCommandBehavior.CommandProperty) as ICommand; object param = c.GetValue(SelectionTappedCommandBehavior.CommandParameterProperty) ?? e.GetPosition(c); if (cmd != null && cmd.CanExecute(param)) { cmd.Execute(param); } }
/// <summary> /// Informs the view model when there is a tapp to the RemoveLightPromptGrid. /// </summary> private void RemoveLightPromptGrid_Tapped(object sender, TappedRoutedEventArgs e) { var point = e.GetPosition(sender as UIElement); _viewModel.TryRemoveLight((float)point.X, (float)point.Y); }
private async void OpeningMessage_Tapped(object sender, TappedRoutedEventArgs e) { Point p = e.GetPosition(this); await OpenPhoto(); }
private void MenuPositionTap(object sender, TappedRoutedEventArgs e) { TestDialog.TestMenu(e.GetPosition(null)); }
private void TabbedDiagrams_Tapped(object sender, TappedRoutedEventArgs e) { Point position = e.GetPosition(rootgrid); }
private void RadialGauge_Tapped(object sender, TappedRoutedEventArgs e) { Focus(FocusState.Keyboard); SetGaugeValueFromPoint(e.GetPosition(this)); HandleValueChangeCompleted(); }
private void dotsButton_Tapped(object sender, TappedRoutedEventArgs e) { this.ShowPopupMenu(this.DataContext, sender, e.GetPosition((FrameworkElement)sender), this.ContextMode); }
private void Control_Tapped(object sender, TappedRoutedEventArgs e) { var pos = e.GetPosition((UIElement)sender); Element.OnTapped(pos.X / Element.ViewScale + Element.ViewPoint.X, pos.Y / Element.ViewScale + Element.ViewPoint.Y); }
/** * タップ位置から全フレーム内の位置(シーク位置)を取得する。 */ public double GetTappedPosition(TappedRoutedEventArgs e) { var pos = e.GetPosition(mContainerGrid); return((ScrollableWidth * Position + pos.X) / FrameListWidth); }
private void Grid_Tapped_1(object sender, TappedRoutedEventArgs e) { var pos = e.GetPosition(this); AddWithFocus(string.Format("{0}:{1} Tap", (int)pos.X, (int)pos.Y)); }
private async void ContentTextBlock_Tapped(object sender, TappedRoutedEventArgs e) { if (IsIndexPanelOpen) { IsIndexPanelOpen = false; e.Handled = true; return; } var p = e.GetPosition((UIElement)sender); TextPointer tp = null; if (sender is RichTextBlock) { var rt = (RichTextBlock)sender; tp = rt.GetPositionFromPoint(p); } else { var rt = (RichTextBlockOverflow)sender; tp = rt.GetPositionFromPoint(p); } var element = tp.Parent as TextElement; while (element != null && !(element is Paragraph)) { if (element.ContentStart != null && element != element.ElementStart.Parent) { element = element.ElementStart.Parent as TextElement; } else { element = null; } } if (element == null) { return; } var line = (LineViewModel)element.GetValue(ParagrahViewModelProperty); if (!(line.IsImage || ViewModel.EnableComments)) { return; } ((FrameworkElement)CommentsFlyout.Content).DataContext = line; if (ViewModel.EnableComments) { CommentsTool.Visibility = Visibility.Visible; if (AppGlobal.IsSignedIn) { CommentsInputTool.Visibility = Windows.UI.Xaml.Visibility.Visible; } else { CommentsInputTool.Visibility = Windows.UI.Xaml.Visibility.Collapsed; } } else { CommentsTool.Visibility = Visibility.Collapsed; } // Sync Flyout Theme //if (this.RequestedTheme == ElementTheme.Light) // ((FrameworkElement)CommentsFlyout.Content).RequestedTheme = ElementTheme.Light; //else // ((FrameworkElement)CommentsFlyout.Content).RequestedTheme = ElementTheme.Dark; Flyout.ShowAttachedFlyout((FrameworkElement)sender); if (line.HasComments && !line.IsLoading) { await line.LoadCommentsAsync(); } }
private void ScobblerLine_Tapped(object sender, TappedRoutedEventArgs e) { SetScobblerPercentage(sender, e.GetPosition(sender as UIElement)); }
private void More_Tapped(object sender, TappedRoutedEventArgs e) { //NameBolck.Text int count = 0; foreach (var temp in Item_list) { if (NameBolck.Text == temp.Name) { Item_ = temp; currentIndex = count - 1; break; } count++; } ((MenuFlyout)FlyoutBase.GetAttachedFlyout((FrameworkElement)sender)).ShowAt(sender as UIElement, e.GetPosition(sender as UIElement)); }
private void RadialGauge_Tapped(object sender, TappedRoutedEventArgs e) { SetGaugeValueFromPoint(e.GetPosition(this)); }
private void HandleTap(TappedRoutedEventArgs e) { Point tappedPoint = e.GetPosition(this); ITextRange textRange = this.Document.GetRangeFromPoint(tappedPoint, PointOptions.ClientCoordinates); textRange.StartOf(TextRangeUnit.Link, true); if (textRange.Character != '\r' && textRange.CharacterFormat.Underline == UnderlineType.Single) { string content; this.Document.GetText(TextGetOptions.None, out content); textRange.StartPosition--; textRange.EndPosition++; while (!(textRange.Text.StartsWith(" ") || textRange.Text.StartsWith("\r")) && textRange.StartPosition > 0) { textRange.StartPosition--; } while (!(textRange.Text.EndsWith(" ") || textRange.Text.EndsWith("\r")) && textRange.EndPosition < content.Length) { textRange.EndPosition++; } this.link = textRange.Text; if (!string.IsNullOrWhiteSpace(this.link)) { this.link = this.link.Trim(' '); this.link = this.link.Trim('\r'); if (!this.link.StartsWith("http://", StringComparison.OrdinalIgnoreCase) && !this.link.StartsWith("https://", StringComparison.OrdinalIgnoreCase)) { this.link = "http://" + this.link; } if (this.openLinkPopup == null) { this.openLinkPopup = new Popup { IsLightDismissEnabled = true, Child = new HyperlinkPopupContent() }; } this.openLinkPopup.IsOpen = false; ((HyperlinkPopupContent)this.openLinkPopup.Child).Hyperlink = this.link; var frame = Window.Current.Content as Frame; if (frame != null && frame.Content is Page) { var page = frame.Content as Page; var position = e.GetPosition(page); this.openLinkPopup.VerticalOffset = position.Y; if (ResponsiveHelper.IsUsingSmallLayout()) { this.openLinkPopup.HorizontalOffset = 15; ((HyperlinkPopupContent)this.openLinkPopup.Child).MaxWidth = 292; } else { this.openLinkPopup.HorizontalOffset = position.X; } } this.openLinkPopup.IsOpen = true; } } }
private void OnTapped(object sender, TappedRoutedEventArgs e) { var tabPosition = e.GetPosition(this).ToMapsui(); Map.InvokeInfo(tabPosition, tabPosition, 1, _renderer.SymbolCache, WidgetTouched); }
async void gridView_Tapped(object sender, TappedRoutedEventArgs e) { { PagePicture lpCurrent = (PagePicture)mainImage.Items[0]; PageFile lpfFile = null; var up = false; if (lpCurrent != null) { var position = e.GetPosition(mainImage); var height3 = mainImage.ActualHeight / 3; var width2 = mainImage.ActualWidth / 2; var stepSize = StepSize.small; if (position.X < 50 || position.X > mainImage.ActualWidth - 75) { up = position.X > mainImage.ActualWidth - 75; if (position.Y < height3) { stepSize = StepSize.small; } else if (position.Y < 2 * height3) { stepSize = StepSize.large; } else { stepSize = StepSize.seriesTag; } } else if (position.Y < 50 || position.Y > mainImage.ActualHeight - 75) { up = position.Y > mainImage.ActualHeight - 75; stepSize = StepSize.series; } else { e.Handled = false; return; } if (up) { lpfFile = lpCurrent.StepNext(stepSize); } else { lpfFile = lpCurrent.StepPrevious(stepSize); } if (lpfFile != null) { await LibraryView.PictureImageLoad(lpfFile, mainImage); LibraryView.onPictureChanged(sender, new OnPictureChangedArgs(lpfFile, "grid")); } else { e.Handled = false; } } } }