Inheritance: Windows.UI.Xaml.RoutedEventArgs, IRightTappedRoutedEventArgs
        private void PaymentViewModelList_RightTapped(object sender, RightTappedRoutedEventArgs e)
        {
            var senderElement = sender as FrameworkElement;
            var flyoutBase = FlyoutBase.GetAttachedFlyout(senderElement);

            flyoutBase.ShowAt(senderElement);
        }
        private async void BookmarkItem_RightTapped(object sender, Windows.UI.Xaml.Input.RightTappedRoutedEventArgs e)
        {
            var resourceLoader = Windows.ApplicationModel.Resources.ResourceLoader.GetForCurrentView();
            var hvm            = (sender as FrameworkElement).DataContext as HistoryItemViewModel;
            var menu           = new PopupMenu();
            var label          = resourceLoader.GetString("DeleteBookmarkLabel");

#if WINDOWS_APP
            var newWindowLabel = resourceLoader.GetString("OpenInNewWindowLabel");
            menu.Commands.Add(new UICommand(newWindowLabel, async(command) => {
                await NavigateToReadingPageAsync(hvm.SeriesTitle, hvm.Position, true);
            }));
#endif

            menu.Commands.Add(new UICommand(label, async(command) =>
            {
                await RemoveBookmarkFromFavorite(hvm);
            }));

            try
            {
                var chosenCommand = await menu.ShowForSelectionAsync(GetElementRect((FrameworkElement)sender));
            }
            catch (Exception)
            {
            }
        }
 private void WallpaperOnRightTapped(object sender, RightTappedRoutedEventArgs e)
 {
     if(ViewModelLocator.Mobile)
         return;
     var grid = sender as FrameworkElement;
     FlyoutBase.GetAttachedFlyout(grid).ShowAt(grid);
 }
 private void StackPanel_RightTapped(object sender, RightTappedRoutedEventArgs e)
 {
     var uiSender = sender as UIElement;
     var flyout = (FlyoutBase)uiSender.GetValue(FlyoutBase.AttachedFlyoutProperty);
     flyout.Placement = FlyoutPlacementMode.Bottom;
     flyout.ShowAt(uiSender as FrameworkElement);
 }
 protected override void OnRightTapped(RightTappedRoutedEventArgs e) {
     if (_IsPointerPressed) {
         ShowContextMenu(null, e.GetPosition(null));
         e.Handled = true;
     }
     base.OnRightTapped(e);
 }
        private void Grid_RightTapped(object sender, Windows.UI.Xaml.Input.RightTappedRoutedEventArgs e)
        {
            var ObjectPressed = (sender as Grid).DataContext as ListedItem;

            gv.SelectedItem = ObjectPressed;
            context.ShowAt(sender as Grid, e.GetPosition(sender as Grid));
        }
 async  private void ShowImagePopupMenu(object sender, RightTappedRoutedEventArgs e)
  {
      PopupMenu menu = new PopupMenu();
      menu.Commands.Add(new UICommand("分享到", async (command) =>
      {
          MessageDialog md = new MessageDialog(command.Label);
          await md.ShowAsync();
      }));
      menu.Commands.Add(new UICommand("另存为", async (command) =>
      {
          MessageDialog md = new MessageDialog(command.Label);
          await md.ShowAsync();
      }));
      menu.Commands.Add(new UICommand("编辑", async (command) =>
      {
          MessageDialog md = new MessageDialog(command.Label);
          await md.ShowAsync();
      }));
      menu.Commands.Add(new UICommandSeparator());
      menu.Commands.Add(new UICommand("打印", async (command) =>
      {
          MessageDialog md = new MessageDialog(command.Label);
          await md.ShowAsync();
      }));
      menu.Commands.Add(new UICommand("全屏", async (command) =>
      {
          MessageDialog md = new MessageDialog(command.Label);
          await md.ShowAsync();
      }));
      var chosenCommand = await menu.ShowForSelectionAsync(GetElementRect((FrameworkElement)sender));
  }
        private new async void RightTapped(object sender, RightTappedRoutedEventArgs e)
        {
            Tweet tweet = null;
            var clickBorder = e.OriginalSource as TextBlock;
            if (clickBorder != null)
            {
                tweet = (Tweet)clickBorder.DataContext;
            }
            // Create a menu and add commands specifying a callback delegate for each.
            // Since command delegates are unique, no need to specify command Ids.
            var menu = new PopupMenu();
            menu.Commands.Add(new UICommand("open tweet", (command) =>
            {
                OpenPage(tweet);
            }));
            menu.Commands.Add(new UICommand("copy to clipboard", (command) =>
            {
                CopyText();
            }));


            var chosenCommand = await menu.ShowForSelectionAsync(GetElementRect((FrameworkElement)sender));
            if (chosenCommand == null) // The command is null if no command was invoked.
            {

            }
        }
        private void AccountList_RightTapped(object sender, RightTappedRoutedEventArgs e)
        {
            var senderElement = sender as FrameworkElement;
            var flyoutBase = FlyoutBase.GetAttachedFlyout(senderElement) as MenuFlyout;

            flyoutBase?.ShowAt(senderElement, e.GetPosition(senderElement));
        }
