MainPage.xaml.cs 776 Bytes
Newer Older
Poli97's avatar
Poli97 committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
using System;
using System.ComponentModel;
using Xamarin.Forms;

namespace CustomViewAccessibility
{
    [DesignTimeVisible(false)]
    public partial class MainPage : ContentPage
    {
        
        public MainPage()
        {
            InitializeComponent();

            Button notAccessibleButton = new Button
            {
                Text = "USELESS BUTTON",
                BackgroundColor = Color.Gray,
            };
            stacklayout.Children.Add(notAccessibleButton);

            IAccessibleButton accessibleButton = new IAccessibleButton();
            accessibleButton.Text = "NOT IN FOCUS";
            AutomationProperties.SetIsInAccessibleTree(accessibleButton, true);
            stacklayout.Children.Add(accessibleButton);

        }

	}
}