Open borjafdezgauna opened 3 years ago
Hey @borjafdezgauna, thanks for reporting the issue!
You're not doing anything wrong, Eto's ID and Tag properties are not tied to the backend platform in any way currently. However, it might not be a bad idea, though some investigation needs to be done to ensure it won't break anything.
As for a workaround, you could potentially add this style in your WPF startup before your app starts:
Eto.Style.Add<Eto.Forms.Control>(null, c => {
c.LoadComplete += (sender, e) =>
{
if (!string.IsNullOrEmpty(c.ID) && c.Handler is Eto.Wpf.Forms.IWpfFrameworkElement handler)
{
handler.ContainerControl.Name = c.ID;
}
};
});
Hope this helps!
Wow, that did the trick! I still need to fix a pair of things for my old WinForms project to work fully on Eto.Forms, but that was simply awesome! Thank you very much for the fast workaround 👍
I am trying to write coded tests for my Eto forms app.
I have set both the Id and Tag of the Eto controls I use (mostly TextBox) and, using WinAppDriver with the WPF version of the app, have writtten a simple UI test in Visual Studio.
I have only been able to find the window element using FindElementByName(), but neither this method nor any of its alternatives (ByTag(), ByAccessibilityId()) work with any of the controls.
I have inspected the UI controls using WinAppDriver UI Recorder v1.1 and it seems that the Name property of the controls is not set. Is there any workaround for this? Any way to set the value of the WPF controls' Name property from Eto?