private void GridGoToHome_Tap(object sender, TapEventArgs args)
        {
            args.Handled = true;

            this.touchGallery.GoToHome();
            this.RaiseGestureChanged("Tap");
        }
        private void Bindable_Tapped(object sender, TapEventArgs e)
        {
            var treeViewNode = ((sender as MR.Gestures.Grid).BindingContext) as TreeViewNode;
            var treeView     = (sender as MR.Gestures.Grid).Parent as SfTreeView;

            treeView.ExpandNode(treeViewNode);
        }
Exemple #3
0
 private static void TriggerTapEvent(TapEventArgs eArgs)
 {
     if (TapEvent != null)
     {
         TapEvent(null, eArgs);
     }
 }
Exemple #4
0
    private void FireTapEvent()
    {
        Debug.Log("Tap!, " + gesture_time);
        if (OnTap != null)
        {
            Ray        r      = Camera.main.ScreenPointToRay(start_pos);
            RaycastHit hit    = new RaycastHit();
            GameObject hitObj = null;

            if (Physics.Raycast(r, out hit, Mathf.Infinity))
            {
                hitObj = hit.collider.gameObject;
            }

            TapEventArgs args = new TapEventArgs(start_pos, hitObj);
            OnTap(this, args);

            if (hitObj != null)
            {
                ITapped tapped = hitObj.GetComponent <ITapped>();
                if (tapped != null)
                {
                    tapped.OnTap();
                }
            }
        }
    }
Exemple #5
0
 private void TransactionDate_OnTapped(object sender, TapEventArgs e)
 {
     transactionDatePicker.Focus();
     transactionDatePicker.DateSelected += TransactionDatePicker_DateSelected;
     transactionDatePicker.Unfocused    -= TransactionDatePicker_Unfocused;
     transactionDatePicker.Unfocused    += TransactionDatePicker_Unfocused;
 }
Exemple #6
0
 private void Vendor_OnTapped(object sender, TapEventArgs e)
 {
     vendorPicker.Focus();
     vendorPicker.SelectedIndexChanged += VendorPicker_SelectedIndexChanged;
     vendorPicker.Unfocused            -= VendorPicker_Unfocused;
     vendorPicker.Unfocused            += VendorPicker_Unfocused;
 }
Exemple #7
0
 private void TransactionType_OnTapped(object sender, TapEventArgs e)
 {
     transactionTypePicker.Focus();
     transactionTypePicker.SelectedIndexChanged += TransactionTypePicker_SelectedIndexChanged;
     transactionTypePicker.Unfocused            -= TransactionTypePicker_Unfocused;
     transactionTypePicker.Unfocused            += TransactionTypePicker_Unfocused;
 }
Exemple #8
0
 private void Category_OnTapped(object sender, TapEventArgs e)
 {
     categoryPicker.Focus();
     categoryPicker.SelectedIndexChanged += CategoryPicker_SelectedIndexChanged;
     categoryPicker.Unfocused            -= CategoryPicker_Unfocused;
     categoryPicker.Unfocused            += CategoryPicker_Unfocused;
 }
Exemple #9
0
 /// <summary>
 /// constructor
 /// </summary>
 /// <param name="source"></param>
 /// <param name="newListener"></param>
 public TapEventArgs(TapEventArgs source = null, Listener newListener = null) : base(source, newListener)
 {
     if (source != null)
     {
         NumberOfTaps = source.NumberOfTaps;
     }
 }
        private void RecordMap_Tap(object sender, TapEventArgs e)
        {
            switch (map.MapPositionOption)
            {
            case PositionOption.Pin:
                _latitude            = e.Position.Latitude;
                _longitude           = e.Position.Longitude;
                SaveButton.IsEnabled = true;
                UpdatePin();
                break;

            case PositionOption.Line:
                map.RouteCoordinates.Add(new Xamarin.Forms.Maps.Position(e.Position.Latitude, e.Position.Longitude));
                SaveButton.IsEnabled = map.RouteCoordinates.Count() > 1;
                break;

            case PositionOption.Area:
                map.ShapeCoordinates.Add(new Xamarin.Forms.Maps.Position(e.Position.Latitude, e.Position.Longitude));
                SaveButton.IsEnabled = map.ShapeCoordinates.Count() > 2;
                break;

            default:
                break;
            }
        }
Exemple #11
0
 protected virtual void OnTapped(TapEventArgs e)
 {
     Console.WriteLine("TAPPING COUPON");
     Console.WriteLine(e.Sender);
     Console.WriteLine(id);
     Console.WriteLine(ImageUrl);
     //AddText(TapInfo("Tapped", e));
 }
 protected virtual void RaiseTapEvent(TapEventArgs e)
 {
     e.Canvas = Tie;
     if (null != OnTap)
     {
         OnTap(this, e);
     }
 }
