private void Dropdown_TouchUp(object sender, TouchEventArgs e) { if (!this.isOpened) { if (this.options != null && this.options.Count > 0) { this.Height = this.options.Count * this.originalHeight; this.Items.Clear(); for (var i = 0; i < this.options.Count; i++) { var text = new Text(this.Font, this.options[i].ToString()); text.SetMargin(this.Margin); this.Items.Add(text); } } } else { if (this.options != null && this.options.Count > 0) { this.Height = this.originalHeight; } } this.isOpened = !this.isOpened; if (this.Parent != null) { this.Invalidate(); } }
private void Dropdown_SelectionChanged(object sender, SelectionChangedEventArgs args) { this.Items.Clear(); var text = new Text(this.Font, this.options[this.SelectedIndex].ToString()); text.SetMargin(this.Margin); this.Items.Add(text); if (this.Parent != null) { this.Invalidate(); } }