public static IAutomationPeerFactory Create(XamlFramework xamlFramework)
        {
            switch (xamlFramework)
            {
            case XamlFramework.WPF: return(new WpfAutomationPeerFactory());

            case XamlFramework.UWP: return(new UwpAutomationPeerFactory());

            default: throw new InvalidOperationException($"There is no AutomationPeerFactory implemented for {xamlFramework}");
            }
        }
Esempio n. 2
0
 public BaseElementAutomationPeer(
     UIElement owner,
     string className,
     AutomationControlType automationControlType = AutomationControlType.Custom,
     int searchDepth             = DefaultSearchDepth,
     XamlFramework xamlFramework = XamlFramework.WPF) : base(owner)
 {
     this.ClassName             = className;
     this.AutomationControlType = automationControlType;
     this.SearchDepth           = searchDepth;
     this.AutomationPeerFactory = AutomationPeerAbstractFactory.Create(xamlFramework);
 }