DialogMessage in Windows 8

Nov 12, 2011 at 10:25 AM

Hi,

I'm trying MVVM Light Toolkit for Windows 8 Developer Preview and I noticed that DialogMessage is not implemented.
MessageBoxButton and MessageBoxResult are no more available in Windows 8; Windows.UI.Popups.MessageDialog have been introduced with the support for up to three UICommand.

Which is the best way to manage a dialog in MVVM pattern in Windows 8? If I directly use MessageDialog, the ViewModel knows something tha is about View.
I think DialogMessage is the best way to manage dialog (sending a message from the viewmodel and handling it in the view and manage callback to the viemodel).

Are you going to implement DialogMessage also for Windows 8 version?

Coordinator
Nov 20, 2011 at 7:21 PM
Edited Nov 20, 2011 at 7:22 PM

Hi,

Yes the main disadvantage of DialogMessage in the current implementation is that it uses view classes (the MessageBoxResult) in the VM. This is not very clean. 

This is the reason why i didn't port it to WIndows 8. The MessageBoxResult class is not available in WinRT, and I am planning to change the implementation in all versions to rely on booleans instead of MessageBoxResult.

In the meantime, did you consider using a DialogService like I show in my MIX11 video ?

 

Cheers,

Laurent