void AddImageGestures(int index, TintedImage image) { if (this.IsReadonly) { return; } image.GestureRecognizers.Add(new TapGestureRecognizer { Command = new Command(() => this.Value = index + 1) }); }
private void InvalidateMaxValue() { if (this.Children.Count == this.MaxValue) { return; } for (int i = this.MaxValue; i < this.Children.Count; i++) { this.Children.RemoveAt(this.MaxValue); } for (int i = this.Children.Count; i < this.MaxValue; i++) { var image = new TintedImage { HeightRequest = this.HeightRequest }; this.AddImageGestures(i, image); this.Children.Add(image); } this.InvalidateValue(); }