<?xml version="1.0"?><?xml-stylesheet type="text/xsl" href="/rss.xsl"?><rss version="2.0"><channel><title>mvvmfoundation Discussions Rss Feed</title><link>http://mvvmfoundation.codeplex.com/Thread/List.aspx</link><description>mvvmfoundation Discussions Rss Description</description><item><title>New Post: Any examples to display Dialogs with MVVM Foundation?</title><link>http://mvvmfoundation.codeplex.com/discussions/230548</link><description>&lt;div style="line-height: normal;"&gt;Here is an example that I have used. In this example I am using MVVM Foundation Messenger to show a different view. &lt;br /&gt;
&lt;br /&gt;
You will have to do the following in a ViewModel where you want to send the message from. In my example, I am sending a message and passing a parameter (name of another View - it can be any object) &lt;br /&gt;
&lt;pre&gt;&lt;code&gt; Mediator.NotifyColleagues&amp;lt;string&amp;gt;(MediatorMessages.ShowInterface, &amp;quot;BidQueryResultInterface&amp;quot;);&lt;/code&gt;&lt;/pre&gt;

Mediator.NotifyColleagues is a Messenger method that notifies all registered ViewModels (this will be covered shortly). MediatorMessages.ShowInterface is just a class and a string constant that I use for passing the messages around. Much easier then typing the name every time. The example of this class is below: &lt;br /&gt;
&lt;pre&gt;&lt;code&gt;public static class MediatorMessages
{
    public const string ShowInterface = &amp;quot;ShowInterface&amp;quot;;
}&lt;/code&gt;&lt;/pre&gt;

Now on to the receiving end. In another ViewModel we have to register the method that will be receiving these messages. Note that in the constructor of your ViewModel you need to register the Messenger:&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;this.Mediator.Register(this);&lt;/code&gt;&lt;/pre&gt;

You decorate the method that will receive the messages as shown below. The definition of this would match the Message you are sending. I am showing the one that matches the example I used:&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;[MediatorMessageSink(MediatorMessages.ShowInterface, ParameterType = typeof(string))]
private void ShowInterface(string interfaceType)
{
    //The code to handle the Message goes here
}&lt;/code&gt;&lt;/pre&gt;

For my purposes to show the Dialog I stored the interfaceType into a Parameter (InterfaceName) to which my ShellView is binded to. In the ShellView I use DataTemplates to decide which DialogView to show (based on the InterfaceName). For each Dialog that the application would show I have the appropriate View and ViewModel. The responses from the Dialog are routed back to the ViewModel that sent the message. Unfortunately I do not currently have an example for this last part, but if you are having issues figuring things out, I could whip one up. &lt;br /&gt;
&lt;br /&gt;
Hope this helped! Feel free to reply back if you have any questions, I'll try and help if I can. &lt;br /&gt;
&lt;/div&gt;</description><author>Ezakiel</author><pubDate>Fri, 10 May 2013 18:34:35 GMT</pubDate><guid isPermaLink="false">New Post: Any examples to display Dialogs with MVVM Foundation? 20130510063435P</guid></item><item><title>New Post: Pass a parameter with the Messenger class</title><link>http://mvvmfoundation.codeplex.com/discussions/439205</link><description>&lt;div style="line-height: normal;"&gt;Found it:&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;ViewModelCommunication.Messaging.Register(ViewModelCommunication.LogInChanged, (Action&amp;lt;String&amp;gt;)(param =&amp;gt; { this.Test = (string)param; }));&lt;/code&gt;&lt;/pre&gt;

This fills my property Test with the value &amp;quot;TEST&amp;quot;.&lt;br /&gt;
&lt;/div&gt;</description><author>PitAttack76</author><pubDate>Fri, 05 Apr 2013 09:17:27 GMT</pubDate><guid isPermaLink="false">New Post: Pass a parameter with the Messenger class 20130405091727A</guid></item><item><title>New Post: Pass a parameter with the Messenger class</title><link>http://mvvmfoundation.codeplex.com/discussions/439205</link><description>&lt;div style="line-height: normal;"&gt;Hi,&lt;br /&gt;
&lt;br /&gt;
I use the MVVM Foundation Messenger class to communicate between my ViewModels. This works fine. &lt;br /&gt;
How ever I would like to pass a parameter to it as well but I can't find how to retrieve it.&lt;br /&gt;
&lt;pre&gt;&lt;code&gt; ViewModelCommunication.Messaging.NotifyColleagues(ViewModelCommunication.LogInChanged, &amp;quot;TEST&amp;quot;);&lt;/code&gt;&lt;/pre&gt;

