I have a custom Control HtButton
which inherits from Control
.
I made a custom FrameworkElementAutomationPeer
and override the
There are other solutions I guess, some of which are a bit involved in my opionion (i.e. creating a custom UIItem subclass and so on).
What I finally went for is this:
var myButtons = Window.GetMultiple(SearchCriteria.ByClassName("HtButton"));
foreach (var button in myButtons )
{
dynamic t = button;
t.Foo();
}
It does definitely work, it's short and just requires you to reference Microsoft.CSharp
.