Exemple #1
0
 private void UserControl_Tapped(object sender, TappedRoutedEventArgs e)
 {
     if (ItemTapped != null)
     {
         ItemTapped?.Invoke(sender, null);
     }
 }
        public override void RowDeselected(UITableView tableView, NSIndexPath indexPath)
        {
            var item = GetItemByIndex(indexPath);
            var args = new GenericEventArgs <TItem>(item);

            ItemTapped?.Invoke(this, args);
        }
Exemple #3
0
        /// <summary>
        /// Adds tap gesture recognizer to an image - specific menu item.
        /// </summary>
        /// <param name="image">Image - menu item.</param>
        /// <param name="value">Menu item description.</param>
        private void ConnectItemWithCLick(Image image, string value)
        {
            image.GestureRecognizers.Add(new TapGestureRecognizer()
            {
                Command = new Command(async() =>
                {
                    ItemTapped?.Invoke(this, new SelectedItemChangedEventArgs(value));

                    await CloseMenu();

                    if (value == "Settings")
                    {
                        App.router.ChangePageTo(new Views.SettingsPage());
                    }
                    else if (value == "Followings")
                    {
                        App.router.ChangePageTo(new Views.FollowingsPage());
                    }
                    else if (value == "Map")
                    {
                        App.router.ChangePageTo(new Views.MainMap());
                    }
                }),
                NumberOfTapsRequired = 1
            });
        }
 private void HandleOptionClicked(RadialMenuItem item, Enumerations.Enumerations.RadialMenuLocation value)
 {
     item.GestureRecognizers.Clear();
     item.GestureRecognizers.Add(new TapGestureRecognizer()
     {
         Command = new Command(async() =>
         {
             ParentInBackgroundItem = item;
             ItemTapped?.Invoke(this, value);
             if (item.ChildItems?.Count > 0)
             {
                 IsChildItemOpened = true;
                 await HideButtons(ParentInBackgroundItem.ChildItems);
                 CloseMenu(item);//Navigate to submenu
             }
             else
             {
                 IsOpened          = false;
                 IsChildItemOpened = false;
                 CloseMenu();
             }
         }),
         NumberOfTapsRequired = 1
     });
 }
Exemple #5
0
        public void NotifyRowTapped(int groupIndex, int inGroupIndex, Cell cell = null)
        {
            var group = TemplatedItems.GetGroup(groupIndex);

            bool changed = _previousGroupSelected != groupIndex || _previousRowSelected != inGroupIndex;

            _previousRowSelected   = inGroupIndex;
            _previousGroupSelected = groupIndex;

            // A11y: Keyboards and screen readers can deselect items, allowing -1 to be possible
            if (cell == null && inGroupIndex != -1)
            {
                cell = group[inGroupIndex];
            }

            // Set SelectedItem before any events so we don't override any changes they may have made.
            if (SelectionMode != ListViewSelectionMode.None)
            {
                SetValueCore(SelectedItemProperty, cell?.BindingContext, SetValueFlags.ClearOneWayBindings | SetValueFlags.ClearDynamicResource | (changed ? SetValueFlags.RaiseOnEqual : 0));
            }

            cell?.OnTapped();

            ItemTapped?.Invoke(this, new ItemTappedEventArgs(ItemsSource.Cast <object>().ElementAt(groupIndex), cell?.BindingContext));
        }
Exemple #6
0
        private void Tapped_Tapped(object sender, EventArgs e)
        {
            var obj = (ExtendedLabel)sender;

            var ev = new ExtendedLabelTappedEvent();

            ev.Text = obj.Text;
            ItemTapped?.Invoke(sender, ev);
        }
Exemple #7
0
 private void ListView_ItemTapped(object sender, ItemTappedEventArgs e)
 {
     if (ItemTappedCommand != null && ItemTappedCommand.CanExecute(e.Item))
     {
         ItemTappedCommand.Execute(e.Item);
     }
     ItemTapped?.Invoke(this, e.Item);
     Close_Tapped(this, null);
 }
        private void Tapped_Tapped(object sender, EventArgs e)
        {
            var obj = (OptionCell)sender;
            var optioncelleventargs = new OptionCellEventArgs
            {
                HeaderText    = obj.HeaderText,
                SubHeaderText = obj.SubHeaderText
            };

            ItemTapped?.Invoke(obj, optioncelleventargs);
        }
 private void ItemsList_ItemTapped(object sender, SelectionChangedEventArgs e)
 {
     ItemTapped?.Invoke(sender, e);
     if (AutoPop)
     {
         Device.BeginInvokeOnMainThread(async() =>
         {
             await Shell.Current.Navigation.PopAsync();
         });
     }
 }
Exemple #10
0
 private void HandleOptionClicked(Image image, string value)
 {
     image.GestureRecognizers.Add(new TapGestureRecognizer()
     {
         Command = new Command(() =>
         {
             ItemTapped?.Invoke(this, new SelectedItemChangedEventArgs(value));
             CloseMenu();
         }),
         NumberOfTapsRequired = 1
     });
 }