The parameter is here the string &amp;quot;TEST&amp;quot;. How do I retrieve it in the registered ViewModel?&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;ViewModelCommunication.Messaging.Register(ViewModelCommunication.LogInChanged, param =&amp;gt; { this.aProperty = (string)param; });&lt;/code&gt;&lt;/pre&gt;

This doesn't work. I guess it is simple but I can't find it. Does someone have an example?&lt;br /&gt;
&lt;/div&gt;</description><author>PitAttack76</author><pubDate>Fri, 05 Apr 2013 09:04:58 GMT</pubDate><guid isPermaLink="false">New Post: Pass a parameter with the Messenger class 20130405090458A</guid></item><item><title>New Post: Any examples to display Dialogs with MVVM Foundation?</title><link>http://mvvmfoundation.codeplex.com/discussions/230548</link><description>&lt;div style="line-height: normal;"&gt;How did you solve this situation? It´s a typical scenario, but I still didn't figure it out. Thanks in advance.&lt;br /&gt;
&lt;/div&gt;</description><author>GRF75</author><pubDate>Thu, 28 Feb 2013 17:52:15 GMT</pubDate><guid isPermaLink="false">New Post: Any examples to display Dialogs with MVVM Foundation? 20130228055215P</guid></item><item><title>New Post: ObservableObject and EditableObject</title><link>http://mvvmfoundation.codeplex.com/discussions/404938</link><description>&lt;div style="line-height: normal;"&gt;
&lt;p&gt;Firt of all, I wish to thank you for the MVVM Foundation. It is extremely helpful!&lt;/p&gt;
&lt;p&gt;I am fairly new to MVVM. I&amp;nbsp;finally&amp;nbsp;&amp;quot;figured&amp;quot; it out a few months ago, and I started with C# about a year and a half ago (all self&amp;nbsp;thought), so&amp;nbsp;please&amp;nbsp;excuse any newbie&amp;nbsp;mistakes in my coding (I do appreciate feedback on things
 I am doing wrong).&amp;nbsp;&lt;/p&gt;
&lt;p&gt;In my recent project I needed an EditableObject which would also raise PropertyChanged when changes were discarded. For classes with only a few properties&amp;nbsp;I would raise PropertyChanged manually when data was discarded. Eventually I had to handle classes
 with many properties. Being the problem solver I am, I went on a journey to figure out a way around manually writing all the property changed calls. What I came up with is EditableObject which inherits from ObervableObject (should probably call it EditableObservableObject),
 has all the Edit methods and automatically raises PropertyChanged on all the class properties that are decorated with ObservableProperty attribute.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;After posting this code on Stack Overflow I started thinking that there must be a better way to go about this. Is there something I have missed during my MVVM learning phase? I searched for a solution online, but I could not come across anything. I have
 a feeling that there may be a pre-existing elegant way about doing this.&lt;/p&gt;
&lt;p&gt;Currently the issue is that even the properties that were not changed will&amp;nbsp;have&amp;nbsp;their PropertyChanged event raised. I feel that this could cause a performance hit for large objects. This is the same reason I refrained from raising the change with
 an empty string, did not want&amp;nbsp;unnecessary&amp;nbsp;events being raised.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;To cut down on wall of text, I am&amp;nbsp;going&amp;nbsp;to link to the SO answer that I&amp;nbsp;posted&amp;nbsp;earlier using this class.&lt;/p&gt;
&lt;p&gt;&lt;a title="http://stackoverflow.com/a/13613586/1524162" href="http://stackoverflow.com/a/13613586/1524162"&gt;http://stackoverflow.com/a/13613586/1524162&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Thank you for any feedback,&lt;/p&gt;
&lt;p&gt;Aleks&lt;/p&gt;
&lt;/div&gt;</description><author>Ezakiel</author><pubDate>Wed, 28 Nov 2012 20:56:55 GMT</pubDate><guid isPermaLink="false">New Post: ObservableObject and EditableObject 20121128085655P</guid></item><item><title>New Post: MVVM - What "can" go in the code behind w/o breaking Best Practices</title><link>http://mvvmfoundation.codeplex.com/discussions/394555</link><description>&lt;div style="line-height: normal;"&gt;
&lt;p&gt;We have a WPF application written in C# using Prism 4 and MVVM. Our team is having a hard time trying to determine what can go in the View Code Behind and what cannot. In the context of Best Practices and writing testable code please comment on how to address
 the inherit limitations of the MVVM pattern (using Prism). There are all sorts of techniques from giving the ViewModel access to the View via Interface to raising events from the ViewModel that are wired to from within the View. Are any of these suggestions
 okay? I do realize that in some scenarios we could write additional code creating dependency properties, but this feels like we have to spend time creating and eventually maintaining the pattern faculties and not focusing on our application.&lt;/p&gt;
