コード例 #1
0
 protected override void OnElementPropertyChanged(System.ComponentModel.PropertyChangedEventArgs args)
 {
     if (args.PropertyName == AccessibilityEffect.AccessibilityLabelProperty.PropertyName)
     {
         Control.AccessibilityLabel = AccessibilityEffect.GetAccessibilityLabel(Element);
     }
     else if (args.PropertyName == AccessibilityEffect.AccessibilityHintProperty.PropertyName)
     {
         Control.AccessibilityHint = AccessibilityEffect.GetAccessibilityHint(Element);
     }
     else if (args.PropertyName == AccessibilityEffect.AccessibilityIDProperty.PropertyName)
     {
         Control.AccessibilityIdentifier = AccessibilityEffect.GetAccessibilityID(Element);
     }
     else if (args.PropertyName == AccessibilityEffect.InAccessibleTreeProperty.PropertyName)
     {
         Control.IsAccessibilityElement = AccessibilityEffect.GetInAccessibleTree(Element);
     }
     else if (args.PropertyName == AccessibilityEffect.AccessibilityTraitsProperty.PropertyName)
     {
         SetTraits();
     }
     else
     {
         base.OnElementPropertyChanged(args);
     }
 }
コード例 #2
0
 protected override void OnAttached()
 {
     try
     {
         Control.AccessibilityLabel      = AccessibilityEffect.GetAccessibilityLabel(Element);
         Control.AccessibilityHint       = AccessibilityEffect.GetAccessibilityHint(Element);
         Control.AccessibilityIdentifier = AccessibilityEffect.GetAccessibilityID(Element);
         Control.IsAccessibilityElement  = AccessibilityEffect.GetInAccessibleTree(Element);
         SetTraits();
     }
     catch (Exception ex)
     {
         Console.WriteLine("Cannot set property on attached control. Error: ", ex.Message);
     }
 }
コード例 #3
0
 protected override void OnAttached()
 {
     try
     {
         Control.ContentDescription = AccessibilityEffect.GetAccessibilityLabel(Element);
         if (Control is TextView)
         {
             (Control as TextView).Hint = AccessibilityEffect.GetAccessibilityHint(Element);
         }
         Control.Focusable = AccessibilityEffect.GetInAccessibleTree(Element);
     }
     catch (Exception ex)
     {
         Console.WriteLine("Cannot set property on attached control. Error: ", ex.Message);
     }
 }
コード例 #4
0
 protected override void OnElementPropertyChanged(System.ComponentModel.PropertyChangedEventArgs args)
 {
     if (args.PropertyName == AccessibilityEffect.AccessibilityLabelProperty.PropertyName)
     {
         Control.ContentDescription = AccessibilityEffect.GetAccessibilityLabel(Element);
     }
     else if (args.PropertyName == AccessibilityEffect.AccessibilityHintProperty.PropertyName)
     {
         if (Control is TextView)
         {
             (Control as TextView).Hint = AccessibilityEffect.GetAccessibilityHint(Element);
         }
     }
     else if (args.PropertyName == AccessibilityEffect.InAccessibleTreeProperty.PropertyName)
     {
         Control.Focusable = AccessibilityEffect.GetInAccessibleTree(Element);
     }
 }