private void SetNativeSelection(ToggleSelectorItem selection) { var nativeSegmentedControl = Control as UISegmentedControl; if (nativeSegmentedControl == null) { return; } System.Diagnostics.Debug.Assert(selection == ToggleSelectorItem.Left || selection == ToggleSelectorItem.Right); nativeSegmentedControl.SelectedSegment = (int)selection; }
private void SetNativeSelection(ToggleSelectorItem selection) { var nativeRadioGroup = (global::Android.Widget.RadioGroup)Control; if (nativeRadioGroup == null) { return; } System.Diagnostics.Debug.Assert(selection == ToggleSelectorItem.Left || selection == ToggleSelectorItem.Right); var radioButton = nativeRadioGroup.GetChildAt((int)selection) as global::Android.Widget.RadioButton; System.Diagnostics.Debug.Assert(radioButton != null); radioButton.Checked = true; }
private void SetNativeSelection(ToggleSelectorItem selection) { var nativeRadioGroup = Control as System.Windows.Controls.Grid; if (nativeRadioGroup == null) { return; } System.Diagnostics.Debug.Assert(selection == ToggleSelectorItem.Left || selection == ToggleSelectorItem.Right); System.Diagnostics.Debug.Assert(nativeRadioGroup.Children.Count > 1); var radioButton = nativeRadioGroup.Children[(int)selection] as System.Windows.Controls.RadioButton; System.Diagnostics.Debug.Assert(radioButton != null); radioButton.IsChecked = true; }