using System; using System.Collections.Generic; using SampleApp.DependencyServices; using Xamarin.Forms; namespace SampleApp.Views { public partial class Functionality22 : ContentPage { IAccessibilityHeading Heading; IAccessibilityPane Pane; public Functionality22() { InitializeComponent(); Heading = DependencyService.Get(); Pane = DependencyService.Get(); if (Device.RuntimePlatform == Device.iOS) { labelAv.Text = "NOT AVAILABLE ON iOS"; } AutomationProperties.SetIsInAccessibleTree(label1,true); AutomationProperties.SetIsInAccessibleTree(label2,true); AutomationProperties.SetIsInAccessibleTree(button1,true); AutomationProperties.SetIsInAccessibleTree(button2, true); } //SHOW HEADER BUTTON CLICKED void Button_Clicked(System.Object sender, System.EventArgs e) { if (Device.RuntimePlatform == Device.Android) { if (Heading.CheckHeading(label1)) { string labelValue = label1.Text; label1.Text = "HEADER"; //reset label value after 3 seconds Device.StartTimer(TimeSpan.FromMilliseconds(3000.0), () => { label1.Text = labelValue; return false; // runs again, or false to stop }); } } } //SHOW PANE BUTTON CLICKED void Button_Clicked1(System.Object sender, System.EventArgs e) { if (Device.RuntimePlatform == Device.Android) { if (Pane.CheckPane(label2)) { string labelValue = label2.Text; label2.Text = "PANE"; //reset label value after 3 seconds Device.StartTimer(TimeSpan.FromMilliseconds(3000.0), () => { label2.Text = labelValue; return false; // runs again, or false to stop }); } } } protected override void OnAppearing() { base.OnAppearing(); //only Android has this function if (Device.RuntimePlatform == Device.Android) { Heading.SetHeading(label1); Pane.SetPane(label2, "PaneTitle"); } } } }