<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://weblogs.asp.net/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>ASP.NET Weblogs</title><link>http://weblogs.asp.net/</link><description /><dc:language>en-US</dc:language><generator>CommunityServer 2007 SP1 (Build: 20510.895)</generator><item><title>Daily tech links for .net and related technologies - December 9-10, 2009</title><link>http://weblogs.asp.net/sanjeevagarwal/archive/2009/12/09/daily-tech-links-for-net-and-related-technologies-december-9-10-2009.aspx</link><pubDate>Wed, 09 Dec 2009 10:58:00 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:7274521</guid><dc:creator>SanjeevAgarwal</dc:creator><author>SanjeevAgarwal</author><slash:comments>3</slash:comments><description>Daily tech links for .net and related technologies - December 9-10, 2009 Web Development Organizing ASP.NET MVC solutions ASP.NET MVC 2 Part 6 – Using Dependency Injection with ASP.NET MVC Localizing ASP.NET MVC Validation - Phil Haack ASP.NET MVC Embedded Views with MVC Turbine How To Check Email Programmatically – SidePOP Globally Register User and Custom Controls in ASP.NET ASP.NET: Creating a UserControl with Child Content Magellan Action Filters Magellan and View Reuse Essential Tips and Tricks...(&lt;a href="http://weblogs.asp.net/sanjeevagarwal/archive/2009/12/09/daily-tech-links-for-net-and-related-technologies-december-9-10-2009.aspx"&gt;read more&lt;/a&gt;)&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=7274521" width="1" height="1"&gt;</description><category domain="http://weblogs.asp.net/sanjeevagarwal/archive/tags/ASP.NET/default.aspx">ASP.NET</category><category domain="http://weblogs.asp.net/sanjeevagarwal/archive/tags/JQuery/default.aspx">JQuery</category><category domain="http://weblogs.asp.net/sanjeevagarwal/archive/tags/Silverlight/default.aspx">Silverlight</category><category domain="http://weblogs.asp.net/sanjeevagarwal/archive/tags/C_2300_/default.aspx">C#</category><category domain="http://weblogs.asp.net/sanjeevagarwal/archive/tags/.NET/default.aspx">.NET</category><category domain="http://weblogs.asp.net/sanjeevagarwal/archive/tags/WPF/default.aspx">WPF</category><category domain="http://weblogs.asp.net/sanjeevagarwal/archive/tags/WCF/default.aspx">WCF</category><category domain="http://weblogs.asp.net/sanjeevagarwal/archive/tags/MVC/default.aspx">MVC</category><category domain="http://weblogs.asp.net/sanjeevagarwal/archive/tags/LINQ/default.aspx">LINQ</category><category domain="http://weblogs.asp.net/sanjeevagarwal/archive/tags/XML/default.aspx">XML</category><category domain="http://weblogs.asp.net/sanjeevagarwal/archive/tags/Ajax/default.aspx">Ajax</category><category domain="http://weblogs.asp.net/sanjeevagarwal/archive/tags/SQL+Server/default.aspx">SQL Server</category><category domain="http://weblogs.asp.net/sanjeevagarwal/archive/tags/Visual+Studio/default.aspx">Visual Studio</category><category domain="http://weblogs.asp.net/sanjeevagarwal/archive/tags/Entity+Framework/default.aspx">Entity Framework</category><category domain="http://weblogs.asp.net/sanjeevagarwal/archive/tags/Sharepoint/default.aspx">Sharepoint</category></item><item><title>New Version of Visual NHibernate</title><link>http://weblogs.asp.net/ricardoperes/archive/2009/12/09/new-version-ofvisual-nhibernate.aspx</link><pubDate>Wed, 09 Dec 2009 10:36:00 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:7274509</guid><dc:creator>Ricardo Peres</dc:creator><author>Ricardo Peres</author><slash:comments>0</slash:comments><description>&lt;p&gt;A new version was released: 2.0.9.1018. Some of my suggestions have been implemented, more to come (I hope!). You can contribute by giving feedback at the forum, which is located &lt;a href="http://forums.slyce.com/" target="_blank"&gt;here&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Read the change log &lt;a href="http://www.slyce.com/VisualNHibernate/VersionHistory/" target="_blank"&gt;here&lt;/a&gt; and download it &lt;a href="http://www.slyce.com/Downloads/" target="_blank"&gt;here&lt;/a&gt;.&lt;/p&gt;
&lt;a class="addthis_button" href="http://www.addthis.com/bookmark.php?v=250&amp;amp;pub=xa-4a96c06008dc31e0" mce_href="http://www.addthis.com/bookmark.php?v=250&amp;amp;pub=xa-4a96c06008dc31e0"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; border-top: 0px; border-right: 0px" alt="Bookmark and Share" src="http://s7.addthis.com/static/btn/v2/lg-share-en.gif" width="125" height="16" mce_src="http://s7.addthis.com/static/btn/v2/lg-share-en.gif"&gt;&lt;/a&gt;
&lt;script type=text/javascript src="http://s7.addthis.com/js/250/addthis_widget.js?pub=xa-4a96c06008dc31e0" mce_src="http://s7.addthis.com/js/250/addthis_widget.js?pub=xa-4a96c06008dc31e0"&gt;&lt;/script&gt;
&lt;script type="text/javascript" src="http://shots.snap.com/ss/7dcf59af71ae4ef1d02a114a733595f1/snap_shots.js"&gt;&lt;/script&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=7274509" width="1" height="1"&gt;</description><category domain="http://weblogs.asp.net/ricardoperes/archive/tags/.NET/default.aspx">.NET</category><category domain="http://weblogs.asp.net/ricardoperes/archive/tags/NHibernate/default.aspx">NHibernate</category><category domain="http://weblogs.asp.net/ricardoperes/archive/tags/Tools/default.aspx">Tools</category><category domain="http://weblogs.asp.net/ricardoperes/archive/tags/O_2F00_RM/default.aspx">O/RM</category></item><item><title>Security Lessons from How Windows Live Uses ASP.NET MVC</title><link>http://weblogs.asp.net/ricardoperes/archive/2009/12/09/security-lessons-from-how-windows-live-uses-asp-net-mvc.aspx</link><pubDate>Wed, 09 Dec 2009 10:30:00 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:7274505</guid><dc:creator>Ricardo Peres</dc:creator><author>Ricardo Peres</author><slash:comments>1</slash:comments><description>&lt;p&gt;Nice whitepaper, available &lt;a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=7606f801-70c5-49ca-a18c-91d4ed725833&amp;displaylang=en" target="_blank"&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;a class="addthis_button" href="http://www.addthis.com/bookmark.php?v=250&amp;amp;pub=xa-4a96c06008dc31e0" mce_href="http://www.addthis.com/bookmark.php?v=250&amp;amp;pub=xa-4a96c06008dc31e0"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; border-top: 0px; border-right: 0px" alt="Bookmark and Share" src="http://s7.addthis.com/static/btn/v2/lg-share-en.gif" width="125" height="16" mce_src="http://s7.addthis.com/static/btn/v2/lg-share-en.gif"&gt;&lt;/a&gt;
&lt;script type=text/javascript src="http://s7.addthis.com/js/250/addthis_widget.js?pub=xa-4a96c06008dc31e0" mce_src="http://s7.addthis.com/js/250/addthis_widget.js?pub=xa-4a96c06008dc31e0"&gt;&lt;/script&gt;

&lt;script type="text/javascript" src="http://shots.snap.com/ss/7dcf59af71ae4ef1d02a114a733595f1/snap_shots.js"&gt;&lt;/script&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=7274505" width="1" height="1"&gt;</description><category domain="http://weblogs.asp.net/ricardoperes/archive/tags/.NET/default.aspx">.NET</category><category domain="http://weblogs.asp.net/ricardoperes/archive/tags/ASP.NET/default.aspx">ASP.NET</category><category domain="http://weblogs.asp.net/ricardoperes/archive/tags/ASP.NET+MVC/default.aspx">ASP.NET MVC</category></item><item><title>Getting Started with the MVVM Pattern in Silverlight Applications</title><link>http://weblogs.asp.net/dwahlin/archive/2009/12/08/getting-started-with-the-mvvm-pattern-in-silverlight-applications.aspx</link><pubDate>Wed, 09 Dec 2009 07:30:06 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:7274398</guid><dc:creator>dwahlin</dc:creator><author>dwahlin</author><slash:comments>2</slash:comments><description>&lt;p&gt;&lt;/p&gt;  &lt;p&gt;With the increasing popularity of Silverlight as an application development framework the discussion of patterns has grown louder and louder. Fortunately the majority of developers building Silverlight applications have agreed on a pattern that fits well in the Silverlight world called Model-View-ViewModel (MVVM). The MVVM pattern allows applications to be divided up into separate layers that provide multiple benefits ranging from better code re-use to enhanced testing capabilities. This post will explain key concepts found in the MVVM pattern and attempt to present them in a way that is easy to understand. I’ll show some code along the way to demonstrate how the MVVM pattern can be used and provide a few alternatives when it comes to binding data. The code shown later in the post can be &lt;a href="http://www.xmlforasp.net/CodeBank/Download/Blog/Silverlight3/ViewModelSample.zip"&gt;downloaded here&lt;/a&gt;.&lt;/p&gt;  &lt;h3&gt;Getting Started with the MVVM Pattern&lt;/h3&gt;  &lt;p&gt;The MVVM pattern defines three key parts including the Model, the View and the ViewModel. The following image shows a slide from a Silverlight course &lt;a href="http://www.thewahlingroup.com"&gt;we offer&lt;/a&gt; that sums up the role of each part of the MVVM pattern in a concise way:    &lt;br /&gt;&lt;/p&gt;  &lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/dwahlin/clip_image002_5D087867.jpg"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="clip_image002" border="0" alt="clip_image002" src="http://weblogs.asp.net/blogs/dwahlin/clip_image002_thumb_62E31C00.jpg" width="374" height="280" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;   &lt;br /&gt;Looking through the description of each part you can see that the Model represents the business domain which includes the model classes used (Customer, Order, etc.), data access code and business rules. In general you can think of the Model as representing the entities that live on the server as well as the objects that are responsible for interacting with the data store your application uses and filling entities with data. While some people feel that the Model represents only the model classes (classes like Customer, Order, etc.) used in the application I personally think of it more broadly and include data access code and business rules in the Model definition. Silverlight applications will call into the Model code through services written using WCF, ASMX, REST or even custom solutions.&lt;/p&gt;  &lt;p&gt;The View in MVVM represents the Silverlight screens that you build. This includes the XAML files and the code-beside files that are responsible for showing data to end users. The View's responsibilities include displaying data and collecting data from end users. A given View isn't responsible for retrieving data, performing any business rules or validating data.&lt;/p&gt;  &lt;p&gt;The ViewModel acts as the middle-man between the View and the Model. It's responsible for aggregating and storing data that will be bound to a View. For example, a ViewModel may contain a List&amp;lt;State&amp;gt; property and a List&amp;lt;Person&amp;gt; property that may be bound to two ComboBox controls in a View. The ViewModel will retrieve the values held by these two properties from the Model. By using a ViewModel the View doesn't have to worry about retrieving data and knows nothing about where data comes from. &lt;/p&gt;  &lt;p&gt;Additional players may be added into the Model-View-ViewModel mix to help segregate code even further. For example, I normally create a service agent class that is responsible for making calls from Silverlight to remote services. The service agent is responsible for initiating the service call, capturing the data that's returned and forwarding the data back to the ViewModel. By doing this the ViewModel classes can delegate data gathering responsibilities to the service agent. A given service agent can also be re-used across multiple ViewModel classes as needed. The following image shows how the service agent can be integrated into the MVVM pattern:   &lt;br /&gt;&lt;/p&gt;  &lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/dwahlin/clip_image004_7A9A5366.jpg"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="clip_image004" border="0" alt="clip_image004" src="http://weblogs.asp.net/blogs/dwahlin/clip_image004_thumb_12BDBDC2.jpg" width="393" height="298" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;When developers first start building Silverlight applications they typically add all of the code for the application into the XAML's code-beside file (MainPage.xaml.cs for example). Although this approach certainly works, by following the MVVM pattern you can take advantage of several inherent benefits including better code re-use, simplified maintenance, more modular code and enhanced testing support. I'll focus on the overall benefits achieved by building applications that are based on the MVVM pattern throughout the rest of this article.   &lt;br /&gt;&lt;/p&gt;  &lt;h3&gt;The Model&lt;/h3&gt;  &lt;p&gt;There are many different ways that the Model can be created including using Microsoft's Entity Framework or LINQ to SQL technologies, nHibernate, PLINQO, SubSonic, custom solutions and more. The technology chosen is generally unique to a given company's development policies so I'm not going to go into a discussion of the pros and cons of each technology here. What's important is that one or more classes used by a Silverlight application are &amp;quot;modeled&amp;quot; using tools or by writing code by hand. This involves defining all of the properties that each class will expose. A simple example of a Model class is shown next:   &lt;br /&gt;&lt;/p&gt;  &lt;pre class="code"&gt;&lt;span style="color: blue"&gt;public class &lt;/span&gt;&lt;span style="color: #2b91af"&gt;Person
&lt;/span&gt;{
    &lt;span style="color: blue"&gt;public string &lt;/span&gt;FirstName { &lt;span style="color: blue"&gt;get&lt;/span&gt;;&lt;span style="color: blue"&gt;set&lt;/span&gt;;}
    &lt;span style="color: blue"&gt;public string &lt;/span&gt;LastName { &lt;span style="color: blue"&gt;get&lt;/span&gt;;&lt;span style="color: blue"&gt;set&lt;/span&gt;; }
    &lt;span style="color: blue"&gt;public int &lt;/span&gt;Age { &lt;span style="color: blue"&gt;get&lt;/span&gt;; &lt;span style="color: blue"&gt;set&lt;/span&gt;; }
}&lt;/pre&gt;
&lt;a href="http://11011.net/software/vspaste"&gt;&lt;/a&gt;

