using System; using System.Collections.Generic; using Xamarin.Forms; namespace SampleApp.Views { public partial class Functionality2 : ContentPage { Boolean topDown = true; public Functionality2() { InitializeComponent(); FocusOrderLabel.Text = "Focus order is: TOP-DOWN"; AutomationProperties.SetIsInAccessibleTree(FocusOrderLabel, true); AutomationProperties.SetIsInAccessibleTree(label1, true); AutomationProperties.SetIsInAccessibleTree(label2, true); AutomationProperties.SetIsInAccessibleTree(label3, true); AutomationProperties.SetIsInAccessibleTree(label4, true); AutomationProperties.SetIsInAccessibleTree(ChangeButton, true); label1.TabIndex = 1; label2.TabIndex = 2; label3.TabIndex = 3; label4.TabIndex = 4; ChangeButton.TabIndex = 5; } async void OnButtonClicked(object sender, EventArgs args) { if (topDown) { label2.Text = "3"; label2.TabIndex = 3; label3.Text = "2"; label3.TabIndex = 2; ChangeButton.Text = "Change focus order to top-down"; FocusOrderLabel.Text = "Focus order is: LEFT-RIGHT"; } else { label2.Text = "2"; label2.TabIndex = 2; label3.Text = "3"; label3.TabIndex = 3; ChangeButton.Text = "Change focus order to left-right"; FocusOrderLabel.Text = "Focus order is: TOP-DOWN"; } topDown = !topDown; } } }