Exemple #13
0
        protected virtual void OnTap(TapEventArgs e)         //handler for ontap
        {
            var handler = Tap;

            if (handler != null)
            {
                handler(this, e);
            }
        }
        private string TapInfo(string eventName, TapEventArgs e)
        {
            StringBuilder sb = new StringBuilder(eventName);

            sb.Append($" {GetElementName(e)} {e.NumberOfTaps} times with {e.NumberOfTouches} fingers.");
            sb.Append($" ViewPosition: {e.ViewPosition.X:F}/{e.ViewPosition.Y:F}/{e.ViewPosition.Width:F}/{e.ViewPosition.Height:F}");
            AddTouches(sb, e);

            return(sb.ToString());
        }
        private void MainPage_Tap(object sender, TapEventArgs e)
        {
            var context = (NewPlacePageViewModel)this.BindingContext;

            context.DrawLocation(new LocationItemViewModel()
            {
                Title     = "Desconocido",
                Latitude  = e.Position.Latitude,
                Longitude = e.Position.Longitude
            });
        }
        void _map_Tap(object sender, TapEventArgs e)
        {
            if (_map.Pins.Count == 0)
            {
                BuildPin(e.Position);
                _map.Pins.Add(MyPositionPin);
                return;
            }

            MovePin(e.Position);
        }
        private void Mapa_OnTap(object sender, TapEventArgs e)
        {
            var pin = new Pin
            {
                Type     = PinType.Place,
                Position = e.Position,
                Label    = "Receptor",
                Address  = e.Position.Latitude + " X " + e.Position.Latitude,
            };

            Mapas.Pins.Add(pin);
        }
        private void TapBehavior_Tap(object sender, TapEventArgs e)
        {
            if (e.Device is StylusDevice)
            {
                ListBoxItem item = (ListBoxItem)HelperClass.FindVisualAncestor((DependencyObject)sender, (o) => o.GetType() == typeof(ListBoxItem));

                if (item != null)
                {
                    item.IsSelected = !item.IsSelected;
                }
            }
        }
 private void TapBehavior_Tap(object sender, TapEventArgs e)
 {
     if (e.Device is StylusDevice)
     {
         double position = ((StylusDevice)e.Device).GetPosition(flipper).X;
         flipper.Rotate(position < flipper.ActualWidth / 2.0);
     }
     else
     {
         double position = ((MouseDevice)e.Device).GetPosition(flipper).X;
         flipper.Rotate(position < flipper.ActualWidth / 2.0);
     }
 }
Exemple #20
0
        private string TapInfo(string start, TapEventArgs e)
        {
            StringBuilder sb = new StringBuilder(start);

            sb.AppendFormat(" {0} {1} times with {2} fingers.", GetElementName(e), e.NumberOfTaps, e.NumberOfTouches);
            sb.AppendFormat(" ViewPosition: {0}/{1}/{2}/{3}, Touches: ", e.ViewPosition.X, e.ViewPosition.Y, e.ViewPosition.Width, e.ViewPosition.Height);
            if (e.Touches != null && e.Touches.Length > 0)
            {
                sb.Append(String.Join(", ", e.Touches.Select(t => t.X + "/" + t.Y)));
            }

            return(sb.ToString());
        }
Exemple #21
0
 private void Spawn(object sender, TapEventArgs e)
 {
     if (e.TappedObject == null)
     {
         Ray        ray     = Camera.main.ScreenPointToRay(e.TapPosition);
         GameObject toSpawn = toSpawnPrefabs[index];
         index = (index + 1) % toSpawnPrefabs.Length;
         Instantiate(toSpawn, ray.GetPoint(5f), Quaternion.identity);
     }
     else
     {
         Debug.Log($"Hit {e.TappedObject.name}!");
     }
 }
Exemple #22
0
    private void FireTapEvent()
    {
        GameObject   hitObj = GetHitGameObject(startPos);
        TapEventArgs args   = new TapEventArgs(startPos, hitObj);

        OnTap?.Invoke(this, args);

        if (hitObj != null)
        {
            if (hitObj.TryGetComponent(out ITappable tappedObj))
            {
                tappedObj.OnTap();
            }
        }
    }
