Example #1
0
        protected override void OnPropertyChanged(string propertyName = null)
        {
            base.OnPropertyChanged(propertyName);

            if (propertyName == BGColorProperty.PropertyName)
            {
                BackgroundColor = BGColor;
            }
            else if (propertyName == IconSrcProperty.PropertyName)
            {
                Icon.Source = IconSrc;
            }
            else if (propertyName == OnClickCommandProperty.PropertyName ||
                     propertyName == ExtraCommandProperty.PropertyName)
            {
                onTap.Command = new Command(() =>
                {
                    OnClickCommand.Execute(null);
                    if (ExtraCommand != null)
                    {
                        ExtraCommand.Execute(null);
                    }
                });
                if (!GestureRecognizers.Contains(onTap))
                {
                    GestureRecognizers.Add(onTap);
                }
            }
        }
Example #2
0
        private void AssociatedObject_MouseUp(object sender, MouseButtonEventArgs e)
        {
            down = false;
            var point = e.GetPosition(this.AssociatedObject);
            var l     = oPoint.DistanceDouble(point);

            if (l <= 4 && OnClickCommand != null)
            {
                OnClickCommand.Execute(null);
            }
            if (OverrideClickEvent)
            {
                e.Handled = true;
            }
        }
Example #3
0
 public void MainContentRegion_Navigated(object sender, RegionNavigationEventArgs e)
 {
     _lastUri = e.Uri;
     OnClickCommand.RaiseCanExecuteChanged();
 }