// redirect to AutomationPeer private object InContextGetPatternProvider(object arg) { AutomationPeer peer = Peer; if (peer == null) { throw new ElementNotAvailableException(); } return(peer.GetWrappedPattern((int)arg)); }