Exemple #23
0
        void HandleShowOptionsButtonTGTapDetected(object sender, TapEventArgs e)
        {
            OptionsBox.Visible   = true;
            OptionsCheck.Visible = true;
            if (TutorialMode)
            {
                OptionsCheck.Enabled = true;
                OptionsCheck.Checked = true;
            }
            OptionsCloseButton.Visible     = true;
            OptionsTutorialOnorOff.Visible = true;
            QUITDEMO.Visible = true;

            ShowOptions.Visible = false;
        }
    private void OnTap(object sender, TapEventArgs e)
    {
        if (e.TappedObject == null)
        {
            Debug.Log("you tapped on nothing!");
            Vector2 pos = e.TapPosition;
            Ray     r   = Camera.main.ScreenPointToRay(pos);

            Spawn(r.GetPoint(10));
        }
        else
        {
            Debug.Log($"Hit {e.TappedObject.name}");
        }
    }
Exemple #25
0
    private void onTapped(object sender, TapEventArgs e)
    {
        if ((focusedVisualizedTextTmp != "" && focusedVisualizedTextTmp != null) &&
            (visualizedTextFocused))
        {
            //Test
            selectedWordsList.Add(focusedVisualizedTextTmp);
            visualTextManager.visualizeSelectedWords(selectedWordsList);
        }


        //        selectedWordsList.Insert(selectedWordsList.Count, e.Word);
        //#if (!UNITY_EDITOR)
        //        ApiYummlyRecipes.Instance.HttpGetRecipesByIngredients(new string[] { e.Word });
        //#endif
    }
Exemple #26
0
        //private string getSpecificGoogleInfo(string placeId)
        //{
        //    string fixedUrl = detailSearch + placeId + "&key=" + googleKey;


        //    return fixedUrl;
        //}

        private void Image_Tapped(object sender, TapEventArgs e)
        {
            var cpn = (MR.Gestures.Image)sender;
            var abs = cpn.Parent.Id;
            // Debug.WriteLine("WERE TAPPING OTHER ====" + abs);
            var _coupon = couponList.couponList.FirstOrDefault(c => c.thisCoupon.ImageStream == cpn.Source);

            if (_coupon != null)
            {
                Debug.WriteLine("WERE TAPPING ICON ===" + _coupon.Loc);
                // Debug.WriteLine("WERE TAPPING ICON ===" + _coupon.Longitude);
                //  var findplace = new FindPlacePage(_coupon.Latitude, _coupon.Longitude);
                // await Navigation.PushAsync(findplace);
            }

            //Debug.WriteLine("WERE TAPPING ICON");
        }
Exemple #27
0
    private void FireTapEvent()
    {
        GameObject hitObj = GetHitInfo(startPoint);

        var args = new TapEventArgs(startPoint, hitObj);

        OnTap?.Invoke(this, args);

        if (hitObj is null)
        {
            return;
        }

        var tap = hitObj.GetComponent <ITapped>();

        tap.OnTap(args);
    }
Exemple #28
0
    void SingleTap()
    {
        Debug.LogError("SingleTap was recognized.");
        // source.PlayOneShot(singleTapSound);
        // select words
#if (!UNITY_EDITOR)
        // send event to Controller
        TapEventArgs args = new TapEventArgs();

        args.Word = "garlic";
        var handler = Tapped;
        if (handler != null)
        {
            handler.Invoke(this, args);
        }
#endif
    }
Exemple #29
0
        private async void couponTapped(object sender, TapEventArgs e)
        {
            var cpn     = (MR.Gestures.Image)sender;
            var _coupon = couponList.couponList.FirstOrDefault(c => c.thisCoupon.ImageStream == cpn.Source);

            //string fixedurl = getSpecificGoogleInfo(_coupon.PlaceId);
            //using (var client = new HttpClient())
            //{
            //    var response = await client.GetStringAsync(string.Format(fixedurl));
            //    var result = JsonConvert.DeserializeObject<GooglePlaces>(response);
            //    if (result.result != null)
            //    {
            //        var use = result.result;
            _coupon = await _google.GooglePlaceDetails(_coupon);;
            Console.WriteLine("use=>" + _coupon.thisCoupon.GoogleData.name);
            // }
            // }
        }
