Cannot Retrieve Custom Control Pattern After Registration
I'm using the automation API to create custom control patterns. Now that I've created my custom patterns, I don't know how to retrieve the existence of my new patterns. I've tried to use AutomationPattern.LookupById() in the following code:
PatternWrapper pattern = new PatternWrapper();
int res = pattern.RegisterRotatePattern();
AutomationPattern rotatePattern = AutomationPattern.LookupById(res);
Assert.IsTrue(new List<String (Enum.GetNames(typeof(PatternInterface))).Contains("CustomRotatePattern"));
Is there another way to retrieve the pa开发者_运维百科ttern or perhaps I need to derive a custom AutomationPeer??
I do get a pattern id after registering the pattern but still have no idea how to retrieve the pattern. Any ideas would be very helpful!! Thanks in advance.
Ok, so I did some research (a lot of research) and noticed that I did not implement the server-side provider for my unmanaged code. By implementing the server-side provider, I should be able to retrieve a pointer to my custom control.
Hopefully that does it, I'm in middle of implementing it at the moment. Thanks for your help BrendanMcK, get me thinking with that last comment of yours there!
精彩评论