&lt;p&gt;&amp;#160;&lt;/p&gt;

&lt;p&gt;Once the Model classes are in place they'll need to be populated with data from a data store which can be done by writing custom code or using ORM frameworks that handle mapping query results to object instances. Services will also need to be written to expose one or more of the Model classes used in a Silverlight application which can be done using WCF, ASMX or even custom REST services.
  &lt;br /&gt;&lt;/p&gt;

&lt;h3&gt;The View and ViewModel Classes&lt;/h3&gt;

&lt;p&gt;Once the Model is ready to go the View and ViewModel classes can be created. As mentioned earlier, a View represents a Silverlight screen that end users interact with which includes the XAML file and the associated code-beside file. Rather than adding all of the code to call the Model and retrieve data directly into the View's code-beside file, the View will rely on a ViewModel class to retrieve data and then bind to the properties of the ViewModel.&lt;/p&gt;

&lt;p&gt;ViewModel classes should implement an interface that's available in Silverlight called INotifyPropertyChanged which defines a single event named PropertyChanged. This event is used to notify different Silverlight bindings that data has changed for one or more properties so that controls can be updated automatically. Although INotifyPropertyChanged can be implemented directly on a ViewModel class, your application may have multiple ViewModel classes in it and writing the same code over and over tends to get old. Creating a base ViewModel class that handles implementing INotifyPropertyChanged is useful to minimize code and allow more re-use to occur in applications. The following code shows a class named ViewModelBase that implements the INotifyPropertyChanged interface. The class also provides an OnNotifyPropertyChanged method that can be used to raise the PropertyChanged event.
  &lt;br /&gt;&lt;/p&gt;

&lt;pre class="code"&gt;&lt;span style="color: blue"&gt;public class &lt;/span&gt;&lt;span style="color: #2b91af"&gt;ViewModelBase &lt;/span&gt;: &lt;span style="color: #2b91af"&gt;INotifyPropertyChanged
&lt;/span&gt;{
    &lt;span style="color: blue"&gt;protected void &lt;/span&gt;OnNotifyPropertyChanged(&lt;span style="color: blue"&gt;string &lt;/span&gt;p)
    {
        &lt;span style="color: blue"&gt;if &lt;/span&gt;(PropertyChanged != &lt;span style="color: blue"&gt;null&lt;/span&gt;)
        {
            PropertyChanged(&lt;span style="color: blue"&gt;this&lt;/span&gt;, &lt;span style="color: blue"&gt;new &lt;/span&gt;&lt;span style="color: #2b91af"&gt;PropertyChangedEventArgs&lt;/span&gt;(p));
        }
    }

    &lt;span style="color: blue"&gt;public bool &lt;/span&gt;IsDesignTime
    {
        &lt;span style="color: blue"&gt;get
        &lt;/span&gt;{
            &lt;span style="color: blue"&gt;return &lt;/span&gt;(&lt;span style="color: #2b91af"&gt;Application&lt;/span&gt;.Current == &lt;span style="color: blue"&gt;null&lt;/span&gt;) || (&lt;span style="color: #2b91af"&gt;Application&lt;/span&gt;.Current.GetType() == &lt;span style="color: blue"&gt;typeof&lt;/span&gt;(&lt;span style="color: #2b91af"&gt;Application&lt;/span&gt;));
        }
    }

    &lt;span style="color: blue"&gt;#region &lt;/span&gt;INotifyPropertyChanged Members

    &lt;span style="color: blue"&gt;public event &lt;/span&gt;&lt;span style="color: #2b91af"&gt;PropertyChangedEventHandler &lt;/span&gt;PropertyChanged;

    &lt;span style="color: blue"&gt;#endregion
&lt;/span&gt;}&lt;/pre&gt;
&lt;a href="http://11011.net/software/vspaste"&gt;&lt;/a&gt;

&lt;p&gt;&amp;#160;&lt;/p&gt;

&lt;p&gt;A ViewModel class can derive from ViewModelBase and automatically take advantage of the INotifyPropertyChanged interface. An example of a ViewModel class named PeopleViewModel that derives from the ViewModelBase class and defines several properties and methods is shown next:
  &lt;br /&gt;&lt;/p&gt;

&lt;pre class="code"&gt;&lt;span style="color: blue"&gt;public class &lt;/span&gt;&lt;span style="color: #2b91af"&gt;PeopleViewModel &lt;/span&gt;: &lt;span style="color: #2b91af"&gt;ViewModelBase
&lt;/span&gt;{
    &lt;span style="color: #2b91af"&gt;IServiceAgent &lt;/span&gt;_ServiceAgent;
    &lt;span style="color: #2b91af"&gt;Person &lt;/span&gt;_Person;
    &lt;span style="color: #2b91af"&gt;ObservableCollection&lt;/span&gt;&amp;lt;&lt;span style="color: #2b91af"&gt;Person&lt;/span&gt;&amp;gt; _People;

    &lt;span style="color: blue"&gt;public &lt;/span&gt;PeopleViewModel() : &lt;span style="color: blue"&gt;this&lt;/span&gt;(&lt;span style="color: blue"&gt;new &lt;/span&gt;&lt;span style="color: #2b91af"&gt;ServiceAgent&lt;/span&gt;()) {}

    &lt;span style="color: blue"&gt;public &lt;/span&gt;PeopleViewModel(&lt;span style="color: #2b91af"&gt;IServiceAgent &lt;/span&gt;serviceAgent)
    {
        &lt;span style="color: blue"&gt;if &lt;/span&gt;(!IsDesignTime)
        {
            _ServiceAgent = serviceAgent;
            GetPeople();
        }
    }

    &lt;span style="color: blue"&gt;#region &lt;/span&gt;Properties

    &lt;span style="color: blue"&gt;public &lt;/span&gt;&lt;span style="color: #2b91af"&gt;Person &lt;/span&gt;Person
    {
        &lt;span style="color: blue"&gt;get
        &lt;/span&gt;{
            &lt;span style="color: blue"&gt;return &lt;/span&gt;_Person;
        }
        &lt;span style="color: blue"&gt;set
        &lt;/span&gt;{
            &lt;span style="color: blue"&gt;if &lt;/span&gt;(_Person != &lt;span style="color: blue"&gt;value&lt;/span&gt;)
            {
                _Person = &lt;span style="color: blue"&gt;value&lt;/span&gt;;
                OnNotifyPropertyChanged(&lt;span style="color: #a31515"&gt;&amp;quot;Person&amp;quot;&lt;/span&gt;);
            }
        }
    }

    &lt;span style="color: blue"&gt;public &lt;/span&gt;&lt;span style="color: #2b91af"&gt;ObservableCollection&lt;/span&gt;&amp;lt;&lt;span style="color: #2b91af"&gt;Person&lt;/span&gt;&amp;gt; People {
        &lt;span style="color: blue"&gt;get
        &lt;/span&gt;{
            &lt;span style="color: blue"&gt;return &lt;/span&gt;_People;
        }
        &lt;span style="color: blue"&gt;set
        &lt;/span&gt;{
            &lt;span style="color: blue"&gt;if &lt;/span&gt;(_People != &lt;span style="color: blue"&gt;value&lt;/span&gt;)
            {
                _People = &lt;span style="color: blue"&gt;value&lt;/span&gt;;
                OnNotifyPropertyChanged(&lt;span style="color: #a31515"&gt;&amp;quot;People&amp;quot;&lt;/span&gt;);
            }
        }

    }

    &lt;span style="color: blue"&gt;#endregion        
    
    public void &lt;/span&gt;GetPeople()
    {
        _ServiceAgent.GetPeople((s,e) =&amp;gt; &lt;span style="color: blue"&gt;this&lt;/span&gt;.People = e.Result);
    }

    &lt;span style="color: blue"&gt;public void &lt;/span&gt;UpdatePerson()
    {
        _ServiceAgent.UpdatePerson(&lt;span style="color: blue"&gt;this&lt;/span&gt;.Person, (s, e) =&amp;gt;
        {
            &lt;span style="color: #2b91af"&gt;PeopleEventBus&lt;/span&gt;.OnOperationCompleted(&lt;span style="color: blue"&gt;this&lt;/span&gt;, &lt;span style="color: blue"&gt;new &lt;/span&gt;&lt;span style="color: #2b91af"&gt;OperationCompletedEventArgs &lt;/span&gt;{ OperationStatus = e.Result });
        });
    }
}&lt;/pre&gt;
&lt;a href="http://11011.net/software/vspaste"&gt;&lt;/a&gt;

&lt;p&gt;
  &lt;br /&gt;Looking through the code you'll see that PeopleViewModel defines two fields, two properties and two methods. Each property raises the PropertyChanged event as the set block is called by calling the OnNotifyPropertyChanged method defined in ViewModelBase. This notifies any controls bound to the properties that the values have changed which allows them to update the data they display automatically.&amp;#160; &lt;/p&gt;

&lt;p&gt;Looking at the first constructor in PeopleViewModel you'll see that it forwards the call to a secondary constructor that accepts a parameter of type IServiceAgent. Why have two constructors? This approach allows testing frameworks to pass in different types of service agents to the ViewModel when running tests. When the ViewModel is called at runtime the parameterless constructor will be called and an instance of a ServiceAgent class (shown next) will be passed as the IServiceAgent parameter. From there, once the service agent object is passed into the ViewModel's constructor a call to a method named GetPeople is made which invokes a method on the service agent and passes a callback delegate. The WCF service is then called by the service agent and the results are assigned to the People property. &lt;/p&gt;

&lt;p&gt;&amp;#160;&lt;/p&gt;

&lt;pre class="code"&gt;&lt;span style="color: blue"&gt;public interface &lt;/span&gt;&lt;span style="color: #2b91af"&gt;IServiceAgent
&lt;/span&gt;{
    &lt;span style="color: blue"&gt;void &lt;/span&gt;GetPeople(&lt;span style="color: #2b91af"&gt;EventHandler&lt;/span&gt;&amp;lt;&lt;span style="color: #2b91af"&gt;GetPeopleCompletedEventArgs&lt;/span&gt;&amp;gt; callback);
    &lt;span style="color: blue"&gt;void &lt;/span&gt;UpdatePerson(&lt;span style="color: #2b91af"&gt;Person &lt;/span&gt;p, &lt;span style="color: #2b91af"&gt;EventHandler&lt;/span&gt;&amp;lt;&lt;span style="color: #2b91af"&gt;UpdatePersonCompletedEventArgs&lt;/span&gt;&amp;gt; callback);
}

&lt;span style="color: blue"&gt;public class &lt;/span&gt;&lt;span style="color: #2b91af"&gt;ServiceAgent &lt;/span&gt;: &lt;span style="color: #2b91af"&gt;IServiceAgent
&lt;/span&gt;{
    &lt;span style="color: blue"&gt;public void &lt;/span&gt;GetPeople(&lt;span style="color: #2b91af"&gt;EventHandler&lt;/span&gt;&amp;lt;&lt;span style="color: #2b91af"&gt;GetPeopleCompletedEventArgs&lt;/span&gt;&amp;gt; callback)
    {
        &lt;span style="color: #2b91af"&gt;PeopleServiceClient &lt;/span&gt;proxy = &lt;span style="color: blue"&gt;new &lt;/span&gt;&lt;span style="color: #2b91af"&gt;PeopleServiceClient&lt;/span&gt;();
        proxy.GetPeopleCompleted += callback;
        proxy.GetPeopleAsync();
    }

    &lt;span style="color: blue"&gt;public void &lt;/span&gt;UpdatePerson(&lt;span style="color: #2b91af"&gt;Person &lt;/span&gt;p, &lt;span style="color: #2b91af"&gt;EventHandler&lt;/span&gt;&amp;lt;&lt;span style="color: #2b91af"&gt;UpdatePersonCompletedEventArgs&lt;/span&gt;&amp;gt; callback)
    {
        &lt;span style="color: #2b91af"&gt;PeopleServiceClient &lt;/span&gt;proxy = &lt;span style="color: blue"&gt;new &lt;/span&gt;&lt;span style="color: #2b91af"&gt;PeopleServiceClient&lt;/span&gt;();
        proxy.UpdatePersonCompleted += callback;
        proxy.UpdatePersonAsync(p);
    }
}&lt;/pre&gt;
&lt;a href="http://11011.net/software/vspaste"&gt;&lt;/a&gt;

&lt;p&gt;&amp;#160;&lt;/p&gt;