Exemple #30
0
        void btnBuildingsTabTGEventHandler(object sender, TapEventArgs e)
        {
            if (curSelectedTab == (int)selectedTab.BUILDINGS)
            {
                //deselects building tab
                BuildingsTabFocus.Visible = false;
                BuildingsTabTop.Visible   = false;

                if (!TutorialMode)
                {
                    DialogueBox.Visible = false;
                }
                DialogueBoxVisible         = false;
                BlackSmith.Visible         = false;
                CharacterOutline_1.Visible = false;
                CharacterOutline_2.Visible = false;


                curSelectedTab = (int)selectedTab.NONE;
            }
            else
            {
                //deselects everything else
                OfficersTabTop.Visible   = false;
                OfficersTabFocus.Visible = false;
                RecruitTabTop.Visible    = false;
                RecruitTabFocus.Visible  = false;
                AidenPortrait.Visible    = false;
                KiraPortrait.Visible     = false;



                //selects building tab
                BuildingsTabFocus.Visible = true;
                BuildingsTabTop.Visible   = true;
                //DialogueBox.Visible = true;
                BlackSmith.Visible = true;

                curSelectedTab = (int)selectedTab.BUILDINGS;

                DialogueBoxVisible = true;
            }
        }
Exemple #31
0
        protected virtual void OnTapped(TapEventArgs e)
        {
            Console.WriteLine("TAPPING LOCATION");
            Console.WriteLine(e.Sender);
            Console.WriteLine(Loc.lat);
            Console.WriteLine(Loc.lng);
            // Console.WriteLine(Coordinates.lat);
            // Console.WriteLine(Coordinates.lng);
            Console.WriteLine(_placeId);
            if (OnFindCoupon == null)
            {
                return;
            }

            FindEventArgs args = new FindEventArgs(this);

            OnFindCoupon(this, args);
            ///OnFindCoupon(new FindEventArgs(_location));
            //AddText(TapInfo("Tapped", e));
        }
		protected virtual void OnTapping(TapEventArgs e)
		{
			AddText(TapInfo("Tapping", e));
		}
 private void TapBehavior_Tap(object sender, TapEventArgs e)
 {
     if (e.Device is StylusDevice)
     {
         double position = ((StylusDevice)e.Device).GetPosition(flipper).X;
         flipper.Rotate(position < flipper.ActualWidth / 2.0);
     }
     else
     {
         double position = ((MouseDevice)e.Device).GetPosition(flipper).X;
         flipper.Rotate(position < flipper.ActualWidth / 2.0);
     }
 }
		private string TapInfo(string start, TapEventArgs e)
		{
			StringBuilder sb = new StringBuilder(start);

			sb.AppendFormat(" {0} {1} times with {2} fingers.", GetElementName(e), e.NumberOfTaps, e.NumberOfTouches);
			sb.AppendFormat(" ViewPosition: {0}/{1}/{2}/{3}, Touches: ", e.ViewPosition.X, e.ViewPosition.Y, e.ViewPosition.Width, e.ViewPosition.Height);
			if (e.Touches != null && e.Touches.Length > 0)
				sb.Append(String.Join(", ", e.Touches.Select(t => t.X + "/" + t.Y)));

			return sb.ToString();
		}
        private void CanvasGallery_Tap(object sender, TapEventArgs args)
        {
            var image = args.OriginalSource as Image;
            if (image == null)
            {
                return;
            }

            this.DoTransitionToDetails(image);
            this.RaiseGestureChanged("Tap");
        }
 protected virtual void OnTapped(TapEventArgs e)
 {
    // AddText(TapInfo("Tapped", e));
 }
 void _tapbehavior_DoubleTap(object sender, TapEventArgs e)
 {
     SetValue(IsSelectedProperty, true);
 }
 private void OnTapping(object sender, TapEventArgs tapEventArgs)
 {
     var listView = (MultiLevelListView)Parent;
     listView.OnItemTapped(Item);
 }
 private void Tap_Tap(object sender, TapEventArgs e)
 {
     var postit = sender as Postit;
     postit.Background = new SolidColorBrush(RandomHelper.GetRandomColor());
 }
		protected virtual void OnDoubleTapped(TapEventArgs e)
		{
			AddText(TapInfo("DoubleTapped", e));
		}
		void Red_DoubleTapped(object sender, TapEventArgs e)
		{
			AddText("BoxViewXaml.Red_DoubleTapped method called with " + e.NumberOfTouches + " fingers");
		}
 private void CanvasDetails_Tap(object sender, TapEventArgs args)
 {
     this.ImageSource = null;
     this.RaiseGestureChanged("Tap");
 }
        private void TapBehavior_Tap(object sender, TapEventArgs e)
        {
            if (e.Device is StylusDevice)
            {
                ListBoxItem item = (ListBoxItem)HelperClass.FindVisualAncestor((DependencyObject)sender, (o) => o.GetType() == typeof(ListBoxItem));

                if (item != null)
                    item.IsSelected = !item.IsSelected;
            }
        }
 private static void TriggerTapEvent(TapEventArgs eArgs)
 {
     if (TapEvent != null)
     {
         TapEvent(null, eArgs);
     }
 }