This project is read-only.

Testing modal OpenFileDialog in Silverlight app

Mar 15, 2010 at 6:33 AM

Hi All,

I'm trying to test an OpenFileDialog that is created when the user clicks on a button in my Silverlight 4.0 application.  According to the FAQ, the correct way of finding modal dialogs is this:

Window mainWindow = application.GetWindow("main");
List<Window> modalWindows = mainWindow.ModalWindows(); //list of all the modal windows belong to the window.
Window childWindow = mainWindow.ModalWindow("child"); //modal window with title "child"
childWindow.IsModal; //returns true

However, I'm testing a Silverlight application, using the White.WebBrowser.Silverlight.SilverlightDocument class, which doesn't appear to have a ModalWindows() collection on it.

Could someone please give me a hint as to what I'm doing wrong, & how I should be testing this?

Duncan Bayne

Mar 24, 2010 at 5:58 PM

have you tried finding the ModalWindow from InternetExplorerWindow object?

Apr 8, 2010 at 2:32 AM
Edited Apr 8, 2010 at 2:32 AM

You're right; if I call ModalWindows() on the InternetExplorerWindow object, the return value contains the Open File Dialog. Thanks :-)