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); } } }
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; } }
public void MainContentRegion_Navigated(object sender, RegionNavigationEventArgs e) { _lastUri = e.Uri; OnClickCommand.RaiseCanExecuteChanged(); }