&lt;/div&gt;</description><author>jesjones</author><pubDate>Thu, 06 Sep 2012 01:24:08 GMT</pubDate><guid isPermaLink="false">New Post: MVVM - What "can" go in the code behind w/o breaking Best Practices 20120906012408A</guid></item><item><title>New Post: CanExcuteChanged</title><link>http://mvvmfoundation.codeplex.com/discussions/68127</link><description>&lt;div style="line-height: normal;"&gt;&lt;p&gt;This took me a long time to find, but thank you so so much!&lt;/p&gt;&lt;/div&gt;</description><author>and_rej</author><pubDate>Fri, 24 Aug 2012 01:16:38 GMT</pubDate><guid isPermaLink="false">New Post: CanExcuteChanged 20120824011638A</guid></item><item><title>New Post: PropertyChangedEventManager.RemoveListener doesn't seem to do anything.</title><link>http://mvvmfoundation.codeplex.com/discussions/82328</link><description>&lt;div style="line-height: normal;"&gt;&lt;p&gt;Hi Matt,&lt;/p&gt;
&lt;p&gt;Did you ever figure out what the problem was? I have the opposite problem: PropertyChangedEventManager.AddListener is not adding (though I've used it successfully before) and I'm wondering if my problem is related to yours.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Thanks,&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp; Bob&lt;/p&gt;&lt;/div&gt;</description><author>balexander</author><pubDate>Fri, 06 Apr 2012 12:52:22 GMT</pubDate><guid isPermaLink="false">New Post: PropertyChangedEventManager.RemoveListener doesn't seem to do anything. 20120406125222P</guid></item><item><title>New Post: WindowsFormsHost Child Binding</title><link>http://mvvmfoundation.codeplex.com/discussions/213223</link><description>&lt;div style="line-height: normal;"&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;It's ok I figured it out.&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; I&amp;nbsp;used binding on&amp;nbsp;a ContentControl to load the Conent property, the content being an&amp;nbsp;instance&amp;nbsp;of WindowsFormHost and it's child.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Hope it helps.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;/div&gt;</description><author>YARGLTD</author><pubDate>Wed, 24 Aug 2011 13:52:35 GMT</pubDate><guid isPermaLink="false">New Post: WindowsFormsHost Child Binding 20110824015235P</guid></item><item><title>New Post: WindowsFormsHost Child Binding</title><link>http://mvvmfoundation.codeplex.com/discussions/213223</link><description>&lt;div style="line-height: normal;"&gt;&lt;p&gt;I'm trying to do exactly the same thing and get the same error message.&amp;nbsp; Did you find a solution?&lt;/p&gt;
&lt;p&gt;Thanks for any help you can give! :-)&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;/div&gt;</description><author>YARGLTD</author><pubDate>Tue, 23 Aug 2011 12:49:13 GMT</pubDate><guid isPermaLink="false">New Post: WindowsFormsHost Child Binding 20110823124913P</guid></item><item><title>New Post: about "update" in MVVM</title><link>http://mvvmfoundation.codeplex.com/discussions/77378</link><description>&lt;div style="line-height: normal;"&gt;&lt;p&gt;Josh,&lt;/p&gt;
&lt;p&gt;Do you have an example of using UpdateSourceTrigger=Explicit that adheres to MVVM?&amp;nbsp; It seems like a common scenario would be:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;1. In one View (UserControl), a ListView that displays an ObservableCollection of [Customers].&lt;/li&gt;
&lt;li&gt;2. In another View (UserControl), many TextBoxes, ComboBoxes, CheckBoxes, etc.&amp;nbsp;that will display data for the specific [Customer] that is selected in the ListView.&amp;nbsp; This view would have a Save button that uses a Command to update the repository and notify the ListView to update itself.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;I was considering creating a copy (deep copy with new reference) of the SelectedItem [Customer]&amp;nbsp;from the ListView and&amp;nbsp;passing the copied data to the details view.&amp;nbsp; The details view binds to the copied data.&amp;nbsp; When the Save button is pressed, the values for the original SelectedItem are updated with the values in the copied data.&amp;nbsp; Does this sound reasonable?&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;/div&gt;</description><author>andrewjwhittaker</author><pubDate>Fri, 12 Aug 2011 18:32:39 GMT</pubDate><guid isPermaLink="false">New Post: about "update" in MVVM 20110812063239P</guid></item><item><title>New Post: Message, WeakReference &amp; Garbage Collection</title><link>http://mvvmfoundation.codeplex.com/discussions/78223</link><description>&lt;div style="line-height: normal;"&gt;&lt;p&gt;I modified Messenger.WeakAction to include a guardMethod, guardTargetRef and guardDelegateType and then created overloads of Messenger.Register to register a Func&amp;lt;bool&amp;gt; (i.e. the guard)&amp;nbsp;alongside the callback. When NotifyColleagues is called the action is only invoked if the guard succeeds (or if the guard is null).&lt;/p&gt;
&lt;p&gt;The guard I use to find out whether a View is active is simply the IsVisible property.&lt;/p&gt;&lt;/div&gt;</description><author>ajkimball</author><pubDate>Tue, 26 Apr 2011 08:07:03 GMT</pubDate><guid isPermaLink="false">New Post: Message, WeakReference &amp; Garbage Collection 20110426080703A</guid></item><item><title>New Post: can MVVM work with SL4 &amp; MS Web developer 2010 express?</title><link>http://mvvmfoundation.codeplex.com/discussions/245554</link><description>&lt;div style="line-height: normal;"&gt;
&lt;p&gt;&lt;br&gt;
Since MS Web developer 2010 express can't convert the Mvvmfoundation.wpf. &amp;nbsp;I created a folder in my project and added 4 source files to that folder, then the compiler complains
&lt;br&gt;
&amp;quot;The type or namespace name 'IWeakEventListener' could not be found (are you missing a using directive or an assembly reference)&amp;quot;&lt;br&gt;
So I tried to add reference but windowBase.dll can';t work with SL runtime. &amp;nbsp;Does anybody have a workaround? Thanks!&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;/div&gt;</description><author>southsouth</author><pubDate>Fri, 11 Feb 2011 03:46:58 GMT</pubDate><guid isPermaLink="false">New Post: can MVVM work with SL4 &amp; MS Web developer 2010 express? 20110211034658A</guid></item><item><title>New Post: Enterprise Library</title><link>http://mvvmfoundation.codeplex.com/Thread/View.aspx?ThreadId=243961</link><description>&lt;div style="line-height: normal;"&gt;
&lt;p&gt;Sorry, I have tried that before. &amp;nbsp;I'd have to have a test project in order to debug that.&lt;/p&gt;
&lt;/div&gt;</description><author>JoshSmithonWpf</author><pubDate>Mon, 31 Jan 2011 17:50:23 GMT</pubDate><guid isPermaLink="false">New Post: Enterprise Library 20110131055023P</guid></item><item><title>New Post: Enterprise Library</title><link>http://mvvmfoundation.codeplex.com/Thread/View.aspx?ThreadId=243961</link><description>&lt;div style="line-height: normal;"&gt;
&lt;p&gt;Hi Josh,&lt;/p&gt;
&lt;p&gt;&lt;span style="white-space:pre"&gt;&lt;/span&gt;I would like to know why&amp;nbsp;PropertyObserver doesn't work when the class is instantiated using Enterprise Library? I have a container that uses the Interception Extension for Tracing purposes and when the PropertyObserver
 simply doesn't do anycallback when I Resolve through that container, but if I instantiate in the standard way, it works.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;span style="white-space:pre"&gt;&lt;/span&gt;Is there any special reason for that?&lt;/p&gt;
