private void VtOptionSegmentedControl_SegmentTapped(object sender, Forms9Patch.SegmentedControlEventArgs e) { switch (e.Segment.Text) { case "START": vtOptionSegmentedControl.SelectIndex(0); _f9pButton.VerticalOptions = (vtOptionSegmentedControl.IsIndexSelected(4) ? LayoutOptions.StartAndExpand : LayoutOptions.Start); vtOptionSegmentedControl.DeselectIndex(1); vtOptionSegmentedControl.DeselectIndex(2); vtOptionSegmentedControl.DeselectIndex(3); break; case "CENTER": vtOptionSegmentedControl.SelectIndex(1); _f9pButton.VerticalOptions = (vtOptionSegmentedControl.IsIndexSelected(4) ? LayoutOptions.CenterAndExpand : LayoutOptions.Center); vtOptionSegmentedControl.DeselectIndex(0); vtOptionSegmentedControl.DeselectIndex(2); vtOptionSegmentedControl.DeselectIndex(3); break; case "END": vtOptionSegmentedControl.SelectIndex(2); _f9pButton.VerticalOptions = (vtOptionSegmentedControl.IsIndexSelected(4) ? LayoutOptions.EndAndExpand : LayoutOptions.End); vtOptionSegmentedControl.DeselectIndex(0); vtOptionSegmentedControl.DeselectIndex(1); vtOptionSegmentedControl.DeselectIndex(3); break; case "FILL": vtOptionSegmentedControl.SelectIndex(3); _f9pButton.VerticalOptions = (vtOptionSegmentedControl.IsIndexSelected(4) ? LayoutOptions.FillAndExpand : LayoutOptions.Fill); vtOptionSegmentedControl.DeselectIndex(0); vtOptionSegmentedControl.DeselectIndex(1); vtOptionSegmentedControl.DeselectIndex(2); break; case "EXPAND": _f9pButton.VerticalOptions = new LayoutOptions(_f9pButton.VerticalOptions.Alignment, e.Segment.IsSelected); break; } _xfButton.VerticalOptions = _f9pButton.VerticalOptions; }
private void HzOptionSegmentedControl_SegmentTapped(object sender, Forms9Patch.SegmentedControlEventArgs e) { switch (e.Segment.Text) { case "START": hzOptionSegmentedControl.SelectIndex(0); f9pImage.HorizontalOptions = (hzOptionSegmentedControl.IsIndexSelected(4) ? LayoutOptions.StartAndExpand : LayoutOptions.Start); hzOptionSegmentedControl.DeselectIndex(1); hzOptionSegmentedControl.DeselectIndex(2); hzOptionSegmentedControl.DeselectIndex(3); break; case "CENTER": hzOptionSegmentedControl.SelectIndex(1); f9pImage.HorizontalOptions = (hzOptionSegmentedControl.IsIndexSelected(4) ? LayoutOptions.CenterAndExpand : LayoutOptions.Center); hzOptionSegmentedControl.DeselectIndex(0); hzOptionSegmentedControl.DeselectIndex(2); hzOptionSegmentedControl.DeselectIndex(3); break; case "END": hzOptionSegmentedControl.SelectIndex(2); f9pImage.HorizontalOptions = (hzOptionSegmentedControl.IsIndexSelected(4) ? LayoutOptions.EndAndExpand : LayoutOptions.End); hzOptionSegmentedControl.DeselectIndex(0); hzOptionSegmentedControl.DeselectIndex(1); hzOptionSegmentedControl.DeselectIndex(3); break; case "FILL": hzOptionSegmentedControl.SelectIndex(3); f9pImage.HorizontalOptions = (hzOptionSegmentedControl.IsIndexSelected(4) ? LayoutOptions.FillAndExpand : LayoutOptions.Fill); hzOptionSegmentedControl.DeselectIndex(0); hzOptionSegmentedControl.DeselectIndex(1); hzOptionSegmentedControl.DeselectIndex(2); break; case "EXPAND": f9pImage.HorizontalOptions = new LayoutOptions(f9pImage.HorizontalOptions.Alignment, e.Segment.IsSelected); break; } xamarinImage.HorizontalOptions = f9pImage.HorizontalOptions; }