This project is read-only.

Selecting sub elements

Jun 24, 2009 at 6:24 PM


I am working with WPF and was trying to set up some automated tests.

The perticualre situation that i have been comming accross is that

I have a listbox and it has items which have grids and buttons and so on inside them. I want to be able to get to these elements without having to make complicated bindings to them. If thats possible?


Jun 25, 2009 at 4:40 PM

you can use CustomUIItem if you donot want your own abstraction over this control.

Jun 29, 2009 at 6:45 AM


I have the same issue. Except... I am writing a keyword driven testing tool that is kinda like Selenium for .Net (WPF)

So.. I want to allow people to refere to controls within their List via a path.. so app/list1/listitem[1]/button1  say...

I can't make a customUI control for the list item in the app as I my app doesn't know the exact listitem.. just that it contains other items.

The approaches I am looking at are:

* change list item in White to be a UIItemContainer  (Due to the nature of WPF practically everything can be used as an item container)

* extend white using some customUI control... to replace the default ListItem control with one that exposes it's contents.

QUESTION : What do you recommend?





Jun 29, 2009 at 2:46 PM


I had the same problem as nigelthorne where I could not cast it to a UICustomItem. I tried making a UIItemContainer but that did not work eather and it gives the same problem that listItem can notbe cast to UIItemContainer.

I was not able to understand the second method that was mentioned by Nigel

Jun 29, 2009 at 3:58 PM

Have a look at WPFItems section here