&lt;/div&gt;</description><author>blackdave13</author><pubDate>Mon, 31 Jan 2011 10:28:52 GMT</pubDate><guid isPermaLink="false">New Post: Enterprise Library 20110131102852A</guid></item><item><title>New Post: Messenger Unregister?</title><link>http://mvvmfoundation.codeplex.com/Thread/View.aspx?ThreadId=238177</link><description>&lt;div style="line-height: normal;"&gt;
&lt;p&gt;My Messenger class does not support that. &amp;nbsp;It's something I've meant to do for a while now, just haven't gotten around to it. You can either implement it yourself, or use Laurent Bugnion's Messenger from his MVVM Light toolkit.&amp;nbsp;&lt;a href="http://mvvmlight.codeplex.com/"&gt;http://mvvmlight.codeplex.com/&lt;/a&gt;&lt;/p&gt;
&lt;/div&gt;</description><author>JoshSmithonWpf</author><pubDate>Mon, 13 Dec 2010 16:19:00 GMT</pubDate><guid isPermaLink="false">New Post: Messenger Unregister? 20101213041900P</guid></item><item><title>New Post: Messenger Unregister?</title><link>http://mvvmfoundation.codeplex.com/Thread/View.aspx?ThreadId=238177</link><description>&lt;div style="line-height: normal;"&gt;
&lt;p&gt;I'm building my application in some ways like an old MDI application, with multiple &amp;quot;documents&amp;quot; (I call them &amp;quot;executors&amp;quot;)&amp;nbsp;projecting different views of the underlying model. With only one of these executors active any time, I find myself wanting to
 unregister and reregister callbacks as they are dynamically activated and deactivated.&amp;nbsp;Since that&amp;nbsp;makes perfect sense to me,&amp;nbsp;I must be missing something because the Messenger class has only a Register and no Unregister method. Am I thinking
 about this all wrong?&lt;/p&gt;
