MainPage.xaml.cs 880 Bytes
Newer Older
Poli97's avatar
Poli97 committed
1 2 3 4 5 6 7 8 9 10 11 12 13
using System;
using System.ComponentModel;
using Xamarin.Forms;

namespace CustomViewAccessibility
{
    [DesignTimeVisible(false)]
    public partial class MainPage : ContentPage
    {
        
        public MainPage()
        {
            InitializeComponent();
Paolo Pecis's avatar
Paolo Pecis committed
14
            Title = "XAMARINAccessibleView";
Poli97's avatar
Poli97 committed
15 16 17 18

            Button notAccessibleButton = new Button
            {
                Text = "USELESS BUTTON",
Paolo Pecis's avatar
Paolo Pecis committed
19
                BackgroundColor = Color.LightGray,
Poli97's avatar
Poli97 committed
20 21 22
            };
            stacklayout.Children.Add(notAccessibleButton);

Paolo Pecis's avatar
Paolo Pecis committed
23 24 25 26 27
            IAccessibleButton accessibleButton = new IAccessibleButton
            {
                Text = "NOT IN FOCUS",
                TextColor = Color.Black,
            };
Poli97's avatar
Poli97 committed
28 29 30 31 32 33 34
            AutomationProperties.SetIsInAccessibleTree(accessibleButton, true);
            stacklayout.Children.Add(accessibleButton);

        }

	}
}