AccessibilityHeadingAndroid.cs 707 Bytes
Newer Older
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
using System;
using Xamarin.Forms;
using Xamarin.Forms.Platform.Android;
using XAMARINHeadingNavigations.Droid;

[assembly: Dependency(typeof(AccessibilityHeadingAndroid))]
namespace XAMARINHeadingNavigations.Droid
{
    public class AccessibilityHeadingAndroid : IAccessibilityHeading
    {
        public void SetHeading(View v)
        {
            v.GetRenderer().View.AccessibilityHeading = true;
            
        }

        //check if the passed view (vc) is a header
        public void CheckHeading(View vc)
        {
            if(vc.GetRenderer().View.AccessibilityHeading == true)
            {
                Console.WriteLine("PIPPO, I am an header");
            }
        }
    }
}