Exemple #10
0
        private void NavButton_RightTapped(object sender, Windows.UI.Xaml.Input.RightTappedRoutedEventArgs e)
        {
            var button = new InfoElement(sender);

            button.HamburgerButtonInfo.RaiseRightTapped(e);
            e.Handled = true;
        }
Exemple #11
0
 internal void RaiseRightTapped(Windows.UI.Xaml.Input.RightTappedRoutedEventArgs args)
 {
     if (!IsFullScreen)
     {
         this.RightTapped?.Invoke(this, args);
     }
 }
        private void ListView_RightTapped(object sender, Windows.UI.Xaml.Input.RightTappedRoutedEventArgs e)
        {
            var listView = (FrameworkElement)sender;

            // ListViewItemPresenter is the item tapped
            if (!(e.OriginalSource is ListViewItemPresenter item))
            {
                return;
            }
            // data is the binded dataEntry
            data = item.Content as DataEntry;
            var flyout     = new MenuFlyout();
            var flyoutItem = new MenuFlyoutItem
            {
                Text = "分享",
                Tag  = "share",
            };

            flyoutItem.Click += MenuFlyoutItemTapped;
            var flyout_remove = new MenuFlyoutItem
            {
                Text = "删除",
                Tag  = "delete",
            };

            flyout_remove.Click += (object sender2, RoutedEventArgs e2) =>
            {
                provider.DeleteDataEntry(data);
            };
            flyout.Items.Add(flyoutItem);
            flyout.Items.Add(flyout_remove);
            flyout.ShowAt(item);
        }
 private void ImageToAdd_RightTapped(object sender, RightTappedRoutedEventArgs e)
 {
     if (sender.GetType() == typeof(Image))
         ImageToAdd_CreateDropDownMenu(sender as Image, e.GetPosition(sender as Image));
     else
         throw new Exception("Error: Expected sender to be Image but was: " + sender.GetType().ToString());
 }
Exemple #14
0
 private void SavedFile_RightTapped(object sender, RightTappedRoutedEventArgs e)
 {
     var item = sender as FrameworkElement;
     if(item != null)
     {
         FlyoutBase.ShowAttachedFlyout(item);
     }
 }
 private void LayoutRoot_RightTapped(object sender, RightTappedRoutedEventArgs e)
 {
     if (IsHolding)
         return;
     var targetElement = sender as FrameworkElement;
     MenuFlyout flyout = (MenuFlyout)FlyoutBase.GetAttachedFlyout(targetElement);
     flyout.ShowAt(targetElement, e.GetPosition(targetElement));
 }