&lt;h3&gt;&lt;strong&gt;Binding a ViewModel to a View&lt;/strong&gt;&lt;/h3&gt;

&lt;p&gt;Now that the ViewModel class is defined it can be bound to a View. This can be done declaratively in XAML or imperatively through code in the View's code-beside file. Imperative (or code-based) binding is typically accomplished by assigning a ViewModel instance to the layout root's DataContext property as shown next:
  &lt;br /&gt;&lt;/p&gt;

&lt;p&gt;&lt;font face="Courier New"&gt;this.LayoutRoot.DataContext = new PeopleViewModel();
    &lt;br /&gt;&lt;/font&gt;&lt;/p&gt;

&lt;p&gt;An example of declaratively binding a ViewModel (which is my personal preference) to a View is shown next:
  &lt;br /&gt;&lt;/p&gt;

&lt;pre class="code"&gt;&lt;span style="color: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;UserControl &lt;/span&gt;&lt;span style="color: red"&gt;x&lt;/span&gt;&lt;span style="color: blue"&gt;:&lt;/span&gt;&lt;span style="color: red"&gt;Class&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;ViewModelExample.MainPage&amp;quot;
    &lt;/span&gt;&lt;span style="color: red"&gt;xmlns&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;http://schemas.microsoft.com/winfx/2006/xaml/presentation&amp;quot; 
    &lt;/span&gt;&lt;span style="color: red"&gt;xmlns&lt;/span&gt;&lt;span style="color: blue"&gt;:&lt;/span&gt;&lt;span style="color: red"&gt;x&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;http://schemas.microsoft.com/winfx/2006/xaml&amp;quot;
    &lt;/span&gt;&lt;span style="color: red"&gt;xmlns&lt;/span&gt;&lt;span style="color: blue"&gt;:&lt;/span&gt;&lt;span style="color: red"&gt;d&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;http://schemas.microsoft.com/expression/blend/2008&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;xmlns&lt;/span&gt;&lt;span style="color: blue"&gt;:&lt;/span&gt;&lt;span style="color: red"&gt;mc&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;http://schemas.openxmlformats.org/markup-compatibility/2006&amp;quot; 
    &lt;/span&gt;&lt;span style="color: red"&gt;xmlns&lt;/span&gt;&lt;span style="color: blue"&gt;:&lt;/span&gt;&lt;span style="color: red"&gt;converter&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;clr-namespace:ViewModelExample&amp;quot;
    &lt;/span&gt;&lt;strong&gt;&lt;span style="color: red"&gt;xmlns&lt;/span&gt;&lt;span style="color: blue"&gt;:&lt;/span&gt;&lt;span style="color: red"&gt;viewModel&lt;/span&gt;&lt;/strong&gt;&lt;span style="color: blue"&gt;&lt;strong&gt;=&amp;quot;clr-namespace:ViewModelExample.ViewModel&amp;quot;&lt;/strong&gt;
    &lt;/span&gt;&lt;span style="color: red"&gt;mc&lt;/span&gt;&lt;span style="color: blue"&gt;:&lt;/span&gt;&lt;span style="color: red"&gt;Ignorable&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;d&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;d&lt;/span&gt;&lt;span style="color: blue"&gt;:&lt;/span&gt;&lt;span style="color: red"&gt;DesignWidth&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;640&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;d&lt;/span&gt;&lt;span style="color: blue"&gt;:&lt;/span&gt;&lt;span style="color: red"&gt;DesignHeight&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;480&amp;quot;&amp;gt;
    &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;UserControl.Resources&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;
        &lt;strong&gt;&amp;lt;&lt;/strong&gt;&lt;/span&gt;&lt;strong&gt;&lt;span style="color: #a31515"&gt;viewModel&lt;/span&gt;&lt;span style="color: blue"&gt;:&lt;/span&gt;&lt;span style="color: #a31515"&gt;PeopleViewModel &lt;/span&gt;&lt;span style="color: red"&gt;x&lt;/span&gt;&lt;span style="color: blue"&gt;:&lt;/span&gt;&lt;span style="color: red"&gt;Key&lt;/span&gt;&lt;/strong&gt;&lt;span style="color: blue"&gt;&lt;strong&gt;=&amp;quot;ViewModel&amp;quot; /&amp;gt;&lt;/strong&gt;
    &amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;UserControl.Resources&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;
    &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;Grid &lt;/span&gt;&lt;span style="color: red"&gt;x&lt;/span&gt;&lt;span style="color: blue"&gt;:&lt;/span&gt;&lt;span style="color: red"&gt;Name&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;LayoutRoot&amp;quot; &lt;/span&gt;&lt;strong&gt;&lt;span style="color: red"&gt;DataContext&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;{&lt;/span&gt;&lt;span style="color: #a31515"&gt;Binding &lt;/span&gt;&lt;span style="color: red"&gt;Source&lt;/span&gt;&lt;span style="color: blue"&gt;={&lt;/span&gt;&lt;span style="color: #a31515"&gt;StaticResource &lt;/span&gt;&lt;span style="color: red"&gt;ViewModel&lt;/span&gt;&lt;/strong&gt;&lt;span style="color: blue"&gt;&lt;strong&gt;}}&amp;quot;&lt;/strong&gt;&amp;gt;
&lt;/span&gt;&lt;span style="color: blue"&gt;    &amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;Grid&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;
&amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;UserControl&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;a href="http://11011.net/software/vspaste"&gt;&lt;/a&gt;

&lt;p&gt;&amp;#160;&lt;/p&gt;

&lt;p&gt;The ViewModel namespace is first referenced using an XML namespace prefix of &amp;quot;viewModel&amp;quot;. The ViewModel is then defined in the UserControl's Resources section and given a key of &amp;quot;ViewModel&amp;quot; (note that any name can be chosen for the key). The key is important since it's used to hook the ViewModel to the DataContext of the layout root using the {Binding Source={StaticResource ViewModel}} syntax. The declarative binding will cause a new PeopleViewModel instance to be created at runtime which is then bound to the layout root's DataContext. Child controls of the layout root can then bind to properties on the ViewModel. An example of binding a ListBox to the ViewModel's People property and a StackPanel to the Person property is shown next:
  &lt;br /&gt;&lt;/p&gt;

&lt;pre class="code"&gt;&lt;span style="color: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;StackPanel &lt;/span&gt;&lt;span style="color: red"&gt;Margin&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;20&amp;quot;&amp;gt;
    &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;TextBlock &lt;/span&gt;&lt;span style="color: red"&gt;Text&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;Binding Controls to a ViewModel&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;Margin&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;20,0,0,0&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;FontWeight&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;Bold&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;FontSize&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;12&amp;quot; /&amp;gt;
        &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;ListBox &lt;/span&gt;&lt;span style="color: red"&gt;x&lt;/span&gt;&lt;span style="color: blue"&gt;:&lt;/span&gt;&lt;span style="color: red"&gt;Name&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;lbPeople&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;Margin&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;0,10,0,0&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;Height&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;250&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;Width&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;300&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;HorizontalAlignment&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;Left&amp;quot;
                 &lt;/span&gt;&lt;strong&gt;&lt;span style="color: red"&gt;ItemsSource&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;{&lt;/span&gt;&lt;span style="color: #a31515"&gt;Binding &lt;/span&gt;&lt;span style="color: red"&gt;People&lt;/span&gt;&lt;/strong&gt;&lt;span style="color: blue"&gt;&lt;strong&gt;}&amp;quot;&lt;/strong&gt; &lt;/span&gt;&lt;span style="color: red"&gt;ScrollViewer.HorizontalScrollBarVisibility&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;Hidden&amp;quot;
                 &lt;/span&gt;&lt;strong&gt;&lt;span style="color: red"&gt;SelectedItem&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;{&lt;/span&gt;&lt;span style="color: #a31515"&gt;Binding &lt;/span&gt;&lt;span style="color: red"&gt;Person&lt;/span&gt;&lt;span style="color: blue"&gt;, &lt;/span&gt;&lt;span style="color: red"&gt;Mode&lt;/span&gt;&lt;/strong&gt;&lt;span style="color: blue"&gt;&lt;strong&gt;=TwoWay}&amp;quot;&lt;/strong&gt;&amp;gt;
            &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;ListBox.ItemTemplate&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;
                &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;DataTemplate&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;
                    &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;Grid&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;
                        &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;Grid.ColumnDefinitions&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;
                            &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;ColumnDefinition &lt;/span&gt;&lt;span style="color: red"&gt;Width&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;100&amp;quot; /&amp;gt;
                            &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;ColumnDefinition &lt;/span&gt;&lt;span style="color: red"&gt;Width&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;100&amp;quot; /&amp;gt;
                            &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;ColumnDefinition &lt;/span&gt;&lt;span style="color: red"&gt;Width&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;100&amp;quot; /&amp;gt;
                        &amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;Grid.ColumnDefinitions&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;
                        &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;TextBlock &lt;/span&gt;&lt;span style="color: red"&gt;Grid.Column&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;0&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;Margin&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;10&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;Text&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;{&lt;/span&gt;&lt;span style="color: #a31515"&gt;Binding &lt;/span&gt;&lt;span style="color: red"&gt;FirstName&lt;/span&gt;&lt;span style="color: blue"&gt;}&amp;quot; /&amp;gt;
                        &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;TextBlock &lt;/span&gt;&lt;span style="color: red"&gt;Grid.Column&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;1&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;Margin&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;10&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;Text&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;{&lt;/span&gt;&lt;span style="color: #a31515"&gt;Binding &lt;/span&gt;&lt;span style="color: red"&gt;LastName&lt;/span&gt;&lt;span style="color: blue"&gt;}&amp;quot; /&amp;gt;
                        &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;TextBlock &lt;/span&gt;&lt;span style="color: red"&gt;Grid.Column&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;2&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;Margin&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;10&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;Text&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;{&lt;/span&gt;&lt;span style="color: #a31515"&gt;Binding &lt;/span&gt;&lt;span style="color: red"&gt;Age&lt;/span&gt;&lt;span style="color: blue"&gt;}&amp;quot; /&amp;gt;
                    &amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;Grid&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;
                &amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;DataTemplate&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;
            &amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;ListBox.ItemTemplate&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;
        &amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;ListBox&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;
        &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;StackPanel &lt;/span&gt;&lt;strong&gt;&lt;span style="color: red"&gt;DataContext&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;{&lt;/span&gt;&lt;span style="color: #a31515"&gt;Binding &lt;/span&gt;&lt;span style="color: red"&gt;Person&lt;/span&gt;&lt;/strong&gt;&lt;span style="color: blue"&gt;&lt;strong&gt;}&amp;quot;&lt;/strong&gt;&amp;gt;
            &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;TextBlock &lt;/span&gt;&lt;span style="color: red"&gt;Text&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;First Name&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;Margin&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;0,10,0,0&amp;quot; /&amp;gt;
            &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;TextBox &lt;/span&gt;&lt;span style="color: red"&gt;Text&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;{&lt;/span&gt;&lt;span style="color: #a31515"&gt;Binding &lt;/span&gt;&lt;span style="color: red"&gt;FirstName&lt;/span&gt;&lt;span style="color: blue"&gt;,&lt;/span&gt;&lt;span style="color: red"&gt;Mode&lt;/span&gt;&lt;span style="color: blue"&gt;=TwoWay}&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;Width&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;100&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;Height&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;25&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;HorizontalAlignment&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;Left&amp;quot;/&amp;gt;
            &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;TextBlock &lt;/span&gt;&lt;span style="color: red"&gt;Text&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;Last Name&amp;quot; /&amp;gt;
            &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;TextBox &lt;/span&gt;&lt;span style="color: red"&gt;Text&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;{&lt;/span&gt;&lt;span style="color: #a31515"&gt;Binding &lt;/span&gt;&lt;span style="color: red"&gt;LastName&lt;/span&gt;&lt;span style="color: blue"&gt;,&lt;/span&gt;&lt;span style="color: red"&gt;Mode&lt;/span&gt;&lt;span style="color: blue"&gt;=TwoWay}&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;Width&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;100&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;Height&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;25&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;HorizontalAlignment&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;Left&amp;quot;/&amp;gt;
            &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;TextBlock &lt;/span&gt;&lt;span style="color: red"&gt;Text&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;Age&amp;quot; /&amp;gt;
            &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;TextBox &lt;/span&gt;&lt;span style="color: red"&gt;Text&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;{&lt;/span&gt;&lt;span style="color: #a31515"&gt;Binding &lt;/span&gt;&lt;span style="color: red"&gt;Age&lt;/span&gt;&lt;span style="color: blue"&gt;,&lt;/span&gt;&lt;span style="color: red"&gt;Mode&lt;/span&gt;&lt;span style="color: blue"&gt;=TwoWay}&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;Width&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;100&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;Height&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;25&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;HorizontalAlignment&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;Left&amp;quot;/&amp;gt;
        &amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;StackPanel&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;
        &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;Button &lt;/span&gt;&lt;span style="color: red"&gt;Margin&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;0,10,0,0&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;Click&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;Button_Click&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;Content&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;Submit&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;Height&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;20&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;Width&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;100&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;HorizontalAlignment&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;Left&amp;quot; /&amp;gt;
&amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;StackPanel&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;a href="http://11011.net/software/vspaste"&gt;&lt;/a&gt;

&lt;p&gt;&amp;#160;&lt;/p&gt;

&lt;p&gt;The MVVM pattern provides a flexible way to work with data that encourages code re-use and simplifies maintenance. There's much more that can be discussed with regard to the MVVM pattern in Silverlight such as event buses, commanding and dependency injection but I hope this post helps jumpstart the process of architecting and developing Silverlight applications. If you have specific Silverlight development concepts you'd like to see covered in future posts tweet me at &lt;a href="http://www.twitter.com/danwahlin" target="_blank"&gt;@DanWahlin&lt;/a&gt; or add a comment below.&lt;/p&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=7274398" width="1" height="1"&gt;</description><category domain="http://weblogs.asp.net/dwahlin/archive/tags/C_2300_/default.aspx">C#</category><category domain="http://weblogs.asp.net/dwahlin/archive/tags/Silverlight/default.aspx">Silverlight</category><category domain="http://weblogs.asp.net/dwahlin/archive/tags/Architecture/default.aspx">Architecture</category><category domain="http://weblogs.asp.net/dwahlin/archive/tags/MVVM/default.aspx">MVVM</category></item><item><title>ClubStartKit is Reborn… With a new release</title><link>http://weblogs.asp.net/zowens/archive/2009/12/09/clubstartkit-is-reborn-with-a-new-release.aspx</link><pubDate>Wed, 09 Dec 2009 06:07:00 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:7274352</guid><dc:creator>zowens</dc:creator><author>zowens</author><slash:comments>1</slash:comments><description>
&lt;p&gt;The title says it all. That’s right, I’m back on ClubStarterKit. I’ve tried to assure the CSK community in past blog posts that it isn’t dead. In the last year, I’ve done a lot of thinking and outside programming. I’m FINALLY in a position where I have really progressed in terms of project management skill and web design. Many of the opinions I held when I started the project have simply changed. I’ll detail some of those in a minute. &lt;/p&gt;
  
&lt;p&gt;&lt;a href="http://clubstarterkit.codeplex.com/Release/ProjectReleases.aspx?ReleaseId=36375" mce_href="http://clubstarterkit.codeplex.com/Release/ProjectReleases.aspx?ReleaseId=36375" target="_blank"&gt;Here’s a link to the new release.&lt;/a&gt;&lt;/p&gt;
  
&lt;p&gt;Open source software is really tricky, especially for someone who has to go to school and keep up with the day job. It’s simply TOO MUCH for someone else to demand so much on a person. However, demanding open source work onto yourself is highly rewarding. That’s why I’m back. &lt;/p&gt;
  &lt;h2&gt;Why the time off?&lt;/h2&gt;  
&lt;p&gt;Well, I simply had to build my &lt;a href="http://www.eagleenvision.net" mce_href="http://www.eagleenvision.net" target="_blank"&gt;business&lt;/a&gt;. Ultimately, that takes a lot more priority over any other open source work. As harsh as that is, I simply had too much going on. Also, I was in a bit of a rut with CSK. &lt;/p&gt;
  
&lt;p&gt;The project started from a need by the community to extend the club starter kit originally started by Microsoft that shipped in the box as a starter kit with Visual Studio 2005. I found plenty of ways to extend the kit for myself and decided to share my extended version. It was a tool for beginners. My role was to share my knowledge of ASP.NET with everyone else.&lt;/p&gt;
  
&lt;p&gt;But there was a point where I was just copy and pasting and hacking the crap out of something that wasn’t mine and was written by a bunch of other people. I ripped a lot of things out, especially the data access. What I put in it’s place was a disaster as well, though. I simply didn’t have the forethought to imagine a site that was fully extensible. I simply put out something that was hacked and hacked and hacked. I didn’t put something out that EVERYONE could use, I put something out that EVERYONE had to figure out every little piece and extend. That’s simply irresponsible on my part. &lt;/p&gt;
  
&lt;p&gt;So I decided I needed to completely rewrite the thing. There was a point were I was sick and tired of writing VB. To me, it looks WAY too verbose. I couldn’t stand looking at it… and C# was my primary language at a point anyways, and still is.&lt;/p&gt;
  &lt;h2&gt;The big news&lt;/h2&gt;  
&lt;p&gt;Now I’m ready to come back. I finally have something that I put my stamp on. It’s MINE. I wrote it. There’s not a feeling in this world more satisfying for me than to say a piece of code is completely my creation. No hacks, no copy paste (ok, there’s a little… but at least I know what it does!) and certainly something I think everyone can use, whether it’s bits and pieces or the whole thing. &lt;/p&gt;
  &lt;h3&gt;What’s new!&lt;/h3&gt;  
&lt;p&gt;Well… for starters, it’s written entirely in C#! While I know some VB people are shivering in their boots, I plan on upgrading the web project to VB &lt;i&gt;if there is an apparent need from the community&lt;/i&gt;. I’m not here to waste my time converting something to VB if there’s not a need. C# is such an expressive language and it’s something every VB dev should at least TRY to look at. More on that down the line. &lt;/p&gt;
  
&lt;p&gt;Another big new thing is that it runs ASP.NET MVC, not classic web forms. I know that there is some serious turmoil out there over this subject, but it really is a much better way to create web applications in ASP.NET in my opinion. There’s not very much of a difference, as it turns out. It’s a very comfortable shift… more than I thought it would be. It makes applications much easier to understand, write, and test.&amp;nbsp; I can entertain comments, questions, and concerns by email over this. I’m willing to fight for this :) But really, MVC rocks. It’s simply amazing. &lt;/p&gt;
  
&lt;p&gt;I know it hasn’t been released yet, but this release will be targeting Visual Studio 2010 and the .NET Framework 4.0. There’s a lot of really cool new ASP.NET features that I think CSK would really benefit from. &lt;/p&gt;
  
&lt;p&gt;Now to the big thing that might just turn some people off… we’re primarily going to use NHibernate for data access. I plan on adding a few more providers (Subsonic would be the first to the list). I really started off with NHibernate as a learning experience. It’s a very complex, but WELL written data access solution. I’ve VERY pleased with the results. There’s a learning curve with NHibernate, to an extent. But NHibernate isn’t as hard for simple operations, like what CSK provides. I think I can go back to the fundamental part of CSK and provide some really good samples for people to learn from. NHibernate isn’t really all that hard as long as you have something to look at. Trust me, reading the documentation isn’t as glamorous as it sounds :). Hopefully I can abstract that away from the average CSK user. &lt;/p&gt;
  
&lt;p&gt;A huge reason for adding NHibernate as the primary data access point is because we can use it to generate our DB for us, often called “Domain Driven Design” (although we aren’t completely “DDD”). I can’t tell you how much trouble I’ve had with the SQL stuff in the past. If you start with your data model first, a tool like NHibernate or Subsonic will just generate all the DB code for you! For me, that’s HUGE! I hate having people say the new version broke their DB. That' hurts. Now we can just have the damn thing upgraded!&lt;/p&gt;
  
&lt;p&gt;Speaking of the DB… we will be starting from scratch on that too… sorry to say. I know plenty of people will be really disappointed by this. Just how it is. Hopefully from now on, we will have a better upgrade path. I hate breaking people’s compatibility simply because we release a new version. I’ll be assessing a possible upgrade path for those running v3 beta 1 and v2. But we shall see. This would be a GREAT contribution if someone in the community could code this out. &lt;/p&gt;
  
&lt;p&gt;The fact that we didn’t have a lot of tests in the last few versions proved we really didn’t have a great product. We just didn’t. That simple. I knew that this time, I needed to test EVERYTHING. While I don’t claim to be a TDD expert, I really tried to test first. I’ll detail contributions in a bit, but I can tell you, everything needs to have tests. While we’re a little light on tests right now, hopefully that will change as we get closer to v3. &lt;/p&gt;
  &lt;h2&gt;&lt;/h2&gt;  &lt;h2&gt;What’s taken out&lt;/h2&gt;  
&lt;p&gt;There was a serious outcry after v2 for a league management component. What happened in v3 Beta 1 was… interesting. I haven’t really seen anyone use it, and the feedback was mixed. So for this iteration, it’s not going to be a core part of the product. If there is a serious need, I think we (as in the community) should plan and implement an extension to CSK for league management stuff. &lt;/p&gt;
  
&lt;p&gt;League management was a really good idea, but I think the ideas some people had were just out of my scope. It’s something someone needs to write a spec for. I can’t just create what I think will fly. Just not something I’m willing to waste more of my time on. &lt;/p&gt;
  
&lt;p&gt;Also on my list of things taken out, I’ve finally decided to separate the logic of the application into separate projects. While the Visual Studio Express people might be upset, it really comes down to manageability of the project. If you create a large web application, it really defeats the purpose of expansibility. There are 6 main projects: Core, Infrastructure, Web, Data.NHibernate, Domain, and Tests. The core and infrastructure projects are meant to be distributed with ANY web project. It’s not CSK specific. So you can really use those as toolkits. It has some really good logic in it. I’d love to provide something that isn’t just for our little open source project. I will, however, be shipping a template with compiled versions of Domain, infrastructure, core, and Data.NHibernate. Hopefully that will help those who use express. We’ll see. I’d love to hear your feedback on this. &lt;/p&gt;
  
&lt;p&gt;   &lt;br&gt;&lt;/p&gt;
  &lt;h2&gt;Contributions&lt;/h2&gt;  
&lt;p&gt;In the past, I’ve said everyone can just contribute. That’s going to change. We’re starting with a whole new codebase that I wrote. Because of this, I think it’s time we started accepting patches rather than add contributors. We’ve had only a tiny bit of contribution in the past anyways. So here’s my decision. &lt;/p&gt;
  
&lt;p&gt;I’m going to take every contributor off the list. It’s a tough choice, but it has to be done. I will start to accept patches. These patches HAVE to contain tests. Once you’ve contributed in that way, I will then consider making you a contributor to the source repository. &lt;/p&gt;
  &lt;h2&gt;The release&lt;/h2&gt;  
&lt;p&gt;So I’ve told you wants new, and what not, but I didn’t say anything about a release. Today I am releasing the new codebase. I’m going to name this ClubStarterKit v3 preview. While I would love to call this v4, I think that not having a final v3 would be kind of strange. So this codebase will eventually become version 3. My plans from this point is to get feedback on what I have an release Version 3 &lt;b&gt;&lt;i&gt;&lt;u&gt;when it’s ready&lt;/u&gt;&lt;/i&gt;&lt;/b&gt;. No promises, no false hopes. It’ll be done when I say it’s done. In the mean time, you can &lt;a href="http://clubstarterkit.codeplex.com/Release/ProjectReleases.aspx?ReleaseId=36375" mce_href="http://clubstarterkit.codeplex.com/Release/ProjectReleases.aspx?ReleaseId=36375" target="_blank"&gt;download the preview here.&lt;/a&gt;&lt;/p&gt;
  &lt;h2&gt;&lt;/h2&gt;  &lt;h2&gt;A call to action&lt;/h2&gt;  
&lt;p&gt;I’ve done my thing. I’ve built what I thought you’d want. Now it’s YOUR turn to help me out. Tell me what you like, tell me what you don’t like, tell me what should be in there, tell me what the future of CSK looks like. I need your feedback. It’s the essential ingredient in any open source project. We need to pick up anew and make this a sustainable and polished project that we can call a community-driven project! &lt;/p&gt;
  
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
  
&lt;p&gt;As always, thank you for your support and contribution. We all can give each other a helping hand in learning to develop software. &lt;/p&gt;

