﻿<?xml version="1.0" encoding="utf-8"?><rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:media="http://search.yahoo.com/mrss/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0"><channel><title>Intersoft Community - ClientUI - Using MVVM Pattern without Codebehind</title><link>http://www.intersoftsolutions.com/Community/ClientUI/Using-MVVM-Pattern-without-Codebehind/</link><description /><generator>http://www.intersoftsolutions.com</generator><language>en</language><copyright>Copyright 2002 - 2015 Intersoft Solutions Corp. All rights reserved.</copyright><ttl>60</ttl><item><title>Using MVVM Pattern without Codebehind</title><link>http://www.intersoftsolutions.com/Community/ClientUI/Using-MVVM-Pattern-without-Codebehind/</link><pubDate>Tue, 17 May 2011 22:23:34 GMT</pubDate><dc:creator>Riendy</dc:creator><category>Silverlight</category><description>&lt;p&gt;&lt;span style="color: rgb(63, 63, 63); font-family: 'segoe ui', arial, verdana, tahoma; font-size: 12px; line-height: 18px; "&gt;Hello Klaus,&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;font class="Apple-style-span" style="color: rgb(63, 63, 63); font-family: 'segoe ui', arial, verdana, tahoma; "&gt;&lt;span style="font-size: 12px; line-height: 18px; "&gt;I'm apologize if my post did not answer your question.&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="line-height: 18px; color: rgb(63, 63, 63); font-family: 'segoe ui', arial, verdana, tahoma; font-size: 12px; "&gt;Let me clarify my answer,&amp;nbsp;&lt;/span&gt;&lt;span style="color: rgb(63, 63, 63); font-family: 'segoe ui', arial, verdana, tahoma; font-size: 12px; line-height: 18px; "&gt;to create&amp;nbsp;&lt;/span&gt;&lt;span style="color: rgb(63, 63, 63); font-family: 'segoe ui', arial, verdana, tahoma; font-size: 12px; line-height: 18px; "&gt;an instance of the ViewModel, we have to input user interaction logic using ViewModel layer (i.e. CustomersViewModel.cs) and then we instantiate the ViewModel in the XAML, not in code behind.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="color: rgb(63, 63, 63); font-family: 'segoe ui', arial, verdana, tahoma; font-size: 12px; line-height: 18px; "&gt;i.e.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;font class="Apple-style-span" style="color: rgb(63, 63, 63); font-family: 'segoe ui', arial, verdana, tahoma; "&gt;&lt;span style="font-size: 12px; line-height: 18px; " /&gt;&lt;/font&gt;&lt;/p&gt;&lt;pre&gt;&lt;font class="Apple-style-span" style="color: rgb(63, 63, 63); font-family: 'segoe ui', arial, verdana, tahoma; "&gt;&lt;span style="color: rgb(0, 0, 255); "&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0); "&gt;Intersoft:UXPage.Resources&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255); "&gt;&amp;gt;&lt;/span&gt;
    &lt;span style="color: rgb(0, 0, 255); "&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0); "&gt;ViewModels:CustomersViewModel &lt;/span&gt;&lt;span style="color: rgb(255, 0, 0); "&gt;x:Key&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255); "&gt;="CustomersViewModel"&lt;/span&gt;&lt;span style="color: rgb(255, 0, 0); " /&gt;&lt;span style="color: rgb(0, 0, 255); "&gt;/&amp;gt;&lt;/span&gt;
    ...
&lt;span style="color: rgb(0, 0, 255); "&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0); "&gt;Intersoft:UXPage.Resources&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255); "&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 255); "&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0); "&gt;Grid &lt;/span&gt;&lt;span style="color: rgb(255, 0, 0); "&gt;x:Name&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255); "&gt;="LayoutRoot"&lt;/span&gt;&lt;span style="color: rgb(255, 0, 0); "&gt; DataContext&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255); "&gt;="&lt;/span&gt;&lt;span style="color: rgb(128, 128, 0); "&gt;{StaticResource CustomersViewModel}&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255); "&gt;"&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255); "&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 255); "&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0); "&gt;Grid&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255); "&gt;&amp;gt;&lt;/span&gt;&lt;/font&gt;&lt;/pre&gt;
&lt;p /&gt;
&lt;p&gt;&lt;span style="color: rgb(63, 63, 63); font-family: 'segoe ui', arial, verdana, tahoma; font-size: 12px; line-height: 18px; "&gt;Could you please let me know which particular code of MVVM sample(to create an instance of the ViewModelBase) that you found in code behind?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;font class="Apple-style-span" style="color: rgb(63, 63, 63); font-family: 'segoe ui', arial, verdana, tahoma; "&gt;&lt;span style="font-size: 12px; line-height: 18px; "&gt;&lt;br /&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="line-height: 18px; color: rgb(63, 63, 63); font-family: 'segoe ui', arial, verdana, tahoma; font-size: 12px; "&gt;Hope this helps.&lt;br /&gt;Riendy&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;font class="Apple-style-span" style="color: rgb(63, 63, 63); font-family: 'segoe ui', arial, verdana, tahoma; "&gt;&lt;span style="font-size: 12px; line-height: 18px; "&gt;&lt;br /&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;</description></item><item><title>Using MVVM Pattern without Codebehind</title><link>http://www.intersoftsolutions.com/Community/ClientUI/Using-MVVM-Pattern-without-Codebehind/</link><pubDate>Mon, 16 May 2011 04:42:11 GMT</pubDate><dc:creator>Riendy</dc:creator><category>Silverlight</category><description>&lt;p&gt;Hello Klaus,&lt;/p&gt;&lt;p&gt;It is impossible to create an instance of the ViewModelBase only via XAML, because based on MVVM (Model-View-ViewModel) pattern definition, we have to separate Model, View, and ViewModel.&lt;/p&gt;
&lt;p&gt;The View responsible to displaying and collecting data form end users. It is not responsible for retreiving data and business rules(validating data).&lt;br /&gt;The ViewModel responsible to aggregating and storing data which will be bound to a View.&lt;br /&gt;In brief, on MVVM pattern, the View doesn't have to worry about retreiving data and know where data comes from.&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;Hope this helps.&lt;br /&gt;Riendy&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;Regards,&lt;br /&gt;Riendy&lt;/p&gt;</description></item><item><title>Using MVVM Pattern without Codebehind</title><link>http://www.intersoftsolutions.com/Community/ClientUI/Using-MVVM-Pattern-without-Codebehind/</link><pubDate>Fri, 13 May 2011 10:29:03 GMT</pubDate><dc:creator>KKirchhoff</dc:creator><category>Silverlight</category><description>&lt;p&gt;Hello, &lt;/p&gt;
&lt;p&gt;In your example about MVVM you have some code in the Codebehind file, to create an in stance of the ViewModelBase ... Is it possible to create the instance of the ViewModelBase only via XMAL?&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;Thx for help&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;</description></item></channel></rss>