int selectedValue = 0; protected override void OnChildAdded(Element child) { if (!string.IsNullOrEmpty(SelectedCount)) { if (selectedValue < int.Parse(SelectedCount)) { var button = child as SfButton; button.IsChecked = true; selectedValue++; SelectedItems.Add(button); } } base.OnChildAdded(child); } |
private void FontButton_Clicked(object sender, System.EventArgs e) { var sfButton = sender as SfButton; if (secondLevelStack.SelectedItems.Count != 0) { sfButton.IsChecked = false; firstLevelStack.IsEnabled = false; } else { firstLevelStack.IsEnabled = true; if (sfButton.IsChecked && !firstLevelStack.SelectedItems.Contains(sfButton)) { firstLevelStack.SelectedItems.Add(sfButton); } if (!sfButton.IsChecked && firstLevelStack.SelectedItems.Contains(sfButton)) { firstLevelStack.SelectedItems.Remove(sfButton); } if(firstLevelStack.SelectedItems.Count == 0) { secondLevelStack.IsEnabled = true; } } } |
var sfButton = sender as SfButton; if (isIntialLoaded) { var labelCount = int.Parse(txtSelectedREMK.Value.ToString()); var index = firstLevelStack.Children.IndexOf(sfButton); var total = labelCount + index; for (int i = index; i < firstLevelStack.Children.Count && i<total;i++) { var initiallyAddedButton = firstLevelStack.Children[i] as SfButton; initiallyAddedButton.IsChecked = true; firstLevelStack.SelectedItems.Add(initiallyAddedButton); } isIntialLoaded = false; } |
protected override void OnAppearing() { base.OnAppearing(); isIntialLoaded = true; // Value from DB Device.BeginInvokeOnMainThread(async () => { await Task.Delay(200); transparentButton.IsCheckable = true; }); } |