Exemple #16
0
 private void RadioButton_RightTapped(object sender, Windows.UI.Xaml.Input.RightTappedRoutedEventArgs e)
 {
     FrameworkElement senderElement = sender as FrameworkElement;
     // If you need the clicked element:
     // Item whichOne = senderElement.DataContext as Item;
     FlyoutBase flyoutBase = FlyoutBase.GetAttachedFlyout(senderElement);
     flyoutBase.ShowAt(senderElement);
 }
 private void UiElementOnRightTapped(object sender, RightTappedRoutedEventArgs e)
 {
     if (isPointerPressed)
     {
         ShowMenu(e.GetPosition(uiElement));
         e.Handled = true;
     }
 }
        private void TopicOnRightClick(object sender, RightTappedRoutedEventArgs e)
        {
            if (ViewModel.PrevArgs.WorkMode == ForumBoardPageWorkModes.WatchedTopics || ViewModel.PrevArgs.WorkMode == ForumBoardPageWorkModes.UserSearch)
                return;

            if ((e.OriginalSource as FrameworkElement).DataContext is ForumTopicEntryViewModel)
                ItemFlyoutService.ShowForumTopicFlyout(e.OriginalSource as FrameworkElement);
            e.Handled = true;
        }
Exemple #19
0
        private void Grid_RightTapped( object sender, RightTappedRoutedEventArgs e )
        {
            Grid ItemGrid = ( Grid ) sender;
            FlyoutTargetItem = ItemGrid.DataContext as BookmarkListItem;

            if ( FlyoutTargetItem.AnchorIndex != -1 )
            {
                FlyoutBase.ShowAttachedFlyout( ItemGrid );
            }
        }
Exemple #20
0
 private void TrackStackPanel_RightTapped(object sender, RightTappedRoutedEventArgs e)
 {
     FrameworkElement senderElement = sender as FrameworkElement;
     FlyoutBase flyoutBase = FlyoutBase.GetAttachedFlyout(senderElement);
     flyoutBase.ShowAt(senderElement);
     //var flyout = this.Resources["TrackContextMenu"] as MenuFlyout;
     //flyout.ShowAt((UIElement)AlbumPage, new Windows.Foundation.Point(0, 0));
     //flyout.ShowAt((UIElement)sender, new Windows.Foundation.Point(0, 0));
     //flyout.ShowAt((FrameworkElement)sender);
 }
Exemple #21
0
 private void OcrListItem_RightTapped(object sender, RightTappedRoutedEventArgs e)
 {
     FrameworkElement element = sender as FrameworkElement;
     if (element == null)
     {
         return;
     }
     var flyout = FlyoutBase.GetAttachedFlyout(element) as MenuFlyout;
     flyout?.ShowAt(this, e.GetPosition(null));
 }
        async void OnTextBlockRightTapped(object sender, RightTappedRoutedEventArgs e) {
            PopupMenu popupMenu = new PopupMenu();
            popupMenu.Commands.Add(new UICommand("Larger Font", OnFontSizeChanged, 1.2));
            popupMenu.Commands.Add(new UICommand("Smaller Font", OnFontSizeChanged, 1 / 1.2));
            popupMenu.Commands.Add(new UICommandSeparator());
            popupMenu.Commands.Add(new UICommand("Red", OnColorChanged, Colors.Red));
            popupMenu.Commands.Add(new UICommand("Green", OnColorChanged, Colors.Green));
            popupMenu.Commands.Add(new UICommand("Blue", OnColorChanged, Colors.Blue));

            await popupMenu.ShowAsync(e.GetPosition(this));
        }
        private void NavButton_RightTapped(object sender, Windows.UI.Xaml.Input.RightTappedRoutedEventArgs e)
        {
            DebugWrite($"Info: {(sender as FrameworkElement).DataContext}");

            var radio = sender as RadioButton;
            var info  = radio.DataContext as HamburgerButtonInfo;

            info.RaiseRightTapped(e);

            // do not bubble to SplitView
            e.Handled = true;
        }
        private async void ListViewNotes_RightTapped(object sender, RightTappedRoutedEventArgs e)
        {
            var menu = new PopupMenu();
            menu.Commands.Add(new UICommand("Edit"));

            var chosenCommand = await menu.ShowForSelectionAsync(GetElementRect((FrameworkElement)sender));
            if (chosenCommand.Label == "Edit")
            {
                this.Frame.Navigate(
                typeof(NoteDetailPage),
                sender,
                new Windows.UI.Xaml.Media.Animation.DrillInNavigationTransitionInfo());
            }
        }
        private void ePubItemRightTapped(object sender, RightTappedRoutedEventArgs e)
        {
            FrameworkElement ancestor = sender as FrameworkElement;

            while (ancestor != null)
            {
                if (ancestor is MainPage)
                {
                    (ancestor as MainPage).ePubItemRightTapped(sender, e);
                    break;
                }

                ancestor = VisualTreeHelper.GetParent(ancestor) as FrameworkElement;
            }
        }
