Problem with whatControl = window.Get<?>()

Mar 14, 2008 at 3:43 PM

I have a WPF window like this …

<Grid x:Name="LayoutRoot">
<Border x:Name="ActiveViewPlaceholder"/>

A control will be loaded dynamically inside that ActiveViewPlaceholder. I can’t figure out how to verify that a control was loaded into that Border element. Ideally I would like to get the Border and later verify that has something in it. In the worst case I could settle for verifying that a specific control like DefaultView was loaded. However I can’t figure out what control to get with window.Get<>();

Thank you
Mar 22, 2008 at 5:51 PM
Sorry, somehow I completely missed this post.
Is it possible for you to send me some sample code?
Mar 22, 2008 at 11:03 PM
Edited Mar 22, 2008 at 11:04 PM
Don't worry its cool to get any help at any time ...

Here is the scenario I'm testing:

Given the Window

<Window Title="TestWindow">
<Grid x:Name="LayoutRoot">
<Border x:Name="ActiveViewPlaceholder"/>

At some point a control will be loaded inside the ActiveViewPlaceholder so I would like to test that ...

public void TestWindow-has-an-ActiveView(){

var app = Application.Launch(appName);
var window = app.GetWindow("TestWindow", ...);

// don't know what type to Get<?>
var ActiveViewPlaceholder = window.Get<?>("ActiveViewPlaceholder");

// ActiveViewPlaceholder is a Border so ideally


Thank you
Mar 31, 2008 at 6:17 AM
As of now you would have to know what is coming at the placeholder child and specify that type.
Also border is not supported yet in white. I would create an issue for it.