Wednesday 15 August 2012

wpf - Showing Dialogs MVVM Pattern -


I have a property that shows a selected message from a combobox In my InitializeMessageFields method, I load the datagrid based on the selected item I am To say means I have separate items in my combo box. What do I want to do (in some dialog box) to load the selected item before loading the grid to inform the user what grid data belongs to the private string _Specified message type;

  public string type selected message {set {if (_selectedMessageType == value) returns; This._selectedMessageType = Value; InitializeMessageFields (); This.NotifyPropertyChanged ("IsMessageTypeSelected"); } {Get MessageBox.Show ("Loading", _selectedMessageType); Return it Type the selected message; }}   

How can I do this?

The direct box makes test difficult in VM directly. Instead of passing a service as a dependency through the responsible constructor to display the message, apply it through an interface so you can duplicate it for testing.

Alternatively use something like an event aggregator in the prism, it will be my favorite approach.

If you want to show laziness directly in VM, then add at least the Boolean property to suppress the test.

No comments:

Post a Comment