Exemple #26
0
        private void listView_RightTapped(object sender, RightTappedRoutedEventArgs e)
        {
            FrameworkElement element = (FrameworkElement)sender;

            if (e.OriginalSource.GetType() == typeof(ListViewItemPresenter))
                device = (Device)((ContentPresenter)e.OriginalSource).Content;
            else if (e.OriginalSource.GetType() == typeof(StackPanel))
                device = (Device)((FrameworkElement)e.OriginalSource).DataContext;
            else
                device = (Device)((FrameworkElement)((FrameworkElement)e.OriginalSource).Parent).DataContext;

            if (device.MacAddress.StartsWith("b8:27:eb"))
                mf_pi.ShowAt(element, point);
            else
                mf_netmf.ShowAt(element, point);
        }
        private void drawingCanvas_RightTapped(object sender, RightTappedRoutedEventArgs e)
        {
            Point mouseLocation = e.GetPosition(this.drawingCanvas);
            Circle myCircle = new Circle(100);

            if (myCircle is IDraw)
            {
                IDraw drawCircle = myCircle;
                drawCircle.SetLocation((int)mouseLocation.X, (int)mouseLocation.Y);
                drawCircle.Draw(drawingCanvas);
            }
            if (myCircle is IColor)
            {
                IColor colorCircle = myCircle;
                colorCircle.SetColor(Colors.HotPink);
            }
        }
 private void Grid_RightTapped(object sender, RightTappedRoutedEventArgs e)
 {
     var grid = sender as Grid;
     var childCount = VisualTreeHelper.GetChildrenCount(grid);
     for (int i = 0; i < childCount; i++)
     {
         var child = VisualTreeHelper.GetChild(grid, i);
         if (child is TextBlock)
         {
             if (child.GetValue(TextBlock.NameProperty).ToString() == "text_uniqueId")
             {
                 _rightTappedGuid = child.GetValue(TextBlock.TextProperty).ToString();
             }
         }
     }
     FlyoutBase.ShowAttachedFlyout(sender as Grid);
 }
 private async void OnPhoneModelClicked(object sender, RightTappedRoutedEventArgs e)
 {
     var popup = new PopupMenu();
     popup.Commands.Add(new UICommand("Open", (command) =>
     {
         this.TextBoxResult.Text = "Open...";
     }));
     popup.Commands.Add(new UICommand("Open with", (command) =>
     {
         this.TextBoxResult.Text = "Opened with...";
     }));
     popup.Commands.Add(new UICommand("Save with", (command) =>
     {
         this.TextBoxResult.Text = "Save with...";
     }));
     var chosenCommand = await popup.ShowForSelectionAsync(GetElementRect((FrameworkElement)sender));
     if (chosenCommand == null)
     {
         this.TextBoxResult.Text = "Nothing chosen";
     }
 }
        private void ButtonCirclePeek_RightTapped(object sender, RightTappedRoutedEventArgs e)
        {
            UpdateMedium(new TileBindingContentAdaptive()
            {
                PeekImage = new TilePeekImage()
                {
                    Source = "https://unsplash.it/100",

                    HintCrop = TilePeekImageCrop.Circle
                },

                Children =
                {
                    new TileText()
                    {
                        Text = "Matt Hidinger sent you a friend request.",
                        Wrap = true
                    }
                }
            });
        }
