/// <summary> /// Creates a new instance of <c>CustomSelectableCell</c> /// </summary> public CustomSelectableCell() { this._gridLayout = new Grid { RowDefinitions = { new RowDefinition { Height = new GridLength(1, GridUnitType.Star) } }, ColumnDefinitions = { new ColumnDefinition { Width = new GridLength(1, GridUnitType.Auto) }, new ColumnDefinition { Width = new GridLength(1, GridUnitType.Star) } } }; this._checkBox = new CheckBoxExtended { WidthRequest = 32, HeightRequest = 32, VerticalOptions = LayoutOptions.Center, HorizontalOptions = LayoutOptions.Center }; this._checkBox.CheckedChanged += (object sender, bool e) => { if (!checkStateChangedInternal && e != IsSelected) { this.IsSelected = e; } }; this._text = new Label { Style = Device.Styles.ListItemDetailTextStyle, VerticalOptions = LayoutOptions.Center }; this._gridLayout.Children.Add(this._checkBox, 0, 0); this._gridLayout.Children.Add(this._text, 1, 0); this.View = this._gridLayout; }
/// <summary> /// Creates a new instance of <c>CustomSelectableCell</c> /// </summary> public CustomSelectableCell() { this._gridLayout = new Grid { RowDefinitions = { new RowDefinition { Height = new GridLength(1, GridUnitType.Star) } }, ColumnDefinitions = { new ColumnDefinition { Width = new GridLength(1, GridUnitType.Auto) }, new ColumnDefinition { Width = new GridLength(1, GridUnitType.Star) } } }; this._checkBox = new CheckBoxExtended { WidthRequest = 32, HeightRequest = 32, VerticalOptions = LayoutOptions.Center, HorizontalOptions = LayoutOptions.Center }; this._checkBox.CheckedChanged += (object sender, bool e) => { if (!checkStateChangedInternal && e != IsSelected) this.IsSelected = e; }; this._text = new Label { Style = Device.Styles.ListItemDetailTextStyle, VerticalOptions = LayoutOptions.Center }; this._gridLayout.Children.Add(this._checkBox, 0, 0); this._gridLayout.Children.Add(this._text, 1, 0); this.View = this._gridLayout; }