how to execute events in mvvm pattern for silverlight
Can anyone provide a short example of how to execute an event within th开发者_开发技巧e mvvm pattern for silverlight? In reading I have seen references to where silverlight does not support commanding? If that is the case how then what is the most common practice to initate methods in the mvvm pattern? Is a third party framework need or can this be accomplished using routed events? A simple example would be great... say a button wihtin the xaml and then within a viewmodel class the method to open an alert window of change the text of a textblock? I'd appreciate any insight as to what the most common approach is for initiating an event( mouse click events etc) and how these methods could be called.
thanks in advance
Though there isn't an implementation on Silverlight, the ICommand interface is present in the framework. You should take a look at the DelegateCommand class in Prism.
精彩评论