Exemple #31
0
        private async void AttachmentImage_RightTapped(object sender, RightTappedRoutedEventArgs e)
        {
            // Create a menu and add commands specifying a callback delegate for each.
            // Since command delegates are unique, no need to specify command Ids.
            var menu = new PopupMenu();
            menu.Commands.Add(new UICommand("Open with", (command) =>
            {
                OutputTextBlock.Text = "'" + command.Label + "' selected";
            }));
            menu.Commands.Add(new UICommand("Save attachment", (command) =>
            {
                OutputTextBlock.Text = "'" + command.Label + "' selected";
            }));

            // We don't want to obscure content, so pass in a rectangle representing the sender of the context menu event.
            // We registered command callbacks; no need to handle the menu completion event
            OutputTextBlock.Text = "Context menu shown";
            var chosenCommand = await menu.ShowForSelectionAsync(GetElementRect((FrameworkElement)sender));
            if (chosenCommand == null) // The command is null if no command was invoked.
            {
                OutputTextBlock.Text = "Context menu dismissed";
            }
        }
        private async void ellipse_RightTapped(object sender, RightTappedRoutedEventArgs e)
        {
            Friend selectedFriend = (sender as Ellipse).DataContext as Friend;
            (DataContext as FriendsViewModel).SelectedFriend = selectedFriend;
            PopupMenu menu = new PopupMenu();

            menu.Commands.Add(new UICommand(AppResources.General_SeeMore, (command) =>
            {
                (DataContext as FriendsViewModel).TapOnFriend.Execute(null);
            }));
            menu.Commands.Add(new UICommand(AppResources.General_GetDirections, (command) =>
            {
                staticObjects.GoalLongitude = selectedFriend.LastPosition.Longitude;
                staticObjects.GoalLatitude = selectedFriend.LastPosition.Latitude;
                staticObjects.FriendProfilePicture = new Uri(selectedFriend.Picture, UriKind.Absolute);
                (DataContext as FriendsViewModel).GetDirections.Execute(null);
            }));

            menu.Commands.Add(new UICommand(AppResources.General_ShareFacebook, (command) =>
            {
                Share.ShareToFacebook("http://bing.com/maps/default.aspx" +
                "?cp=" + selectedFriend.LastPosition.Latitude + "~" + selectedFriend.LastPosition.Longitude +
                "&lvl=18" +
                "&style=r",
                String.Format(AppResources.General_LastPositionMessageFriend, 
                    selectedFriend.Name, 
                    selectedFriend.LastPosition.Address, 
                    selectedFriend.LastPosition.RegisteredAt.ToString()+ " GMT", 
                    "http://bing.com/maps/default.aspx"),selectedFriend.Picture);
            }));
            menu.Commands.Add(new UICommand(AppResources.General_ShareEmail, (command) =>
            {
                SetSharingContent(selectedFriend);
                Share.ShowShareBar();
            }));
            await menu.ShowForSelectionAsync(Screen.GetElementRect((FrameworkElement)sender));
        }
        private void TrackItem_RightTapped(object sender, Windows.UI.Xaml.Input.RightTappedRoutedEventArgs e)
        {
            FrameworkElement  senderElement = sender as FrameworkElement;
            FlyoutBase        flyoutBase    = FlyoutBase.GetAttachedFlyout(senderElement);
            FlyoutShowOptions options       = new FlyoutShowOptions
            {
                Placement = FlyoutPlacementMode.RightEdgeAlignedTop,
                Position  = e.GetPosition(senderElement),
                ShowMode  = FlyoutShowMode.Standard
            };

            flyoutBase.ShowAt(senderElement, options);
            //update focus state
            Messenger.Default.Send(new MessengerHelper
            {
                Action = MessengerAction.RightTapped,
                Target = TargetView.Tracks,
                Item   = senderElement.DataContext as ItemBase
            });

            e.Handled = true;

            flyoutBase.Closed += TracksFlyoutBase_Closed;
        }
