Controller.Message not working

May 8, 2013 at 11:13 PM
Edited May 9, 2013 at 1:09 AM
IN the app.xaml.cs.ApplicationStartup method, I have some code that does some tests. One of them is for a local directory.

If it's missing, I pop up a messagebox to explain what I need, then a getFolderDialog to have them point me to the right location. (NOTE: I still haven't found out where that dialog is in the FW, but need this issue to be resolved first.)

But the Controller.Message did not work. On further testing, I found that I must put my code AFTER the Controller.Action("Home", "Start"); line to make it work.

Since I now have that working, I still need to figure out the CODE FW verson of the getFolderDialog, but am hoping to find that soon.

I found the calls to the System.Environment - but not sure if I should use that or if there is a call in the FW to use.
May 16, 2013 at 10:26 PM
Controller.Message() creates messageboxes as standard views. As such, it requires a Shell to be open to work. What I would do if you absolutely need to do something before you have the root UI (the shell) running is just use the standard message box features. So just MessageBox.Show(). (You could also register another view handler and handle the message yourself, but that would be a hassle and probably not worth it).

From my point of view, the preferable way would be to get the Shell up and running before you do anything else. This way, the infrastructure has launched, and now you have all the standard features available.

On the file dialog: The framework doesn't define folder dialogs as they are already available in the .NET framework.