&lt;/div&gt;</description><author>dcbrower</author><pubDate>Mon, 13 Dec 2010 13:46:24 GMT</pubDate><guid isPermaLink="false">New Post: Messenger Unregister? 20101213014624P</guid></item><item><title>New Post: Highlighting cell values in a datagrid dynamically WPF MVVM</title><link>http://mvvmfoundation.codeplex.com/Thread/View.aspx?ThreadId=232175</link><description>&lt;div style="line-height: normal;"&gt;
&lt;p&gt;Hi All,&lt;/p&gt;
&lt;p&gt;Is it possible to highlight a particular cell in datagrid using MVVM pattern in WPF.&lt;/p&gt;
&lt;p&gt;Please note that I am trying to loop through all the rows in an observable collection before binding to the datagrid. I want to highlight cells based on some condition.&lt;/p&gt;
&lt;p&gt;Any help on this?&lt;/p&gt;
&lt;p&gt;Regards&lt;/p&gt;
&lt;p&gt;karloduniyamuthi&lt;/p&gt;
&lt;/div&gt;</description><author>karloduniyamuthi</author><pubDate>Mon, 25 Oct 2010 09:25:33 GMT</pubDate><guid isPermaLink="false">New Post: Highlighting cell values in a datagrid dynamically WPF MVVM 20101025092533A</guid></item><item><title>New Post: Drag &amp; Drop/Other Inderaction in MVVM App</title><link>http://mvvmfoundation.codeplex.com/Thread/View.aspx?ThreadId=231128</link><description>&lt;div style="line-height: normal;"&gt;&lt;p&gt;I wonder in a MVVM Application, where do non-click interaction go? Eg. Drag &amp;amp; Drop, Hover. will Code Behind Event Handlers delegating work to public functions in View Model do?&lt;/p&gt;&lt;/div&gt;</description><author>jiewmeng</author><pubDate>Sat, 16 Oct 2010 10:58:32 GMT</pubDate><guid isPermaLink="false">New Post: Drag &amp; Drop/Other Inderaction in MVVM App 20101016105832A</guid></item><item><title>New Post: Message, WeakReference &amp; Garbage Collection</title><link>http://mvvmfoundation.codeplex.com/Thread/View.aspx?ThreadId=78223</link><description>&lt;div style="line-height: normal;"&gt;&lt;p&gt;Can you explain exactly what you did? &amp;nbsp;How do you know if the view is active? or inactive? &amp;nbsp;What is the guard you created?&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;/div&gt;</description><author>MetalliMyers</author><pubDate>Thu, 14 Oct 2010 18:31:48 GMT</pubDate><guid isPermaLink="false">New Post: Message, WeakReference &amp; Garbage Collection 20101014063148P</guid></item></channel></rss>