Exemple #34
0
 private void StackPanel_RightTapped(object sender, RightTappedRoutedEventArgs e)
 {
 }
        private async void OnItemRightTapped(object sender, RightTappedRoutedEventArgs e)
        {
            FrameworkElement element = sender as FrameworkElement;
            IContentViewModel content = element.DataContext as IContentViewModel;
            if(content != null)
            {
                // detach the appbar opening event.
                this.BottomAppBar.Opened -= OnBottomAppBarOpened;

                AwfulContextMenu menu = new AwfulContextMenu();
                var hasMenu = await content.OnContextMenuOpeningAsync("item", menu, this, this.progress);

                if (hasMenu)
                {
                    var itemContextBar = menu.ToAppBarButtonContainer(true);
                    EventHandler<object> opened = null;
                    opened = new EventHandler<object>((obj, args) =>
                    {
                        this.BottomAppBar.Opened -= opened;
                        this.BottomAppBar.Opened += OnBottomAppBarOpened;
                    });

                    this.SelectBottomAppBar(itemContextBar);
                    this.BottomAppBar.Opened += opened;
                    this.BottomAppBar.IsOpen = true;
                }

                else
                {
                    this.BottomAppBar.Opened += OnBottomAppBarOpened;
                    this.BottomAppBar.IsOpen = false;
                }
            }
        }
 private void Grid_RightTapped(object sender, RightTappedRoutedEventArgs e)
 {
     Debug.WriteLine("RightTapped");
 }
Exemple #37
0
 private void OnContextMenu(object sender, Windows.UI.Xaml.Input.RightTappedRoutedEventArgs e)
 {
     Scenario1OutputText.Text = "Invoked with right-click.";
 }
Exemple #38
0
 private void ClearButton_RightClick(object sender, Windows.UI.Xaml.Input.RightTappedRoutedEventArgs e)
 {
     xamloverlay.Children.Clear();
 }
Exemple #39
0
 void RightClickOverride(object sender, Windows.UI.Xaml.Input.RightTappedRoutedEventArgs e)
 {
     Scenario2OutputText.Text = "The ContextMenu event was handled.  The EdgeGesture event will not fire.";
     e.Handled = true;
 }
 private async void RightClickMessageDialogBehavior_RightTapped(object sender, RightTappedRoutedEventArgs e)
 {
     await new MessageDialog(this.Message, this.Title).ShowAsync();
 }
 private void Page_RightTapped(object sender, Windows.UI.Xaml.Input.RightTappedRoutedEventArgs e)
 {
     ContinuousRecognize_Click(sender, e);
 }
 internal void RaiseRightTapped(Windows.UI.Xaml.Input.RightTappedRoutedEventArgs args)
 {
     RightTapped?.Invoke(this, args);
 }
Exemple #43
0
 //Calls reset when main button is rightclicked or 'righttapped'
 private void btnMain_RightTapped(object sender, Windows.UI.Xaml.Input.RightTappedRoutedEventArgs e)
 {
     reset();
     ButtonClickEventHandler(sender, e);
     spMain.Visibility = Visibility.Collapsed;
 }
 private void AnimeItemOnRightClick(object sender, RightTappedRoutedEventArgs e)
 {
     ItemFlyoutService.ShowAnimeGridItemFlyout(sender as FrameworkElement);
 }
Exemple #45
0
 private void PhotoAlbumViewer_RightTapped(object sender, Windows.UI.Xaml.Input.RightTappedRoutedEventArgs e)
 {
     gridContext.ShowAt(sender as Grid, e.GetPosition(sender as Grid));
 }