<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>M-V-VM training day sample application and decks</title><link>http://blogs.msdn.com/jaimer/archive/2009/02/10/m-v-vm-training-day-sample-application-and-decks.aspx</link><description>During the M-V-VM training (last saturday) with Karl Shifflett I showed and referred often to this Southridge application below.. The app is not very clean(when it comes to resources and styles in particular) but it is a fairly good ViewModel example,</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>M-V-VM training day sample application and decks - Click &amp;amp; Solve</title><link>http://blogs.msdn.com/jaimer/archive/2009/02/10/m-v-vm-training-day-sample-application-and-decks.aspx#9410199</link><pubDate>Tue, 10 Feb 2009 12:40:44 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9410199</guid><dc:creator>M-V-VM training day sample application and decks - Click &amp;amp; Solve</dc:creator><description>&lt;p&gt;PingBack from &lt;a rel="nofollow" target="_new" href="http://www.clickandsolve.com/?p=5699"&gt;http://www.clickandsolve.com/?p=5699&lt;/a&gt;&lt;/p&gt;
</description></item><item><title>re: M-V-VM training day sample application and decks</title><link>http://blogs.msdn.com/jaimer/archive/2009/02/10/m-v-vm-training-day-sample-application-and-decks.aspx#9410318</link><pubDate>Tue, 10 Feb 2009 13:57:36 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9410318</guid><dc:creator>Radeldudel</dc:creator><description>&lt;p&gt;Some questions (since the link to the source does not work, so I can't look for myself):&lt;/p&gt;
&lt;p&gt;Can you use a mouse doubleclick to go from the SearchView to the Map? &lt;/p&gt;
&lt;p&gt;How did you bind the list header click to sorting the content?&lt;/p&gt;
&lt;p&gt;(these questions about binding events to the VM are my main problem around M-V-VM, thats why I ask).&lt;/p&gt;
&lt;p&gt;thanks in advance,&lt;/p&gt;
&lt;p&gt;Sam&lt;/p&gt;
</description></item><item><title>re: M-V-VM training day sample application and decks</title><link>http://blogs.msdn.com/jaimer/archive/2009/02/10/m-v-vm-training-day-sample-application-and-decks.aspx#9410411</link><pubDate>Tue, 10 Feb 2009 15:01:43 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9410411</guid><dc:creator>sazish</dc:creator><description>&lt;p&gt;Code and ppt decks aren't available.&lt;/p&gt;
&lt;p&gt;Sam&lt;/p&gt;
</description></item><item><title>re: M-V-VM training day sample application and decks</title><link>http://blogs.msdn.com/jaimer/archive/2009/02/10/m-v-vm-training-day-sample-application-and-decks.aspx#9410526</link><pubDate>Tue, 10 Feb 2009 16:23:56 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9410526</guid><dc:creator>bill44077</dc:creator><description>&lt;p&gt;Awesome - Wish I could have been there. Any plans on doing this out East?&lt;/p&gt;
&lt;p&gt;Both the code link and ppt links are broke. Can't wait to see the material.&lt;/p&gt;
&lt;p&gt;regards,&lt;/p&gt;
&lt;p&gt;Bill&lt;/p&gt;
</description></item><item><title>re: M-V-VM training day sample application and decks</title><link>http://blogs.msdn.com/jaimer/archive/2009/02/10/m-v-vm-training-day-sample-application-and-decks.aspx#9410748</link><pubDate>Tue, 10 Feb 2009 18:37:14 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9410748</guid><dc:creator>huseyint</dc:creator><description>&lt;p&gt;Links should be:&lt;/p&gt;
&lt;p&gt;&lt;a rel="nofollow" target="_new" href="http://www.cookingwithxaml.com/meals/southridge/decknotes.pptx"&gt;http://www.cookingwithxaml.com/meals/southridge/decknotes.pptx&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a rel="nofollow" target="_new" href="http://www.cookingwithxaml.com/meals/southridge/southridge.zip"&gt;http://www.cookingwithxaml.com/meals/southridge/southridge.zip&lt;/a&gt;&lt;/p&gt;
</description></item><item><title>re: M-V-VM training day sample application and decks</title><link>http://blogs.msdn.com/jaimer/archive/2009/02/10/m-v-vm-training-day-sample-application-and-decks.aspx#9410783</link><pubDate>Tue, 10 Feb 2009 19:04:25 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9410783</guid><dc:creator>jaimer</dc:creator><description>&lt;p&gt;Sorry about the links.. &amp;nbsp;I tested them but some how between my test and publish I made them relative... &lt;/p&gt;
&lt;p&gt;Huseyint them right, and the actual links have been fixed.. &lt;/p&gt;
&lt;p&gt;Sorry again.. &amp;nbsp;I need to stop blogging at midnight so I am awake when I hit publish ..&lt;/p&gt;
</description></item><item><title>M-V-VM training day sample application and decks</title><link>http://blogs.msdn.com/jaimer/archive/2009/02/10/m-v-vm-training-day-sample-application-and-decks.aspx#9412749</link><pubDate>Wed, 11 Feb 2009 17:15:14 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9412749</guid><dc:creator>DotNetShoutout</dc:creator><description>&lt;p&gt;Thank you for submitting this cool story - Trackback from DotNetShoutout&lt;/p&gt;
</description></item><item><title>re: M-V-VM training day sample application and decks</title><link>http://blogs.msdn.com/jaimer/archive/2009/02/10/m-v-vm-training-day-sample-application-and-decks.aspx#9418930</link><pubDate>Fri, 13 Feb 2009 17:50:03 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9418930</guid><dc:creator>davidjjon77</dc:creator><description>&lt;p&gt;Thank you very much Jaime for sharing this project.&lt;/p&gt;
&lt;p&gt;David Roh&lt;/p&gt;
</description></item><item><title>re: M-V-VM training day sample application and decks</title><link>http://blogs.msdn.com/jaimer/archive/2009/02/10/m-v-vm-training-day-sample-application-and-decks.aspx#9420892</link><pubDate>Sat, 14 Feb 2009 07:43:15 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9420892</guid><dc:creator>johnpapa</dc:creator><description>&lt;p&gt;Good stuff Jamie. MVVM is a nice pattern for WPF and Silverlight that fits great with the DataContext and XAML binding techniques. I'm no pattern extremist by any means, but I like combining it with Ninject or Unity for some DI to improve testability. &lt;/p&gt;
&lt;p&gt;Thanks for sharing!&lt;/p&gt;
</description></item><item><title>re: M-V-VM training day sample application and decks</title><link>http://blogs.msdn.com/jaimer/archive/2009/02/10/m-v-vm-training-day-sample-application-and-decks.aspx#9456958</link><pubDate>Tue, 03 Mar 2009 19:20:36 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9456958</guid><dc:creator>bill44077</dc:creator><description>&lt;p&gt;Hi Jamie,&lt;/p&gt;
&lt;p&gt;I've been working my way through the Southridge sample (both the original from codeplex/PDC2008 and your current example here). There are many differences and I'm having trouble making the leap. In the Southridge Lab from PDC there is a section on the Ribbon. They create the RibbonCommand_CanExecute and the RibbonCommand_Executed method - but unfortunately they never get set up to do anything. The CanExecute just sets &amp;quot;true&amp;quot; and the Executed pops up a messagebox. I'm really having trouble figuring out how to connect these methods up to my ICommand methods. I'm sure that I'm just missing something really simple but I can't figure it out. &lt;/p&gt;
&lt;p&gt;In this example you changed the way that was set up for the Commands and you added the NonRoutedRibbonCommandDelegator. Then in your RibbonCommands in the xaml you use the view:NonRoutedRibbonCommandDelegator. You also use the DelegateCommand here instead of the more simple RelayCommand. If I could find one example of how to hook up the RibbonCommand with the ViewModel I think that I would be on my way. I just can't figure out how to get from the Executed to the ICommand for each one.&lt;/p&gt;
&lt;p&gt;Thanks in advance and I really appreciate all the work you put into your blogs! I'm hoping you guys will make a trip out to the Midwest or East on your tour so we from Cleveland can come see the real presentation. It sounds awesome!&lt;/p&gt;
&lt;p&gt;regards,&lt;/p&gt;
&lt;p&gt;Bill&lt;/p&gt;
</description></item><item><title>re: M-V-VM training day sample application and decks</title><link>http://blogs.msdn.com/jaimer/archive/2009/02/10/m-v-vm-training-day-sample-application-and-decks.aspx#9457844</link><pubDate>Wed, 04 Mar 2009 04:44:22 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9457844</guid><dc:creator>jaimer</dc:creator><description>&lt;p&gt;Hi bill. &lt;/p&gt;
&lt;p&gt;Are you referrring to the codeplex HOLs for southridge? You are right that it is hugely different codebase.. &amp;nbsp;The labs are being re-written, but we learned not to release them too early again so that will take a full 3 to 4 weeks :( &lt;/p&gt;
&lt;p&gt;Regarding RibbonCommand and mvvm. &lt;/p&gt;
&lt;p&gt;The way I chose to do it, as you have seen on the code is through NonRoutedRibbonCommandDelegator - that is the short name, it was even longer once before--. &lt;/p&gt;
&lt;p&gt;I do not quite recommend you do it, but if you do not like NRRCD the way the design is in the CTP ribbon, you would expose a Command of type RibbonCommand in your view model.. and you could use that.. &amp;nbsp;I do not like that cause those are routedcommands, &amp;nbsp;and also your command would have more view state, but it should work.. &lt;/p&gt;
&lt;p&gt;With regards to RelayCommand and DelegateCommand; it is the same thing .. &amp;nbsp;DelegateCommand is what we called it in Prism and name got stuck on my head.. &amp;nbsp; &lt;/p&gt;
&lt;p&gt;hth,&lt;/p&gt;
</description></item><item><title>re: M-V-VM training day sample application and decks</title><link>http://blogs.msdn.com/jaimer/archive/2009/02/10/m-v-vm-training-day-sample-application-and-decks.aspx#9458743</link><pubDate>Wed, 04 Mar 2009 20:50:01 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9458743</guid><dc:creator>bill44077</dc:creator><description>&lt;p&gt;Hi Jamie,&lt;/p&gt;
&lt;p&gt;Yes - the HOL is what I was referring to and unfortunately that doesn't use the ViewModel so everything is in the code behind. &lt;/p&gt;
&lt;p&gt;I appreciate the info. I'm close but I'm still missing something really simple. Probably one line of code somewhere :)&lt;/p&gt;
&lt;p&gt;I get my RibbonControl in my app, but the ICommands are never getting called so all my ribbon buttons are disabled &amp;nbsp;I've set breakpoints in the and don't hit them.&lt;/p&gt;
&lt;p&gt;Here's what I have:&lt;/p&gt;
&lt;p&gt;[mainwindow.xaml]&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;&amp;lt;r:RibbonWindow.Resources&amp;gt;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;ResourceDictionary&amp;gt;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;local:NonRoutedRibbonCommandDelegator &lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;x:Key=&amp;quot;CopyCommand&amp;quot;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;LabelTitle=&amp;quot;Copy Project&amp;quot;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;LabelDescription=&amp;quot;Copy a project&amp;quot;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;ToolTipDescription=&amp;quot;Copy Project from your disk.&amp;quot;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;ToolTipTitle=&amp;quot;Copy Project&amp;quot;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;SmallImageSource=&amp;quot;Images/copy.png&amp;quot;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;LargeImageSource=&amp;quot;Images/copy.png&amp;quot; /&amp;gt;&lt;/p&gt;
&lt;p&gt;...&lt;/p&gt;
&lt;p&gt;[mainwindow.xaml.cs]&lt;/p&gt;
&lt;p&gt;mainwindow()&lt;/p&gt;
&lt;p&gt;{&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;this.DataContext = new MainWindowViewModel();&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;InitializeComponent();&lt;/p&gt;
&lt;p&gt;...&lt;/p&gt;
&lt;p&gt;[mainwindowviewmodel.cs]&lt;/p&gt;
&lt;p&gt;...&lt;/p&gt;
&lt;p&gt;private ICommand _copyCommand;&lt;/p&gt;
&lt;p&gt;...&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;public ICommand CopyCommand&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;{&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;get&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;{&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;if (_copyCommand == null)&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;{&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;_copyCommand = new RelayCommand(CopyExecute, CanCopyExecute);&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;return _copyCommand;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;/p&gt;
&lt;p&gt;...&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;private bool CanCopyExecute(object param)&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;{&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;return true;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;private void CopyExecute(object param)&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;{&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;/p&gt;
&lt;p&gt;...&lt;/p&gt;
&lt;p&gt;I'm using your NRRCD class as well.&lt;/p&gt;
&lt;p&gt;I've noticed that when I set a breakpoint in your Southridge sample code that it hits the getter for the NewProfile ICommand, for example, which is exactly what I would expect. The call stack window shows [External Code] which I am suspecting is the RibbonControlLibrary dll?&lt;/p&gt;
&lt;p&gt;Thanks in advance for anything you might see here that I am forgetting. I'm sure it going to be one of those things that makes me go &amp;quot;Duh!&amp;quot;&lt;/p&gt;
&lt;p&gt;regards,&lt;/p&gt;
&lt;p&gt;Bill&lt;/p&gt;
</description></item><item><title>re: M-V-VM training day sample application and decks</title><link>http://blogs.msdn.com/jaimer/archive/2009/02/10/m-v-vm-training-day-sample-application-and-decks.aspx#9458745</link><pubDate>Wed, 04 Mar 2009 20:52:52 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9458745</guid><dc:creator>bill44077</dc:creator><description>&lt;p&gt;Hi Jamie - I meant to add the ribbonbutton to what I have in the mainwindow.xaml&lt;/p&gt;
&lt;p&gt;&amp;lt;r:RibbonButton Command=&amp;quot;{StaticResource CopyCommand}&amp;quot; /&amp;gt;&lt;/p&gt;
&lt;p&gt;thanks!&lt;/p&gt;
&lt;p&gt;Bill&lt;/p&gt;
</description></item><item><title>re: M-V-VM training day sample application and decks</title><link>http://blogs.msdn.com/jaimer/archive/2009/02/10/m-v-vm-training-day-sample-application-and-decks.aspx#9458877</link><pubDate>Wed, 04 Mar 2009 23:23:50 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9458877</guid><dc:creator>bill44077</dc:creator><description>&lt;p&gt;Hi Jamie,&lt;/p&gt;
&lt;p&gt;I found my &amp;quot;Duh!&amp;quot;. Turns out I didn't pay enough attention to your xaml and I missed a very important line:&lt;/p&gt;
&lt;p&gt;ActualCommand=&amp;quot;{Binding Source={StaticResource spy}, Path=DataContext.OpenCommand}&amp;quot;/&amp;gt;&lt;/p&gt;
&lt;p&gt;That's the hook-up I was missing.&lt;/p&gt;
&lt;p&gt;thanks again!&lt;/p&gt;
&lt;p&gt;Bill&lt;/p&gt;
</description></item></channel></rss>