I am building some tests for a desktop application using the win app driver. Everything is fine but can't use the page factory model I've used before in web applications. The problem is if an element hasn't finished loading then any kind of wait doesn't run before the element is accessed. As soon as I call the wait it fails
Waits.WaitForDisplayedEnabled(Scan.BarcodeField, Driver, 3);
... as soon as this is accessed (and before it can run) the code jumps to the element in the "page" I've setup and says it can't be found. I know the element can be found when debugging so the element locator is fine. Is there a better way to setup elements in pages without being able to use the Page Factory model? The Page factory would seem to not immediately try and access the element which is why it worked so well. The following is how I'm setting up the element...
public WindowsElement BarcodeField => Driver.FindElementByXPath("//*[@Name='Barcode' and @ClassName='TextBlock']");