/// <summary> /// Default Constructor /// </summary> public CheckBox() { InitVisualStates(); this.Orientation = StackOrientation.Horizontal; this.Padding = new Thickness(0, 10); this.Spacing = 10; this.frmBackground.Content = boxSelected; ApplyLabelPosition(LabelPosition); this.ApplyIsCheckedAction = ApplyIsChecked; this.ApplyIsPressedAction = ApplyIsPressed; this.GestureRecognizers.Add(new TapGestureRecognizer { Command = new Command(() => { if (IsDisabled) { return; } IsChecked = !IsChecked; ExecuteCommand(); CheckChanged?.Invoke(this, new EventArgs()); ValidationChanged?.Invoke(this, new EventArgs()); }), }); }
/// <summary> /// Default Constructor /// </summary> public CheckBox() { this.Orientation = StackOrientation.Horizontal; this.Padding = new Thickness(0, 10); this.Spacing = 10; boxBackground.Content = boxSelected; this.Children.Add(boxBackground); //this.Children.Add(new Grid { Children = { boxBackground, boxSelected }, MinimumWidthRequest = 35 }); this.Children.Add(lblOption); this.GestureRecognizers.Add(new TapGestureRecognizer { Command = new Command(() => { if (IsDisabled) { return; } IsChecked = !IsChecked; ExecuteCommand(); CheckChanged?.Invoke(this, new EventArgs()); ValidationChanged?.Invoke(this, new EventArgs()); }), }); }
protected virtual void OnValidationChanged() { ValidationChanged?.Invoke(this, EventArgs.Empty); }