Exemple #11
0
 private void HandleOptionClicked(RadialMenuItem item, Enumerations.Enumerations.RadialMenuLocation value)
 {
     item.GestureRecognizers.Add(new TapGestureRecognizer()
     {
         Command = new Command(() =>
         {
             ItemTapped?.Invoke(this, value);
             CloseMenu();
         }),
         NumberOfTapsRequired = 1
     });
 }
        protected async Task TapItem()
        {
            IsActive = true;
            await Task.Delay(10);

#pragma warning disable 4014
            Task.Run(async() =>
#pragma warning restore 4014
            {
                await Task.Delay(250);
                IsActive = false;
            });

            ItemTapped?.Invoke(this, EventArgs.Empty);
        }
Exemple #13
0
        internal void NotifyRowTapped(int groupIndex, int inGroupIndex, Cell cell = null)
        {
            var group = TemplatedItems.GetGroup(groupIndex);

            bool changed = _previousGroupSelected != groupIndex || _previousRowSelected != inGroupIndex;

            _previousRowSelected   = inGroupIndex;
            _previousGroupSelected = groupIndex;
            if (cell == null)
            {
                cell = group[inGroupIndex];
            }

            // Set SelectedItem before any events so we don't override any changes they may have made.
            SetValueCore(SelectedItemProperty, cell.BindingContext, SetValueFlags.ClearOneWayBindings | SetValueFlags.ClearDynamicResource | (changed ? SetValueFlags.RaiseOnEqual : 0));

            cell.OnTapped();

            ItemTapped?.Invoke(this, new ItemTappedEventArgs(ItemsSource.Cast <object>().ElementAt(groupIndex), cell.BindingContext));
        }
Exemple #14
0
        public void NotifyRowTapped(int groupIndex, int inGroupIndex, Cell cell, bool isContextMenuRequested)
        {
            var group = TemplatedItems.GetGroup(groupIndex);

            bool changed = _previousGroupSelected != groupIndex || _previousRowSelected != inGroupIndex;

            _previousRowSelected   = inGroupIndex;
            _previousGroupSelected = groupIndex;

            // A11y: Keyboards and screen readers can deselect items, allowing -1 to be possible
            if (cell == null && inGroupIndex >= 0 && group.Count > inGroupIndex)
            {
                cell = group[inGroupIndex];
            }

            // Set SelectedItem before any events so we don't override any changes they may have made.
            if (SelectionMode != ListViewSelectionMode.None)
            {
                SetValueCore(SelectedItemProperty, cell?.BindingContext, SetValueFlags.ClearOneWayBindings | SetValueFlags.ClearDynamicResource | (changed ? SetValueFlags.RaiseOnEqual : 0));
            }

            if (isContextMenuRequested || cell == null)
            {
                return;
            }

            cell.OnTapped();

            var    itemSource  = ItemsSource?.Cast <object>().ToList();
            object tappedGroup = null;

            if (itemSource?.Count > groupIndex)
            {
                tappedGroup = itemSource.ElementAt(groupIndex);
            }

            ItemTapped?.Invoke(this,
                               new ItemTappedEventArgs(tappedGroup, cell.BindingContext,
                                                       TemplatedItems.GetGlobalIndexOfItem(cell?.BindingContext)));
        }
 private void _lstSuggestions_ItemTapped(object sender, ItemTappedEventArgs e)
 {
     ItemTapped?.Invoke(this, e);
 }
 internal void OnItemTapped(RadialMenuItem sender, TappedRoutedEventArgs e)
 {
     ItemTapped?.Invoke(sender, e);
 }
Exemple #17
0
 /// <summary>
        /// Adds tap gesture recognizer to an image - specific menu item.
        /// </summary>
        /// <param name="image">Image - menu item.</param>
        /// <param name="value">Menu item description.</param>
        private void ConnectItemWithClick(Image image, string value)
        {
            image.GestureRecognizers.Add(new TapGestureRecognizer()
            {
                Command = new Command(async () =>
                {
                    ItemTapped?.Invoke(this, new SelectedItemChangedEventArgs(value));

                    await CloseMenu();

                    if (value == "Settings")
                        App.router.ChangePageTo(new Views.SettingsPage());
                    else if (value == "Followings")
                        App.router.ChangePageTo(new Views.FollowingsPage());
                    else if (value == "Map")
                        App.router.ChangePageTo(new Views.MainMap());
                }),
                NumberOfTapsRequired = 1
            });
        }
 private void WpfMapDrawBase_ItemTapped(int i)
 {
     ItemTapped?.Invoke(i);
 }
Exemple #19
0
 protected void OnItemTapped(int i)
 {
     ItemTapped?.Invoke(i);
 }
Exemple #20
0
 public void ControlItemTapped(object data) => ItemTapped?.Invoke(data, EventArgs.Empty);
        private void OnTapped(object sender, TappedRoutedEventArgs args)
        {
            FrameworkElement fxElement = args.OriginalSource as FrameworkElement;

            ItemTapped?.Invoke(sender, fxElement);
        }
Exemple #22
0
        public void InvokeItemTapped(int position)
        {
            var arg = new ItemTappedEventArgs(ItemsSource[position], position);

            ItemTapped?.Invoke(this, arg);
        }