&lt;br&gt;&lt;br&gt;
&lt;a href="http://www.dotnetkicks.com/kick/?url=http%3a%2f%2fweblogs.asp.net%2fzowens%2farchive%2f2009%2f12%2f09%2fclubstartkit-is-reborn-with-a-new-release.aspx"&gt;&lt;img src="http://www.dotnetkicks.com/Services/Images/KickItImageGenerator.ashx?url=http%3a%2f%2fweblogs.asp.net%2fzowens%2farchive%2f2009%2f12%2f09%2fclubstartkit-is-reborn-with-a-new-release.aspx" alt="kick it on DotNetKicks.com" border="0"&gt;&lt;/a&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=7274352" width="1" height="1"&gt;</description><category domain="http://weblogs.asp.net/zowens/archive/tags/.NET/default.aspx">.NET</category><category domain="http://weblogs.asp.net/zowens/archive/tags/C_2300_/default.aspx">C#</category><category domain="http://weblogs.asp.net/zowens/archive/tags/Open+Source/default.aspx">Open Source</category><category domain="http://weblogs.asp.net/zowens/archive/tags/ASP.NET/default.aspx">ASP.NET</category><category domain="http://weblogs.asp.net/zowens/archive/tags/ClubStarterKit/default.aspx">ClubStarterKit</category><category domain="http://weblogs.asp.net/zowens/archive/tags/SubSonic/default.aspx">SubSonic</category><category domain="http://weblogs.asp.net/zowens/archive/tags/ASP.NET+MVC/default.aspx">ASP.NET MVC</category></item><item><title>Presentation: ASP.NET AJAX 4 at Inland Empire .NET User Group</title><link>http://weblogs.asp.net/craigshoemaker/archive/2009/12/08/presentation-asp-net-ajax-4-at-inland-empire-net-user-group.aspx</link><pubDate>Wed, 09 Dec 2009 02:30:00 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:7273889</guid><dc:creator>craigshoemaker</dc:creator><author>craigshoemaker</author><slash:comments>0</slash:comments><description>&lt;p&gt;Thanks to everyone who came to my ASP.NET AJAX 4 talk at the &lt;a href="http://www.iedotnetug.org" mce_href="http://www.iedotnetug.org"&gt;Inland Empire .NET User Group&lt;/a&gt;. Special thanks to &lt;a href="http://www.duringlunch.com/" mce_href="http://www.duringlunch.com/"&gt;James Johnson&lt;/a&gt; (&lt;a href="http://twitter.com/latringo" mce_href="http://twitter.com/latringo"&gt;@latringo&lt;/a&gt;) for organizing such a great group! &lt;/p&gt;&lt;p&gt;Here is the code download for the talk:&amp;nbsp; &lt;a href="http://polymorphicpodcast.com/code/2009-12-08/ieug/ASPNETClientTemplates.zip" mce_href="http://polymorphicpodcast.com/code/2009-12-08/ieug/ASPNETClientTemplates.zip"&gt;ASPNETClientTemplates.zip&lt;/a&gt;&lt;br&gt;&lt;/p&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=7273889" width="1" height="1"&gt;</description><category domain="http://weblogs.asp.net/craigshoemaker/archive/tags/ASP.NET/default.aspx">ASP.NET</category><category domain="http://weblogs.asp.net/craigshoemaker/archive/tags/AJAX/default.aspx">AJAX</category><category domain="http://weblogs.asp.net/craigshoemaker/archive/tags/Presentation/default.aspx">Presentation</category></item><item><title>Silverlight 4 Training in Montreal for Christmas!</title><link>http://weblogs.asp.net/lduveau/archive/2009/12/08/silverlight-4-training-in-montreal-for-christmas.aspx</link><pubDate>Wed, 09 Dec 2009 01:51:52 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:7274181</guid><dc:creator>pluginbaby</dc:creator><author>pluginbaby</author><slash:comments>4</slash:comments><description>&lt;p&gt;&lt;img title="formation silverlight montreal" border="0" alt="formation silverlight montreal" src="http://weblogs.asp.net/blogs/lduveau/silverlight_montreal_2CD068D8.jpg" width="520" height="345" /&gt;&lt;/p&gt;  &lt;p&gt;&lt;img title="formation silverlight montreal" border="0" alt="formation silverlight montreal" align="right" src="http://weblogs.asp.net/blogs/lduveau/ApprendreSilverlight_551F13F6.png" width="252" height="237" /&gt;This is your last chance to get a Silverlight training in Montreal this year…&lt;/p&gt;  &lt;p&gt;The &lt;a href="http://www.silverlight-tour.com/"&gt;Silverlight Tour&lt;/a&gt; will hit &lt;strong&gt;Montreal &lt;/strong&gt;just before Christmas, and already provide Silverlight 4 content!!! &lt;/p&gt;  &lt;li&gt;When: &lt;strong&gt;December 21-23&lt;/strong&gt;&lt;/li&gt;  &lt;li&gt;Where: &lt;strong&gt;Montreal, Qc&lt;/strong&gt;&lt;/li&gt;  &lt;li&gt;Price:&lt;strong&gt; 1165$&lt;/strong&gt;&lt;/li&gt;  &lt;li&gt;Registration (Fr): &lt;a href="http://www.runatserver.com/SilverlightTraining.aspx?lng=fr" target="_blank"&gt;http://www.runatserver.com/SilverlightTraining.aspx&lt;/a&gt;    &lt;p&gt;If you are looking for 3 days of intensive Silverlight training &lt;em&gt;in French&lt;/em&gt; this is your chance to learn it from soup to nuts!       &lt;br /&gt;While the labs will continue to be in Silverlight 3, the instructor will be using Visual Studio 2010 and Silverlight 4 to explain how the new features work and how they may impact how you architect your Silverlight solution. So the content cover &lt;strong&gt;all&lt;/strong&gt; Silverlight 3 features as well as Silverlight 4!&lt;/p&gt; &lt;/li&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:e09aa926-4990-4ca0-987a-8465c45c05c1" class="wlWriterEditableSmartContent"&gt;Technorati Tags: &lt;a href="http://technorati.com/tags/Silverlight" rel="tag"&gt;Silverlight&lt;/a&gt;&lt;/div&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=7274181" width="1" height="1"&gt;</description><category domain="http://weblogs.asp.net/lduveau/archive/tags/Community+News/default.aspx">Community News</category><category domain="http://weblogs.asp.net/lduveau/archive/tags/Speaking/default.aspx">Speaking</category><category domain="http://weblogs.asp.net/lduveau/archive/tags/Montreal/default.aspx">Montreal</category><category domain="http://weblogs.asp.net/lduveau/archive/tags/Silverlight/default.aspx">Silverlight</category><category domain="http://weblogs.asp.net/lduveau/archive/tags/RunAtServer/default.aspx">RunAtServer</category></item><item><title>Handle the button click event from an ASP.NET ListView control</title><link>http://weblogs.asp.net/jeffwids/archive/2009/12/08/handle-the-button-click-event-from-an-asp-net-listview-control.aspx</link><pubDate>Tue, 08 Dec 2009 20:48:53 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:7273986</guid><dc:creator>Jeff Widmer</dc:creator><author>Jeff Widmer</author><slash:comments>0</slash:comments><description>&lt;p&gt;Here is how you can handle the event of a button from within an ASP.NET ListView control.&lt;/p&gt;  &lt;p&gt;Add your button to the ListView Template like you would any other control:&lt;/p&gt;  &lt;p&gt;&lt;font face="Courier New"&gt;&amp;lt;asp:ListView ItemPlaceholderID=&amp;quot;Test&amp;quot; runat=&amp;quot;server&amp;quot; ID=&amp;quot;ListView1&amp;quot; &amp;gt;     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; &amp;lt;ItemTemplate&amp;gt;      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;asp:Button runat=&amp;quot;server&amp;quot; Text='&amp;lt;%# Eval(&amp;quot;MyProperty&amp;quot;) %&amp;gt;' CommandArgument='&amp;lt;%# Eval(&amp;quot;MyProperty&amp;quot;) %&amp;gt;' /&amp;gt;&amp;lt;br /&amp;gt;      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; &amp;lt;/ItemTemplate&amp;gt;      &lt;br /&gt;&amp;lt;/asp:ListView&amp;gt;&lt;/font&gt; &lt;/p&gt;  &lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/jeffwids/image_59C4A7F4.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://weblogs.asp.net/blogs/jeffwids/image_thumb_31B1F8D5.png" width="550" height="86" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;And then handle the ListView.ItemCommand event in your code:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/jeffwids/image_62D13375.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://weblogs.asp.net/blogs/jeffwids/image_thumb_4890CA51.png" width="551" height="109" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;That is really all there is to it.&amp;#160; The ListView will bubble up the Button’s click event to the ListView_ItemCommand event handler and then you can handle it there.&amp;#160; You can also use the CommandArgument property to send button specific data, such as the particular ID of the row or item that the user clicked the button for.&lt;/p&gt;  &lt;p&gt;This call also be used on some of the other databound controls such as the ASP.NET Repeater.&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;&lt;u&gt;Full Example Code:&lt;/u&gt;&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;&lt;u&gt;ListViewButtonExample.aspx:&lt;/u&gt;&lt;/strong&gt;    &lt;br /&gt;&lt;font face="Courier New"&gt;&amp;lt;%@ Page Language=&amp;quot;C#&amp;quot; AutoEventWireup=&amp;quot;true&amp;quot; CodeBehind=&amp;quot;ListViewButtonExample.aspx.cs&amp;quot; Inherits=&amp;quot;ListViewButtonExample&amp;quot; %&amp;gt;     &lt;br /&gt;&amp;lt;html&amp;gt;      &lt;br /&gt;&amp;lt;body&amp;gt;      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; &amp;lt;form id=&amp;quot;form1&amp;quot; runat=&amp;quot;server&amp;quot;&amp;gt;      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; &amp;lt;div&amp;gt;      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;asp:ListView ItemPlaceholderID=&amp;quot;Test&amp;quot; runat=&amp;quot;server&amp;quot; ID=&amp;quot;ListView1&amp;quot; &amp;gt;      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;LayoutTemplate&amp;gt;      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;asp:Literal runat=&amp;quot;server&amp;quot; ID=&amp;quot;Test&amp;quot;&amp;gt;&amp;lt;/asp:Literal&amp;gt;      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;/LayoutTemplate&amp;gt;      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;ItemTemplate&amp;gt;      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;asp:Literal runat=&amp;quot;server&amp;quot; Text='&amp;lt;%# Eval(&amp;quot;MyProperty&amp;quot;) %&amp;gt;'&amp;gt;&amp;lt;/asp:Literal&amp;gt;      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;asp:Button runat=&amp;quot;server&amp;quot; Text='&amp;lt;%# Eval(&amp;quot;MyProperty&amp;quot;) %&amp;gt;' CommandArgument='&amp;lt;%# Eval(&amp;quot;MyProperty&amp;quot;) %&amp;gt;' /&amp;gt;&amp;lt;br /&amp;gt;      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;/ItemTemplate&amp;gt;      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;/asp:ListView&amp;gt;      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;asp:Literal runat=&amp;quot;server&amp;quot; ID=&amp;quot;Literal1&amp;quot;&amp;gt;&amp;lt;/asp:Literal&amp;gt;      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; &amp;lt;/div&amp;gt;      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; &amp;lt;/form&amp;gt;      &lt;br /&gt;&amp;lt;/body&amp;gt;      &lt;br /&gt;&amp;lt;/html&amp;gt;&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;&lt;u&gt;ListViewButtonExample.aspx.cs:&lt;/u&gt;&lt;/strong&gt;    &lt;br /&gt;&lt;font face="Courier New"&gt;using System.Linq;     &lt;br /&gt;using System.Web;      &lt;br /&gt;using System.Web.UI;      &lt;br /&gt;using System.Web.UI.WebControls;      &lt;br /&gt;using System.Web.Security;      &lt;br /&gt;using System.Collections; &lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font face="Courier New"&gt;public class MyObject     &lt;br /&gt;{      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; public String MyProperty { get; set; }      &lt;br /&gt;}      &lt;br /&gt;public partial class ListViewButtonExample : System.Web.UI.Page      &lt;br /&gt;{      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; protected void Page_Init(object sender, EventArgs e)      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; {      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; ListView1.ItemCommand += new EventHandler&amp;lt;ListViewCommandEventArgs&amp;gt;(ListView1_ItemCommand);      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; } &lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font face="Courier New"&gt;&amp;#160;&amp;#160;&amp;#160; void ListView1_ItemCommand(object sender, ListViewCommandEventArgs e)     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; {      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; Literal1.Text = &amp;quot;You clicked the &amp;quot; + (String)e.CommandArgument + &amp;quot; button&amp;quot;;      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; } &lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font face="Courier New"&gt;&amp;#160;&amp;#160;&amp;#160; protected void Page_Load(object sender, EventArgs e)     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; {      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; if (!Page.IsPostBack)      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; {      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; List&amp;lt;MyObject&amp;gt; col = new List&amp;lt;MyObject&amp;gt;();      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; col.Add(new MyObject { MyProperty = &amp;quot;test 1&amp;quot; });      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; col.Add(new MyObject { MyProperty = &amp;quot;test 2&amp;quot; });      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; ListView1.DataSource = col;      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; ListView1.DataBind();      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; }      &lt;br /&gt;}&lt;/font&gt; &lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:5261eca7-b879-43be-b216-8c740e8ce4f0" class="wlWriterSmartContent"&gt;Technorati Tags: &lt;a href="http://technorati.com/tags/ListView" rel="tag"&gt;ListView&lt;/a&gt;,&lt;a href="http://technorati.com/tags/ItemCommand+Event" rel="tag"&gt;ItemCommand Event&lt;/a&gt;&lt;/div&gt;&lt;div class="wlWriterHeaderFooter" style="margin:0px; padding:0px 0px 0px 0px;"&gt;&lt;br /&gt;&lt;br /&gt;&lt;script type="text/javascript"&gt;
tweetmeme_source = 'jeffwids';
&lt;/script&gt;
&lt;script type="text/javascript" src="http://tweetmeme.com/i/scripts/button.js"&gt;&lt;/script&gt;&lt;/div&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=7273986" width="1" height="1"&gt;</description><category domain="http://weblogs.asp.net/jeffwids/archive/tags/ASP.NET/default.aspx">ASP.NET</category><category domain="http://weblogs.asp.net/jeffwids/archive/tags/C_2300_/default.aspx">C#</category><category domain="http://weblogs.asp.net/jeffwids/archive/tags/ListView/default.aspx">ListView</category></item><item><title>Building Twitter Search using the ASP.NET Ajax Library Beta – Part II</title><link>http://www.jamessenior.com/post/Building-Twitter-Search-using-the-ASPNET-Ajax-Library-Beta-e28093-Part-II.aspx</link><pubDate>Tue, 08 Dec 2009 18:41:29 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:7273934</guid><dc:creator>Latest Microsoft Blogs</dc:creator><author>Latest Microsoft Blogs</author><slash:comments>0</slash:comments><description>In the first installment of this two-part series we explored how you can consume JSONP data sources using hardly any code thanks to the ASP.NET Ajax Library and the powerful networking stack that lies within.&amp;#160; This time around we’ll take a look at Read More......(&lt;a href="http://www.jamessenior.com/post/Building-Twitter-Search-using-the-ASPNET-Ajax-Library-Beta-e28093-Part-II.aspx"&gt;read more&lt;/a&gt;)&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=7273934" width="1" height="1"&gt;</description><category domain="http://weblogs.asp.net/aspnet-whatsnew/archive/tags/ASP.NET/default.aspx">ASP.NET</category><category domain="http://weblogs.asp.net/aspnet-whatsnew/archive/tags/Twitter/default.aspx">Twitter</category><category domain="http://weblogs.asp.net/aspnet-whatsnew/archive/tags/ASP.NET+Ajax+Library/default.aspx">ASP.NET Ajax Library</category></item><item><title>Silverlight 3 – How to access peripherals</title><link>http://weblogs.asp.net/cschittko/archive/2009/12/08/silverlight-3-how-to-access-peripherals.aspx</link><pubDate>Tue, 08 Dec 2009 17:27:00 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:7273891</guid><dc:creator>ChristophDotNet</dc:creator><author>ChristophDotNet</author><slash:comments>7</slash:comments><description>&lt;P&gt;The previous post on &lt;A title=http://weblogs.asp.net/cschittko/archive/2009/11/17/silverlight-3-for-kiosk-apps-of-course.aspx href="http://weblogs.asp.net/cschittko/archive/2009/11/17/silverlight-3-for-kiosk-apps-of-course.aspx" mce_href="http://weblogs.asp.net/cschittko/archive/2009/11/17/silverlight-3-for-kiosk-apps-of-course.aspx"&gt;Silverlight 3 for kiosk apps&lt;/A&gt; outlined some architecture options how you can build &lt;A href="http://www.silverlight.net/" mce_href="http://www.silverlight.net"&gt;Silverlight&lt;/A&gt; applications with access to peripherals. This follow up post goes into more detail on the implementation. &lt;/P&gt;
&lt;P&gt;I strongly encourage you to consider &lt;A href="http://windowsclient.net/" mce_href="http://windowsclient.net/"&gt;WPF&lt;/A&gt;, &lt;A href="http://msdn.microsoft.com/en-us/library/t71a733d(VS.80).aspx" mce_href="http://msdn.microsoft.com/en-us/library/t71a733d(VS.80).aspx"&gt;ClickOnce&lt;/A&gt; and &lt;A href="http://msdn.microsoft.com/en-us/library/ms828083(WinEmbedded.10).aspx" mce_href="http://msdn.microsoft.com/en-us/library/ms828083(WinEmbedded.10).aspx"&gt;POS for .NET&lt;/A&gt; as the foundation of your application before you go ahead building these types of applications. The major benefits of Silverlight are the small run-time and the cross-platform availability. Chances are that cross-platform is not necessary in a kiosk environment. The small runtime may not be a big advantage if you are deploying a local application, if you’re deploying, you may as well deploy the full .NET runtime. In fact, the lean runtime may be a disadvantage since it’s lacking functionality available in the .NET libraries. ClickOnce may provide similar benefits as a web deployment of Silverlight. &lt;/P&gt;
&lt;P&gt;Now … if you’re still reading, you probably determined that Silverlight is the way to go. &lt;/P&gt;
&lt;P&gt;The solution is based on several key features in Silverlight&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Hosting Silverlight in a custom container via the hosting API – introduced with Silverlight 1 &lt;/LI&gt;
&lt;LI&gt;Scripting Silverlight applications – introduced with Silverlight 1 &lt;/LI&gt;
&lt;LI&gt;Local messaging between Silverlight applications – even across different containers, first introduced with Silverlight 3 &lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;Let’s take a look how we can string these together to build a solution that maintains the integrity and protection of the Silverlight sandbox, but also let us get to local computing resources and maintains the benefits of Silverlight development and deployment.&lt;/P&gt;
&lt;P&gt;First, you can host Silverlight applications not only in a web browser, but also in a custom application container via the &lt;A href="http://msdn.microsoft.com/en-us/library/cc296246(VS.95).aspx" mce_href="http://msdn.microsoft.com/en-us/library/cc296246(VS.95).aspx"&gt;Hosting COM API&lt;/A&gt;. You’re in for a blast from the past since some experience with C++ and COM is definitely required to get this to work. There’s a sample for &lt;A href="http://code.msdn.microsoft.com/silverlightalthost" mce_href="http://code.msdn.microsoft.com/silverlightalthost"&gt;Silverlight Alternative Hosting&lt;/A&gt; on MSDN. You save yourself a lot of time and effort compared to implementing the various COM interfaces if you just download the sample and start from there.&lt;/P&gt;
&lt;H2&gt;Custom Silverlight Hosting&lt;/H2&gt;
&lt;P&gt;First, you decide how you’re going to load the Silverlight application in the custom container. You could load a .xap from the local disk, or you could local the .xap application over the web. Loading from a URL over the web preserves some of the deployment flexibilities of a browser app, but if you’re running an application without a network connection, loading the application from a http URL may not be an option.&lt;/P&gt;
&lt;P&gt;Loading a XAP from from a URL, either a &lt;A href="file:///" mce_href="file:///"&gt;file:///&lt;/A&gt; URL or an http:// URL will work. To load the Silverlight application, you pass the URL to the application as a named Source property in the PropertyBag during control activation (I didn’t think I would ever have to write about ActiveX control activation again). The TutorialXcpHost application from the MSDN sample makes this very easy. It includes a XcpControlHost helper class with the SetSource method. You call SetSource before activating the control:&lt;/P&gt;&lt;PRE&gt;&lt;PRE style="BACKGROUND-COLOR: #fbfbfb; MARGIN: 0em; WIDTH: 100%; FONT-FAMILY: consolas,'Courier New',courier,monospace; FONT-SIZE: 13px"&gt;&lt;SPAN style="COLOR: #0000ff"&gt;int&lt;/SPAN&gt; WINAPI _tWinMain(HINSTANCE, HINSTANCE, LPTSTR lpCmdLine, &lt;SPAN style="COLOR: #0000ff"&gt;int&lt;/SPAN&gt; nShowCmd) 
&lt;/PRE&gt;&lt;PRE style="BACKGROUND-COLOR: #ffffff; MARGIN: 0em; WIDTH: 100%; FONT-FAMILY: consolas,'Courier New',courier,monospace; FONT-SIZE: 13px"&gt;{  
&lt;/PRE&gt;&lt;PRE style="BACKGROUND-COLOR: #fbfbfb; MARGIN: 0em; WIDTH: 100%; FONT-FAMILY: consolas,'Courier New',courier,monospace; FONT-SIZE: 13px"&gt;   CXcpControlHost::SetSource(L"&lt;SPAN style="COLOR: #8b0000"&gt;http://localhost/AppsComms/ClientBin/SenderApp.xap&lt;/SPAN&gt;");
&lt;/PRE&gt;&lt;PRE style="BACKGROUND-COLOR: #ffffff; MARGIN: 0em; WIDTH: 100%; FONT-FAMILY: consolas,'Courier New',courier,monospace; FONT-SIZE: 13px"&gt;   &lt;SPAN style="COLOR: #0000ff"&gt;return&lt;/SPAN&gt; _AtlModule.WinMain(nShowCmd);
&lt;/PRE&gt;&lt;PRE style="BACKGROUND-COLOR: #fbfbfb; MARGIN: 0em; WIDTH: 100%; FONT-FAMILY: consolas,'Courier New',courier,monospace; FONT-SIZE: 13px"&gt;}&lt;/PRE&gt;&lt;/PRE&gt;
&lt;P&gt;Even when running in a custom host, Silverlight is still validating zones and enforces some cross-domain security. If you’re loading additional application data or resources, then base URL and zone (&lt;A href="file:///" mce_href="file:///"&gt;file:///&lt;/A&gt; or http://) need to match. You can play some trickery by implementing the container’s &lt;A href="http://msdn.microsoft.com/en-us/library/cc296246(VS.95).aspx#IXcpControlHost_GetBaseUrl" mce_href="http://msdn.microsoft.com/en-us/library/cc296246(VS.95).aspx#IXcpControlHost_GetBaseUrl"&gt;IXcpControlHost::GetBaseUrl()&lt;/A&gt; method to return a matching zone, but it’s safer to play by the rules and comply with Silverlight’s security policies. after all, they’ve been put in place for good reasons.&lt;/P&gt;
&lt;P&gt;So far, we can load a Silverlight application into a custom container, that provides more flexibility than a browser. For example, the custom container can communicate with other local resources or devices. Next we need to enable communication between the container and the Silverlight application.&lt;/P&gt;
&lt;H2&gt;Defining an interface from Silverlight to the Custom Container&lt;/H2&gt;
&lt;P&gt;A Silverlight application can expose an interface to scripting engines to allow integration with the host. For example the javascript engine in a browser can get and set properties of a Silverlight application and invoke methods exposed to script. The Silverlight piece of the code is very simple. &lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;You define a class that represents your scripting interface and mark the class with the &lt;A href="http://msdn.microsoft.com/en-us/library/system.windows.browser.scriptabletypeattribute(VS.95).aspx" mce_href="http://msdn.microsoft.com/en-us/library/system.windows.browser.scriptabletypeattribute(VS.95).aspx"&gt;[ScriptableType]&lt;/A&gt; attribute. &lt;BR&gt;&lt;PRE&gt;&lt;PRE style="BACKGROUND-COLOR: #fbfbfb; MARGIN: 0em; WIDTH: 100%; FONT-FAMILY: consolas,'Courier New',courier,monospace; FONT-SIZE: 13px"&gt;&lt;STRONG&gt;[ScriptableType]&lt;/STRONG&gt;
&lt;/PRE&gt;&lt;PRE style="BACKGROUND-COLOR: #ffffff; MARGIN: 0em; WIDTH: 100%; FONT-FAMILY: consolas,'Courier New',courier,monospace; FONT-SIZE: 13px"&gt;&lt;SPAN style="COLOR: #0000ff"&gt;public&lt;/SPAN&gt; &lt;SPAN style="COLOR: #0000ff"&gt;class&lt;/SPAN&gt; MyScriptableObject
&lt;/PRE&gt;&lt;PRE style="BACKGROUND-COLOR: #fbfbfb; MARGIN: 0em; WIDTH: 100%; FONT-FAMILY: consolas,'Courier New',courier,monospace; FONT-SIZE: 13px"&gt;{
&lt;/PRE&gt;&lt;PRE style="BACKGROUND-COLOR: #ffffff; MARGIN: 0em; WIDTH: 100%; FONT-FAMILY: consolas,'Courier New',courier,monospace; FONT-SIZE: 13px"&gt;&lt;SPAN style="COLOR: #008000"&gt;// ... &lt;/SPAN&gt;
&lt;/PRE&gt;&lt;PRE style="BACKGROUND-COLOR: #fbfbfb; MARGIN: 0em; WIDTH: 100%; FONT-FAMILY: consolas,'Courier New',courier,monospace; FONT-SIZE: 13px"&gt;}&lt;/PRE&gt;&lt;/PRE&gt;&lt;/LI&gt;
&lt;LI&gt;In that class, you mark methods you want to expose to the scripting engine with the &lt;A href="http://msdn.microsoft.com/en-us/library/system.windows.browser.scriptablememberattribute(VS.95).aspx" mce_href="http://msdn.microsoft.com/en-us/library/system.windows.browser.scriptablememberattribute(VS.95).aspx"&gt;[ScriptableMember]&lt;/A&gt; attribute. &lt;BR&gt;&lt;PRE&gt;&lt;PRE style="BACKGROUND-COLOR: #fbfbfb; MARGIN: 0em; WIDTH: 100%; FONT-FAMILY: consolas,'Courier New',courier,monospace; FONT-SIZE: 13px"&gt;&lt;STRONG&gt;[ScriptableMember]&lt;/STRONG&gt;
&lt;/PRE&gt;&lt;PRE style="BACKGROUND-COLOR: #ffffff; MARGIN: 0em; WIDTH: 100%; FONT-FAMILY: consolas,'Courier New',courier,monospace; FONT-SIZE: 13px"&gt;&lt;SPAN style="COLOR: #0000ff"&gt;public&lt;/SPAN&gt; &lt;SPAN style="COLOR: #0000ff"&gt;void&lt;/SPAN&gt; ShowMessage()
&lt;/PRE&gt;&lt;PRE style="BACKGROUND-COLOR: #fbfbfb; MARGIN: 0em; WIDTH: 100%; FONT-FAMILY: consolas,'Courier New',courier,monospace; FONT-SIZE: 13px"&gt;{
&lt;/PRE&gt;&lt;PRE style="BACKGROUND-COLOR: #ffffff; MARGIN: 0em; WIDTH: 100%; FONT-FAMILY: consolas,'Courier New',courier,monospace; FONT-SIZE: 13px"&gt;&lt;SPAN style="COLOR: #008000"&gt;// ...&lt;/SPAN&gt;
&lt;/PRE&gt;&lt;PRE style="BACKGROUND-COLOR: #fbfbfb; MARGIN: 0em; WIDTH: 100%; FONT-FAMILY: consolas,'Courier New',courier,monospace; FONT-SIZE: 13px"&gt;}
&lt;/PRE&gt;&lt;PRE style="BACKGROUND-COLOR: #ffffff; MARGIN: 0em; WIDTH: 100%; FONT-FAMILY: consolas,'Courier New',courier,monospace; FONT-SIZE: 13px"&gt;&lt;/PRE&gt;&lt;/PRE&gt;
&lt;P&gt;Note: Properties and Methods must be public, or discovering the Method with GetIDsofNames will return E_FAIL. &lt;BR&gt;&lt;/P&gt;&lt;/LI&gt;&lt;/OL&gt;
&lt;OL&gt;
&lt;LI&gt;You register an instance of the ScriptableType with the Silverlight runtime after the application starts up by calling &lt;A href="http://msdn.microsoft.com/en-us/library/system.windows.browser.htmlpage.registerscriptableobject(VS.95).aspx" mce_href="http://msdn.microsoft.com/en-us/library/system.windows.browser.htmlpage.registerscriptableobject(VS.95).aspx"&gt;RegisterScriptableObject&lt;/A&gt;. It’s very important to note that you have to call RegisterScriptableObject after runtime and application are intialized, not during the MainPage’s constructor or in InitializeComponent(). Scripting will not work correctly if you register the object too early. &lt;BR&gt;&lt;PRE&gt;&lt;PRE style="BACKGROUND-COLOR: #fbfbfb; MARGIN: 0em; WIDTH: 100%; FONT-FAMILY: consolas,'Courier New',courier,monospace; FONT-SIZE: 13px"&gt;&lt;SPAN style="COLOR: #0000ff"&gt;private&lt;/SPAN&gt; &lt;SPAN style="COLOR: #0000ff"&gt;void&lt;/SPAN&gt; Application_Startup(&lt;SPAN style="COLOR: #0000ff"&gt;object&lt;/SPAN&gt; sender, StartupEventArgs e)
&lt;/PRE&gt;&lt;PRE style="BACKGROUND-COLOR: #ffffff; MARGIN: 0em; WIDTH: 100%; FONT-FAMILY: consolas,'Courier New',courier,monospace; FONT-SIZE: 13px"&gt;{
&lt;/PRE&gt;&lt;PRE style="BACKGROUND-COLOR: #fbfbfb; MARGIN: 0em; WIDTH: 100%; FONT-FAMILY: consolas,'Courier New',courier,monospace; FONT-SIZE: 13px"&gt;    &lt;SPAN style="COLOR: #0000ff"&gt;this&lt;/SPAN&gt;.RootVisual = &lt;SPAN style="COLOR: #0000ff"&gt;new&lt;/SPAN&gt; MainPage();
&lt;/PRE&gt;&lt;PRE style="BACKGROUND-COLOR: #ffffff; MARGIN: 0em; WIDTH: 100%; FONT-FAMILY: consolas,'Courier New',courier,monospace; FONT-SIZE: 13px"&gt;    HtmlPage.&lt;STRONG&gt;RegisterScriptableObject&lt;/STRONG&gt;("&lt;SPAN style="COLOR: #8b0000"&gt;MyReceiver&lt;/SPAN&gt;", &lt;SPAN style="COLOR: #0000ff"&gt;new&lt;/SPAN&gt; MyScriptableObject(&lt;SPAN style="COLOR: #0000ff"&gt;this&lt;/SPAN&gt;.RootVisual &lt;SPAN style="COLOR: #0000ff"&gt;as&lt;/SPAN&gt; UserControl));
&lt;/PRE&gt;&lt;PRE style="BACKGROUND-COLOR: #fbfbfb; MARGIN: 0em; WIDTH: 100%; FONT-FAMILY: consolas,'Courier New',courier,monospace; FONT-SIZE: 13px"&gt;}&lt;/PRE&gt;&lt;/PRE&gt;&lt;/LI&gt;&lt;/OL&gt;
&lt;P&gt;Now the Silverlight application exposes an interface for the container to call. Since this application is running in a custom container, the container can call into the application in response to an event from a card reader for example.&lt;/P&gt;
&lt;H2&gt;Calling the Silverlight interface&lt;/H2&gt;
&lt;P&gt;The &lt;A href="http://msdn.microsoft.com/en-us/library/cc645076(VS.95).aspx" mce_href="http://msdn.microsoft.com/en-us/library/cc645076(VS.95).aspx"&gt;HTML bridge&lt;/A&gt; is part of Silverlight to integrate with browser’s java script engines. That doesn’t mean you can’t make use of it from other containers though. We’re calling the scriptable objects from the C++ container. It’s a little bit cumbersome in our scenario since you have to deal with late bound objects through COM interfaces, but the sample code may help you out a little bit.&lt;/P&gt;
&lt;P&gt;Let’s look at the important pieces. The host for the Silverlight application must allow for access to objects that the&amp;nbsp; Silverlight application registered with the scripting bridge. &lt;A href="http://msdn.microsoft.com/en-us/library/cc296246(VS.95).aspx#IXcpControlHost_GetHostOptions" mce_href="http://msdn.microsoft.com/en-us/library/cc296246(VS.95).aspx#IXcpControlHost_GetHostOptions"&gt;IXcpControlHost::GetHostOptions()&lt;/A&gt; gets called during activation of the control by the hosted Silverlight runtime to find out which features the host allows. The options returned to Silverlight control must include &lt;A href="http://msdn.microsoft.com/en-us/library/cc296246(VS.95).aspx#IXcpHostOptions" mce_href="http://msdn.microsoft.com/en-us/library/cc296246(VS.95).aspx#IXcpHostOptions"&gt;XcpHostOption_EnableScriptableObjectAccess&lt;/A&gt;;&lt;/P&gt;&lt;PRE&gt;&lt;PRE style="BACKGROUND-COLOR: #fbfbfb; MARGIN: 0em; WIDTH: 100%; FONT-FAMILY: consolas,'Courier New',courier,monospace; FONT-SIZE: 13px"&gt;STDMETHODIMP CXcpControlHost::GetHostOptions(DWORD* pdwOptions)
&lt;/PRE&gt;&lt;PRE style="BACKGROUND-COLOR: #ffffff; MARGIN: 0em; WIDTH: 100%; FONT-FAMILY: consolas,'Courier New',courier,monospace; FONT-SIZE: 13px"&gt;{
&lt;/PRE&gt;&lt;PRE style="BACKGROUND-COLOR: #fbfbfb; MARGIN: 0em; WIDTH: 100%; FONT-FAMILY: consolas,'Courier New',courier,monospace; FONT-SIZE: 13px"&gt;  *pdwOptions = XcpHostOption_EnableCrossDomainDownloads | &lt;STRONG&gt;XcpHostOption_EnableScriptableObjectAccess&lt;/STRONG&gt;;
&lt;/PRE&gt;&lt;PRE style="BACKGROUND-COLOR: #ffffff; MARGIN: 0em; WIDTH: 100%; FONT-FAMILY: consolas,'Courier New',courier,monospace; FONT-SIZE: 13px"&gt;  &lt;SPAN style="COLOR: #0000ff"&gt;return&lt;/SPAN&gt; S_OK;
&lt;/PRE&gt;&lt;PRE style="BACKGROUND-COLOR: #fbfbfb; MARGIN: 0em; WIDTH: 100%; FONT-FAMILY: consolas,'Courier New',courier,monospace; FONT-SIZE: 13px"&gt;}&lt;/PRE&gt;&lt;/PRE&gt;
&lt;P&gt;Without the option set, attempts&amp;nbsp; by the container to obtain a reference (the DISPID as we’ll see shortly) will fail. RegisterScriptableObject, however, succeeds.&lt;/P&gt;
&lt;P&gt;Getting to the registered object requires some understanding of COM. If you never had to deal with &lt;A href="http://msdn.microsoft.com/en-us/library/ms680509(VS.85).aspx" mce_href="http://msdn.microsoft.com/en-us/library/ms680509(VS.85).aspx"&gt;IUnknown&lt;/A&gt; and &lt;A href="http://msdn.microsoft.com/en-us/library/ms221608.aspx" mce_href="http://msdn.microsoft.com/en-us/library/ms221608.aspx"&gt;IDispatch&lt;/A&gt;, you may want to take a quick look at the &lt;A href="http://msdn.microsoft.com/en-us/library/ms694363(VS.85).aspx" mce_href="http://msdn.microsoft.com/en-us/library/ms694363(VS.85).aspx"&gt;COM reference&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;The scriptable objects are a accessible from the Silverlight control’s Content Interface. Like all other late bound objects, properties and method on the Content object is available via IDispatch, which turns the inconspicuous lines of javascript:&lt;/P&gt;&lt;PRE&gt;&lt;PRE style="BACKGROUND-COLOR: #fbfbfb; MARGIN: 0em; WIDTH: 100%; FONT-FAMILY: consolas,'Courier New',courier,monospace; FONT-SIZE: 13px"&gt;slCtl  = sender.get_element();
&lt;/PRE&gt;&lt;PRE style="BACKGROUND-COLOR: #ffffff; MARGIN: 0em; WIDTH: 100%; FONT-FAMILY: consolas,'Courier New',courier,monospace; FONT-SIZE: 13px"&gt;slCtl.Content.MyReceiver.ShowMessage();
&lt;/PRE&gt;&lt;/PRE&gt;
&lt;P&gt;into the slightly more verbose C++ equivalent:&lt;/P&gt;&lt;PRE&gt;&lt;PRE style="BACKGROUND-COLOR: #fbfbfb; MARGIN: 0em; WIDTH: 100%; FONT-FAMILY: consolas,'Courier New',courier,monospace; FONT-SIZE: 13px"&gt;  _axWindow.QueryControl(IID_IXcpControl, (&lt;SPAN style="COLOR: #0000ff"&gt;void&lt;/SPAN&gt;**)&amp;amp;pxcpControl);
&lt;/PRE&gt;&lt;PRE style="BACKGROUND-COLOR: #ffffff; MARGIN: 0em; WIDTH: 100%; FONT-FAMILY: consolas,'Courier New',courier,monospace; FONT-SIZE: 13px"&gt;  HRESULT hr = pxcpControl-&amp;gt;get_Content( &amp;amp;pContentDispatch );
&lt;/PRE&gt;&lt;PRE style="BACKGROUND-COLOR: #fbfbfb; MARGIN: 0em; WIDTH: 100%; FONT-FAMILY: consolas,'Courier New',courier,monospace; FONT-SIZE: 13px"&gt;&lt;/PRE&gt;&lt;PRE style="BACKGROUND-COLOR: #ffffff; MARGIN: 0em; WIDTH: 100%; FONT-FAMILY: consolas,'Courier New',courier,monospace; FONT-SIZE: 13px"&gt;  BSTR name = L"&lt;SPAN style="COLOR: #8b0000"&gt;MyReceiver&lt;/SPAN&gt;";
&lt;/PRE&gt;&lt;PRE style="BACKGROUND-COLOR: #fbfbfb; MARGIN: 0em; WIDTH: 100%; FONT-FAMILY: consolas,'Courier New',courier,monospace; FONT-SIZE: 13px"&gt;  hr = pContentDispatch-&amp;gt;GetIDsOfNames(IID_NULL, &amp;amp;name, 1, LOCALE_SYSTEM_DEFAULT, &amp;amp;dispatchID);
&lt;/PRE&gt;&lt;PRE style="BACKGROUND-COLOR: #ffffff; MARGIN: 0em; WIDTH: 100%; FONT-FAMILY: consolas,'Courier New',courier,monospace; FONT-SIZE: 13px"&gt;  hr = pContentDispatch-&amp;gt;Invoke(dispatchID, IID_NULL, LOCALE_SYSTEM_DEFAULT, DISPATCH_PROPERTYGET, &amp;amp;params, &amp;amp;varResult, NULL, NULL);
&lt;/PRE&gt;&lt;PRE style="BACKGROUND-COLOR: #fbfbfb; MARGIN: 0em; WIDTH: 100%; FONT-FAMILY: consolas,'Courier New',courier,monospace; FONT-SIZE: 13px"&gt;&lt;/PRE&gt;&lt;PRE style="BACKGROUND-COLOR: #ffffff; MARGIN: 0em; WIDTH: 100%; FONT-FAMILY: consolas,'Courier New',courier,monospace; FONT-SIZE: 13px"&gt;  pScriptableObjectDispatch = varResult.pdispVal;
&lt;/PRE&gt;&lt;PRE style="BACKGROUND-COLOR: #fbfbfb; MARGIN: 0em; WIDTH: 100%; FONT-FAMILY: consolas,'Courier New',courier,monospace; FONT-SIZE: 13px"&gt;  name = L"&lt;SPAN style="COLOR: #8b0000"&gt;ShowMessage&lt;/SPAN&gt;";
&lt;/PRE&gt;&lt;PRE style="BACKGROUND-COLOR: #ffffff; MARGIN: 0em; WIDTH: 100%; FONT-FAMILY: consolas,'Courier New',courier,monospace; FONT-SIZE: 13px"&gt;  hr = pScriptableObjectDispatch-&amp;gt;GetIDsOfNames(IID_NULL, &amp;amp;name, 1, LOCALE_SYSTEM_DEFAULT, &amp;amp;dispatchID);
&lt;/PRE&gt;&lt;PRE style="BACKGROUND-COLOR: #fbfbfb; MARGIN: 0em; WIDTH: 100%; FONT-FAMILY: consolas,'Courier New',courier,monospace; FONT-SIZE: 13px"&gt;  hr = pScriptableObjectDispatch-&amp;gt;Invoke(dispatchID, IID_NULL, LOCALE_SYSTEM_DEFAULT, DISPATCH_METHOD, &amp;amp;params, &amp;amp;varResult, NULL, NULL);
&lt;/PRE&gt;&lt;PRE style="BACKGROUND-COLOR: #ffffff; MARGIN: 0em; WIDTH: 100%; FONT-FAMILY: consolas,'Courier New',courier,monospace; FONT-SIZE: 13px"&gt;&lt;/PRE&gt;&lt;/PRE&gt;
&lt;P&gt;Let’s examine those lines a little bit more closely. First you get a reference to the Silverlight control. From the control you go to the control’s content. There’s an implicit assumption here that you don’t access the Content until after the &lt;A href="http://msdn.microsoft.com/en-us/library/cc189034(VS.95).aspx" mce_href="http://msdn.microsoft.com/en-us/library/cc189034(VS.95).aspx"&gt;VisualTree&lt;/A&gt; is constructed.&lt;/P&gt;
&lt;P&gt;From the content, you get the ScriptableObject by the name passed to RegisterScriptableObject in the Silverlight application. Then finally, very important(!), you ask the ScriptableObject for its default dispatch interface, from where you get method or property references, which you can invoke via &lt;A href="http://msdn.microsoft.com/en-us/library/ms221479.aspx" mce_href="http://msdn.microsoft.com/en-us/library/ms221479.aspx"&gt;IDispatch::Invoke&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;Now you have everything in place to listen to events from peripherals and pass them on to a Silverlight application running inside the custom host.&lt;/P&gt;
&lt;H2&gt;Communication between Applications&lt;/H2&gt;
&lt;P&gt;If you need run the Silverlight application running in a browser, then you can build a bridge from the custom host that communicates with the browser application with the silverlight application communication feature introduced with Silverlight 3.&lt;/P&gt;
&lt;P&gt;Two applications can communicate with the LocalMessageSender and LocalMessageReceiver objects. If you need to forward local events to a browser application, then the browser application would start listening to messages.&lt;/P&gt;
&lt;P&gt;Setting up Sender and Receiver is straight forward. The receiving applications starts the listener:&lt;/P&gt;&lt;PRE&gt;&lt;PRE style="BACKGROUND-COLOR: #fbfbfb; MARGIN: 0em; WIDTH: 100%; FONT-FAMILY: consolas,'Courier New',courier,monospace; FONT-SIZE: 13px"&gt;LocalMessageReceiver receiver = &lt;SPAN style="COLOR: #0000ff"&gt;new&lt;/SPAN&gt; LocalMessageReceiver(     
&lt;/PRE&gt;&lt;PRE style="BACKGROUND-COLOR: #ffffff; MARGIN: 0em; WIDTH: 100%; FONT-FAMILY: consolas,'Courier New',courier,monospace; FONT-SIZE: 13px"&gt;    "&lt;SPAN style="COLOR: #8b0000"&gt;&lt;STRONG&gt;Receiver Name&lt;/STRONG&gt;&lt;/SPAN&gt;",    
&lt;/PRE&gt;&lt;PRE style="BACKGROUND-COLOR: #fbfbfb; MARGIN: 0em; WIDTH: 100%; FONT-FAMILY: consolas,'Courier New',courier,monospace; FONT-SIZE: 13px"&gt;    ReceiverNameScope.Global, LocalMessageReceiver.AnyDomain  );
&lt;/PRE&gt;&lt;PRE style="BACKGROUND-COLOR: #ffffff; MARGIN: 0em; WIDTH: 100%; FONT-FAMILY: consolas,'Courier New',courier,monospace; FONT-SIZE: 13px"&gt;&lt;/PRE&gt;&lt;PRE style="BACKGROUND-COLOR: #fbfbfb; MARGIN: 0em; WIDTH: 100%; FONT-FAMILY: consolas,'Courier New',courier,monospace; FONT-SIZE: 13px"&gt;receiver.MessageReceived += ( &lt;SPAN style="COLOR: #0000ff"&gt;object&lt;/SPAN&gt; sender, MessageReceivedEventArgs e ) =&amp;gt;
&lt;/PRE&gt;&lt;PRE style="BACKGROUND-COLOR: #ffffff; MARGIN: 0em; WIDTH: 100%; FONT-FAMILY: consolas,'Courier New',courier,monospace; FONT-SIZE: 13px"&gt;{
&lt;/PRE&gt;&lt;PRE style="BACKGROUND-COLOR: #fbfbfb; MARGIN: 0em; WIDTH: 100%; FONT-FAMILY: consolas,'Courier New',courier,monospace; FONT-SIZE: 13px"&gt;        items.Add( &lt;SPAN style="COLOR: #0000ff"&gt;new&lt;/SPAN&gt; ListItem() { Text= e.Message + "&lt;SPAN style="COLOR: #8b0000"&gt; &lt;/SPAN&gt;" + DateTime.Now.ToLongTimeString() } );
&lt;/PRE&gt;&lt;PRE style="BACKGROUND-COLOR: #ffffff; MARGIN: 0em; WIDTH: 100%; FONT-FAMILY: consolas,'Courier New',courier,monospace; FONT-SIZE: 13px"&gt;};
&lt;/PRE&gt;&lt;PRE style="BACKGROUND-COLOR: #fbfbfb; MARGIN: 0em; WIDTH: 100%; FONT-FAMILY: consolas,'Courier New',courier,monospace; FONT-SIZE: 13px"&gt;receiver.Listen();&lt;/PRE&gt;&lt;/PRE&gt;
&lt;P&gt;and the sending application sends to a receiver with the registered name:&lt;/P&gt;&lt;PRE&gt;&lt;PRE style="BACKGROUND-COLOR: #fbfbfb; MARGIN: 0em; WIDTH: 100%; FONT-FAMILY: consolas,'Courier New',courier,monospace; FONT-SIZE: 13px"&gt;LocalMessageSender msgsender = &lt;SPAN style="COLOR: #0000ff"&gt;new&lt;/SPAN&gt; LocalMessageSender(    
&lt;/PRE&gt;&lt;PRE style="BACKGROUND-COLOR: #ffffff; MARGIN: 0em; WIDTH: 100%; FONT-FAMILY: consolas,'Courier New',courier,monospace; FONT-SIZE: 13px"&gt;    "&lt;SPAN style="COLOR: #8b0000"&gt;&lt;STRONG&gt;Receiver Name&lt;/STRONG&gt;&lt;/SPAN&gt;",     
&lt;/PRE&gt;&lt;PRE style="BACKGROUND-COLOR: #fbfbfb; MARGIN: 0em; WIDTH: 100%; FONT-FAMILY: consolas,'Courier New',courier,monospace; FONT-SIZE: 13px"&gt;    System.Windows.Messaging.LocalMessageSender.Global );
&lt;/PRE&gt;&lt;PRE style="BACKGROUND-COLOR: #ffffff; MARGIN: 0em; WIDTH: 100%; FONT-FAMILY: consolas,'Courier New',courier,monospace; FONT-SIZE: 13px"&gt;&lt;/PRE&gt;&lt;PRE style="BACKGROUND-COLOR: #fbfbfb; MARGIN: 0em; WIDTH: 100%; FONT-FAMILY: consolas,'Courier New',courier,monospace; FONT-SIZE: 13px"&gt;msgsender.SendCompleted += ( &lt;SPAN style="COLOR: #0000ff"&gt;object&lt;/SPAN&gt; sender2, SendCompletedEventArgs e2 ) =&amp;gt;
&lt;/PRE&gt;&lt;PRE style="BACKGROUND-COLOR: #ffffff; MARGIN: 0em; WIDTH: 100%; FONT-FAMILY: consolas,'Courier New',courier,monospace; FONT-SIZE: 13px"&gt;{
&lt;/PRE&gt;&lt;PRE style="BACKGROUND-COLOR: #fbfbfb; MARGIN: 0em; WIDTH: 100%; FONT-FAMILY: consolas,'Courier New',courier,monospace; FONT-SIZE: 13px"&gt;    MessageBox.Show("&lt;SPAN style="COLOR: #8b0000"&gt;Result: &lt;/SPAN&gt;" );
&lt;/PRE&gt;&lt;PRE style="BACKGROUND-COLOR: #ffffff; MARGIN: 0em; WIDTH: 100%; FONT-FAMILY: consolas,'Courier New',courier,monospace; FONT-SIZE: 13px"&gt;};
&lt;/PRE&gt;&lt;PRE style="BACKGROUND-COLOR: #fbfbfb; MARGIN: 0em; WIDTH: 100%; FONT-FAMILY: consolas,'Courier New',courier,monospace; FONT-SIZE: 13px"&gt;&lt;/PRE&gt;&lt;PRE style="BACKGROUND-COLOR: #ffffff; MARGIN: 0em; WIDTH: 100%; FONT-FAMILY: consolas,'Courier New',courier,monospace; FONT-SIZE: 13px"&gt;msgsender.SendAsync(textBox1.Text);
&lt;/PRE&gt;&lt;/PRE&gt;
&lt;P&gt;MSDN has a &lt;A href="http://msdn.microsoft.com/en-us/library/dd833063(VS.95).aspx" mce_href="http://msdn.microsoft.com/en-us/library/dd833063(VS.95).aspx"&gt;good overview of local messaging in Silverlight&lt;/A&gt;, including some advanced features like sending complex XML messages and troubleshooting. &lt;/P&gt;
&lt;P&gt;What’s important to note, is that the BaseUrl of the sending application has to match the BaseUrl of the receiving application. Even setting the receiver options and disabling zone checks are not sufficient for the receiver to process incoming messages. You may have to play some more tricks in the host if you’re not planning on loading the sending application from the same site.&lt;/P&gt;
&lt;P&gt;For example, you could intercept the download request in &lt;A href="http://msdn.microsoft.com/en-us/library/cc296246(VS.95).aspx#IXcpControlHost_DownloadUrl" mce_href="http://msdn.microsoft.com/en-us/library/cc296246(VS.95).aspx#IXcpControlHost_DownloadUrl"&gt;IXcpControlHost::DownloadUrl()&lt;/A&gt; to load the .xap from other locations.&lt;/P&gt;
&lt;H2&gt;Closing Words&lt;/H2&gt;
&lt;P&gt;The upcoming &lt;A href="http://www.silverlight.net/getstarted/silverlight-4-beta/" mce_href="http://www.silverlight.net/getstarted/silverlight-4-beta/"&gt;Silverlight 4&lt;/A&gt; release is going to simplify the architecture for out-of-browser scenarios. &lt;A title="Silverlight 4 trusted applications" href="http://timheuer.com/blog/archive/2009/11/18/whats-new-in-silverlight-4-complete-guide-new-features.aspx#elevated" mce_href="http://timheuer.com/blog/archive/2009/11/18/whats-new-in-silverlight-4-complete-guide-new-features.aspx#elevated"&gt;Silverlight 4 trusted applications&lt;/A&gt; can communicate with COM servers directly, which eliminates the need for hosting a Silverlight application in a custom container to get access to local resources. You still need the custom container bridge if your browser application needs access to devices and other local resources. &lt;/P&gt;
&lt;P&gt;I’m planning a follow up post discussing the Silverlight 4 option. It’s going to be a little bit before SL4 ships – Scott Guthrie mentioned H1 2010 as the target timeframe during his &lt;A href="http://microsoftpdc.com/Sessions/KEY02" mce_href="http://microsoftpdc.com/Sessions/KEY02"&gt;PDC Day 2 keynote&lt;/A&gt;. It’s good to have a working option with Silverlight 3 before that.&lt;/P&gt;
&lt;P&gt;And finally, the big thank you to &lt;A href="http://nerddawg.blogspot.com/" mce_href="http://nerddawg.blogspot.com/"&gt;Ashish&lt;/A&gt;, who patiently answered my questions about the COM APIs while I was looking for the magic combination ;)&lt;/P&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=7273891" width="1" height="1"&gt;</description><category domain="http://weblogs.asp.net/cschittko/archive/tags/.NET/default.aspx">.NET</category><category domain="http://weblogs.asp.net/cschittko/archive/tags/Silverlight/default.aspx">Silverlight</category><category domain="http://weblogs.asp.net/cschittko/archive/tags/Visual+Studio/default.aspx">Visual Studio</category></item></channel></rss>