<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
  <channel xmlns:blog="http://www.dotnetnuke.com/blog/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/">
    <title>Ian T. Lackey (ITLackey)</title>
    <description>Open Source @ Your Service</description>
    <link>http://www.openlightgroup.net/Blog/tabid/58/BlogId/2/Default.aspx</link>
    <language>en-US</language>
    <webMaster>webmaster@openlightgroup.net</webMaster>
    <pubDate>Sat, 04 Feb 2012 11:32:59 GMT</pubDate>
    <lastBuildDate>Sat, 04 Feb 2012 11:32:59 GMT</lastBuildDate>
    <docs>http://backend.userland.com/rss</docs>
    <generator>Blog RSS Generator Version 4.1.0.0</generator>
    <item>
      <title>What's Wrong with this Picture? - St. Louis Day of .Net Presentation Info</title>
      <link>http://openlightgroup.net/Blog/tabid/58/EntryId/183/Whats-Wrong-with-this-Picture-St-Louis-Day-of-Net-Presentation-Info.aspx</link>
      <description>&lt;p&gt;First of all, thank all of you that attended this session at the conference. I had a great time talking with you all and hope everyone got something out of the session. I have posted the slide deck, links to the articles I referenced  in the talk and a link to the example code below.&lt;/p&gt;
&lt;div id="__ss_8796163" style="width: 425px"&gt;&lt;strong style="margin: 12px 0px 4px; display: block"&gt;&lt;a title="What’s wrong with this picture - STL DODN" target="_blank" href="http://www.slideshare.net/itlackey/whats-wrong-with-this-picture-stl-dodn"&gt;What’s wrong with this picture - STL DODN&lt;/a&gt;&lt;/strong&gt; &lt;iframe height="355" marginheight="0" src="http://www.slideshare.net/slideshow/embed_code/8796163" frameborder="0" width="425" marginwidth="0" scrolling="no"&gt;&lt;/iframe&gt;
&lt;div style="padding-bottom: 12px; padding-left: 0px; padding-right: 0px; padding-top: 5px"&gt;View more &lt;a target="_blank" href="http://www.slideshare.net/"&gt;presentations&lt;/a&gt; from &lt;a target="_blank" href="http://www.slideshare.net/itlackey"&gt;Ian Lackey&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Here are the links and contact information from the presentation (for easy access):&lt;/p&gt;
&lt;ul&gt;
    &lt;li&gt;MSDN documentation on Health Monitoring:  &lt;a target="_blank" href="http://msdn.microsoft.com/en-us/library/bb398933.aspx"&gt;http://msdn.microsoft.com/en-us/library/bb398933.aspx&lt;/a&gt;&lt;/li&gt;
    &lt;li&gt;Health Monitoring FAQ article: &lt;a target="_blank" href="http://forums.asp.net/t/1027461.aspx"&gt;http://forums.asp.net/t/1027461.aspx&lt;/a&gt;&lt;/li&gt;
    &lt;li&gt;Example code: &lt;a title="OpenLight Group Common Library" target="_blank" href="http://olgcommon.codeplex.com/releases/view/71454"&gt;http://olgcommon.codeplex.com/releases/view/71454&lt;/a&gt;&lt;/li&gt;
    &lt;li&gt;My twitter account: &lt;a target="_blank" href="http://twitter.com/itlackey"&gt;@itlackey&lt;/a&gt;&lt;/li&gt;
    &lt;li&gt;OpenLight Group Common CodePlex project: &lt;a target="_blank" href="http://olgcommon.codeplex.com"&gt;http://olgcommon.codeplex.com&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;An audience member raised a question regarding providing event log output to SNMP. I have looked around for a bit and found this open source library for using SNMP in .Net. (&lt;a title="http://sharpsnmplib.codeplex.com/" href="http://sharpsnmplib.codeplex.com/"&gt;http://sharpsnmplib.codeplex.com/&lt;/a&gt;) This library should help you build a custom provider to route the events to SNMP. Information on how to build a custom provider can be found here: &lt;a title="http://msdn.microsoft.com/en-us/library/ms178718.aspx" href="http://msdn.microsoft.com/en-us/library/ms178718.aspx"&gt;http://msdn.microsoft.com/en-us/library/ms178718.aspx&lt;/a&gt; I hope this information points you in the right direction.&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;If you have any questions, comments, concerns (or I have forgotten to follow up on your question) please feel free to post a comment below.&lt;/p&gt;&lt;br /&gt;&lt;a href=http://openlightgroup.net/Blog/tabid/58/EntryId/183/Whats-Wrong-with-this-Picture-St-Louis-Day-of-Net-Presentation-Info.aspx&gt;More ...&lt;/a&gt;</description>
      <author>webmaster@openlightgroup.net</author>
      <comments>http://openlightgroup.net/Blog/tabid/58/EntryId/183/Whats-Wrong-with-this-Picture-St-Louis-Day-of-Net-Presentation-Info.aspx#Comments</comments>
      <slash:comments>0</slash:comments>
      <guid isPermaLink="true">http://openlightgroup.net/Blog/tabid/58/EntryId/183/Whats-Wrong-with-this-Picture-St-Louis-Day-of-Net-Presentation-Info.aspx</guid>
      <pubDate>Tue, 09 Aug 2011 02:41:00 GMT</pubDate>
      <trackback:ping>http://www.openlightgroup.netDesktopModules/BlogTrackback.aspx?id=183</trackback:ping>
    </item>
    <item>
      <title>Prism BootStrapper Load ModuleCatalog Ansyc</title>
      <link>http://openlightgroup.net/Blog/tabid/58/EntryId/165/Prism-BootStrapper-Load-ModuleCatalog-Ansyc.aspx</link>
      <description>&lt;p&gt;Prism gives you two options on how to configure the ModuleCatalog, typically in the BootStrapper, these include programmatically or from a XAML file that is embedded in the XAP file. This is a quick post to shown a very simple example of loading the ModuleCatalog for in an asynchronous fashion. This example will load the ModuleCatalog from an XML file located on the web server. The example will be abstract in implementation, but consider the scenario that you allow Administrators to upload modules into the application. When a new module is installed the catalog needs to be updated so that the Silverlight application will see them the next time it reloads the ModuleCatalog.&lt;/p&gt;  &lt;p&gt; &lt;/p&gt;  &lt;p&gt;1. Create a Bootstrapper that inherits from your choice of a BootStrapper base class.&lt;/p&gt;  &lt;p&gt; &lt;/p&gt;  &lt;pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;&lt;blockquote&gt;&lt;p&gt;&lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;class&lt;/span&gt; AsyncBootstrapper&lt;/p&gt;&lt;/blockquote&gt;
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;        : MefBootstrapper&lt;/pre&gt;&lt;/pre&gt;

&lt;p&gt;Here we are using the MefBootstrapper but there is no reason you could not use Unity or any DI framework that you choose to integrate with Prism. &lt;/p&gt;

&lt;p&gt; &lt;/p&gt;

&lt;p&gt;2. Implement the required abstract method CreateShell. Here we return null here because we do not want to load a UI until the catalog is downloaded. &lt;/p&gt;

&lt;pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;       &lt;span style="color: #0000ff"&gt;protected&lt;/span&gt; &lt;span style="color: #0000ff"&gt;override&lt;/span&gt; DependencyObject CreateShell()
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;        {
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;            &lt;span style="color: #0000ff"&gt;return&lt;/span&gt; &lt;span style="color: #0000ff"&gt;null;&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: 12px"&gt;        }
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;&lt;/pre&gt;&lt;/pre&gt;

&lt;p&gt;Delaying the creation of the shell may not always be necessary. However, given that Async processes can throw error and do not always complete it would be nice to be able to display a different UI to handle any exceptions gracefully.&lt;/p&gt;

&lt;p&gt; &lt;/p&gt;

&lt;p&gt;3. Override the base class CreateModuleCatalog method and in this method we are going to request the xml file from the server. &lt;/p&gt;

&lt;pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;        &lt;span style="color: #0000ff"&gt;protected&lt;/span&gt; &lt;span style="color: #0000ff"&gt;override&lt;/span&gt; IModuleCatalog CreateModuleCatalog()
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;        {
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;            ModuleCatalog catalog = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; ModuleCatalog();
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;            WebClient client = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; WebClient();
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;            client.OpenReadCompleted += &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; OpenReadCompletedEventHandler(client_OpenReadCompleted);
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;            client.OpenReadAsync(&lt;span style="color: #0000ff"&gt;new&lt;/span&gt; Uri(&lt;span style="color: #8b0000"&gt;&lt;a href="http://localhost:6639/ModuleCatalog.xml"&gt;http://localhost:6639/ModuleCatalog.xml&lt;/a&gt;&lt;/span&gt;, UriKind.RelativeOrAbsolute), catalog);
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;            &lt;span style="color: #0000ff"&gt;return&lt;/span&gt; catalog;
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;        }&lt;/pre&gt;&lt;/pre&gt;

&lt;p&gt; &lt;/p&gt;

&lt;p&gt;To keep this example as simple as possible we are just hard coding a path to an XML file. Imagine pointing this to a REST service that could construct the response from a database possibly event based authorization rules etc. You could also use any other async process in place of this web get request, such as a RIA Services DomainContext or a standard WCF service call.&lt;/p&gt;

&lt;p&gt; &lt;/p&gt;

&lt;p&gt;4. In the event handler for the OpenReadCompleted we take the response and load it into the ModuleCatalog and set the RootVisual to the Shell for our application.&lt;/p&gt;

&lt;pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;        &lt;span style="color: #0000ff"&gt;private void&lt;/span&gt; client_OpenReadCompleted(&lt;span style="color: #0000ff"&gt;object&lt;/span&gt; sender, OpenReadCompletedEventArgs e)
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;        {
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;            var catalog = Microsoft.Practices.Prism.Modularity.ModuleCatalog.CreateFromXaml(e.Result);
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;            &lt;span style="color: #0000ff"&gt;foreach&lt;/span&gt; (var item &lt;span style="color: #0000ff"&gt;in&lt;/span&gt; catalog.Modules)
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;                &lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.ModuleCatalog.AddModule(item);
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;            App.Current.RootVisual = &lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.Container.GetExportedValue&lt;Shell&gt;();
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;        }&lt;/pre&gt;&lt;/pre&gt;

&lt;p&gt;Continuing the comments about step 3, if you were using a different way of requesting the catalog this code could be very different. For example, instead of using the CreateFromXaml method you may enumerate through a collection returned from WCF and programmatically configure the catalog. Also, if you did not delay the creation of the Shell, you would not need to set the RootVisual here.&lt;/p&gt;

&lt;p&gt;I tried to keep this example short and to the point. However, the simplicity of the example keep you from considering this solution in more complicated scenarios. A complete solution would probably include caching a copy of the catalog in IsolatedStorage and loading from cache if the application is offline. It should be able to be applied in many scenarios that included updating the available modules without redeploying the main XAP file.&lt;/p&gt;

&lt;p&gt;As always, I hope this helps and look forward to your feedback!&lt;/p&gt;

&lt;p&gt; &lt;/p&gt;

&lt;p&gt;-Updated – Modified how we handled the creation of the Shell due to an issue I discovered after publishing this article. Instead of loading a custom view we are no simply delaying the creation of the Shell. If you wanted a custom UI to display during the loading of the catalog you would create the Shell in the CreateShell method and handle the different displays inside of the Shell.&lt;/p&gt;&lt;br /&gt;&lt;a href=http://openlightgroup.net/Blog/tabid/58/EntryId/165/Prism-BootStrapper-Load-ModuleCatalog-Ansyc.aspx&gt;More ...&lt;/a&gt;</description>
      <author>webmaster@openlightgroup.net</author>
      <comments>http://openlightgroup.net/Blog/tabid/58/EntryId/165/Prism-BootStrapper-Load-ModuleCatalog-Ansyc.aspx#Comments</comments>
      <slash:comments>0</slash:comments>
      <guid isPermaLink="true">http://openlightgroup.net/Blog/tabid/58/EntryId/165/Prism-BootStrapper-Load-ModuleCatalog-Ansyc.aspx</guid>
      <pubDate>Thu, 10 Mar 2011 07:05:55 GMT</pubDate>
      <trackback:ping>http://www.openlightgroup.netDesktopModules/BlogTrackback.aspx?id=165</trackback:ping>
    </item>
    <item>
      <title>Simple RadioButtonList and / or CheckBoxList in Silverlight Using a Behavior</title>
      <link>http://openlightgroup.net/Blog/tabid/58/EntryId/161/Simple-RadioButtonList-and-or-CheckBoxList-in-Silverlight-Using-a-Behavior.aspx</link>
      <description>&lt;p&gt;A problem I have encountered frequently on recent projects is needing an ASP.Net style RadioButtonList or CheckBoxList inside on a Silverlight application. I have tried several approaches and had moderate success given the varying scenarios of each attempt. It finally came to a point that the problem had to be solved once and for all. So after discussing it with a few of the guys on my team and doing some extra reading tonight, I have found a solution that I feel is worth sharing. This post will be a step-by-step guide to using the ToogleButtonListBoxBehavior that I have created inside of the &lt;a title="OpenLightGroup Common Library Project" href="http://olgcommon.codeplex.com/" target="_blank"&gt;OpenLightGroup.Common Library&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;To follow this tutorial you will need to download the latest version of the OpenLightGroup.Common Library and add a reference to the included dll file. We will also be using Microsoft Blend; however, the behavior can be added in Visual Studio just as other behaviors.&lt;/p&gt;  &lt;ol&gt;   &lt;li&gt;Drop a ToggleButtonListBoxBehavior onto the ListBox.     &lt;br /&gt;&lt;a href="http://www.openlightgroup.net/Portals/0/Blog/Files/2/161/Windows-Live-Writer-Simple-RadioButtonList-andor-CheckBoxLis_136B2-DropBehavior_2.png"&gt;&lt;img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="DropBehavior" border="0" alt="DropBehavior" src="/Portals/0/Blog/Files/2/161/Windows-Live-Writer-Simple-RadioButtonList-andor-CheckBoxLis_136B2-DropBehavior_thumb.png" width="244" height="229" /&gt;&lt;/a&gt;      &lt;br /&gt;&lt;/li&gt;    &lt;li&gt;Bind the ListBox ItemsSource property to a ViewModel (&lt;em&gt;You may also us a DomainDataSource or any way you would like to populate the Items of the ListBox&lt;/em&gt;).      &lt;br /&gt;&lt;a href="http://www.openlightgroup.net/Portals/0/Blog/Files/2/161/Windows-Live-Writer-Simple-RadioButtonList-andor-CheckBoxLis_136B2-BindItemsSource_2.png"&gt;&lt;img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="BindItemsSource" border="0" alt="BindItemsSource" src="/Portals/0/Blog/Files/2/161/Windows-Live-Writer-Simple-RadioButtonList-andor-CheckBoxLis_136B2-BindItemsSource_thumb.png" width="227" height="244" /&gt;&lt;/a&gt; &lt;a href="http://www.openlightgroup.net/Portals/0/Blog/Files/2/161/Windows-Live-Writer-Simple-RadioButtonList-andor-CheckBoxLis_136B2-ViewModelItemsBinding.png"&gt;&lt;img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="ViewModelItemsBinding" border="0" alt="ViewModelItemsBinding" src="/Portals/0/Blog/Files/2/161/Windows-Live-Writer-Simple-RadioButtonList-andor-CheckBoxLis_136B2-ViewModelItemsBinding_thumb.png" width="244" height="242" /&gt;&lt;/a&gt;      &lt;br /&gt;&lt;/li&gt;    &lt;li&gt;Create a new template for the ListBox ItemTemplate.     &lt;br /&gt;&lt;a href="http://www.openlightgroup.net/Portals/0/Blog/Files/2/161/Windows-Live-Writer-Simple-RadioButtonList-andor-CheckBoxLis_136B2-EditTemplateCreateEmpty_2.png"&gt;&lt;img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="EditTemplateCreateEmpty" border="0" alt="EditTemplateCreateEmpty" src="/Portals/0/Blog/Files/2/161/Windows-Live-Writer-Simple-RadioButtonList-andor-CheckBoxLis_136B2-EditTemplateCreateEmpty_thumb.png" width="244" height="164" /&gt;&lt;/a&gt;      &lt;br /&gt;&lt;/li&gt;    &lt;li&gt;Create the template as a resource.     &lt;br /&gt;&lt;a href="http://www.openlightgroup.net/Portals/0/Blog/Files/2/161/Windows-Live-Writer-Simple-RadioButtonList-andor-CheckBoxLis_136B2-CreateRadioButtonTemplate.png"&gt;&lt;img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="CreateRadioButtonTemplate" border="0" alt="CreateRadioButtonTemplate" src="/Portals/0/Blog/Files/2/161/Windows-Live-Writer-Simple-RadioButtonList-andor-CheckBoxLis_136B2-CreateRadioButtonTemplate_thumb.png" width="244" height="152" /&gt;&lt;/a&gt;      &lt;br /&gt;&lt;/li&gt;    &lt;li&gt;Create a StackPanel in the template and place a TextBlock and RadioButton in it  (&lt;em&gt;You may also use a CheckBox or any other control that inherits from ToggleButton, see the notes at the end of the article&lt;/em&gt;).      &lt;br /&gt;&lt;a href="http://www.openlightgroup.net/Portals/0/Blog/Files/2/161/Windows-Live-Writer-Simple-RadioButtonList-andor-CheckBoxLis_136B2-RadioButtonTemplateObjects.png"&gt;&lt;img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="RadioButtonTemplateObjects" border="0" alt="RadioButtonTemplateObjects" src="/Portals/0/Blog/Files/2/161/Windows-Live-Writer-Simple-RadioButtonList-andor-CheckBoxLis_136B2-RadioButtonTemplateObjects_thumb.png" width="244" height="114" /&gt;&lt;/a&gt;      &lt;br /&gt;&lt;/li&gt;    &lt;li&gt;Bind the Text property of the TextBlock to the property that you would like displayed.     &lt;br /&gt;&lt;a href="http://www.openlightgroup.net/Portals/0/Blog/Files/2/161/Windows-Live-Writer-Simple-RadioButtonList-andor-CheckBoxLis_136B2-BindingItemName.png"&gt;&lt;img style="background-image: none; border-bottom: 0px; border-left: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="BindingItemName" border="0" alt="BindingItemName" src="/Portals/0/Blog/Files/2/161/Windows-Live-Writer-Simple-RadioButtonList-andor-CheckBoxLis_136B2-BindingItemName_thumb.png" width="244" height="231" /&gt;&lt;/a&gt;&lt;a href="http://www.openlightgroup.net/Portals/0/Blog/Files/2/161/Windows-Live-Writer-Simple-RadioButtonList-andor-CheckBoxLis_136B2-RadioButtonList.png"&gt;&lt;img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="RadioButtonList" border="0" alt="RadioButtonList" src="/Portals/0/Blog/Files/2/161/Windows-Live-Writer-Simple-RadioButtonList-andor-CheckBoxLis_136B2-RadioButtonList_thumb.png" width="325" height="227" /&gt;&lt;/a&gt;&lt;/li&gt; &lt;/ol&gt;  &lt;p&gt; &lt;/p&gt;  &lt;p&gt;That is all there is too it! Since this is still just a ListBox, you can customize it any way you like (at least any way you could any other ListBox). There are a few things to keep in mind documented in the following notes section.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Notes:&lt;/strong&gt;&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;The ItemTemplate must contain a ToggleButton (&lt;em&gt;this includes both RadioButton and CheckBox&lt;/em&gt;).&lt;/li&gt;    &lt;ul&gt;     &lt;li&gt;This means you cannot use the DisplayMemberPath on your ListBox.&lt;/li&gt;   &lt;/ul&gt;    &lt;li&gt;Currently this behavior only uses the first ToggleButton it finds inside of the template.&lt;/li&gt;    &lt;li&gt;Each item in the ListBox will have at least two event handlers attached to it to handle Checking and Unchecking etc. This may have a negative impact on performance in long lists.&lt;/li&gt;    &lt;li&gt;If you are not finding the ToggleButtonListBoxBehavior in your assets lists, make you you have downloaded and added a reference to the latest &lt;a href="http://olgcommon.codeplex.com/releases/" target="_blank"&gt;OpenLightGroup.Common release&lt;/a&gt;.&lt;/li&gt;    &lt;li&gt;If you are interested in how this behavior works you can view the &lt;a href="http://olgcommon.codeplex.com/SourceControl/list/changesets" target="_blank"&gt;source code here&lt;/a&gt;.&lt;/li&gt; &lt;/ul&gt;&lt;br /&gt;&lt;a href=http://openlightgroup.net/Blog/tabid/58/EntryId/161/Simple-RadioButtonList-and-or-CheckBoxList-in-Silverlight-Using-a-Behavior.aspx&gt;More ...&lt;/a&gt;</description>
      <author>webmaster@openlightgroup.net</author>
      <comments>http://openlightgroup.net/Blog/tabid/58/EntryId/161/Simple-RadioButtonList-and-or-CheckBoxList-in-Silverlight-Using-a-Behavior.aspx#Comments</comments>
      <slash:comments>0</slash:comments>
      <guid isPermaLink="true">http://openlightgroup.net/Blog/tabid/58/EntryId/161/Simple-RadioButtonList-and-or-CheckBoxList-in-Silverlight-Using-a-Behavior.aspx</guid>
      <pubDate>Wed, 23 Feb 2011 05:47:09 GMT</pubDate>
      <trackback:ping>http://www.openlightgroup.netDesktopModules/BlogTrackback.aspx?id=161</trackback:ping>
    </item>
    <item>
      <title>Getting the right behaviors in your Phone 7 App &amp;ndash; Part 3 Email &amp;lsquo;em</title>
      <link>http://openlightgroup.net/Blog/tabid/58/EntryId/145/Getting-the-right-behaviors-in-your-Phone-7-App-ndash-Part-3-Email-lsquo-em.aspx</link>
      <description>&lt;p&gt;This example will cover how to package a EmailComposeTask as a reusable behavior that can be dropped into any given Phone 7 app. The EmailComposeTask has a few properties that are used to pass data to the email you are launching / preparing to send. &lt;/p&gt;  &lt;p&gt;These include the following:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;Body &lt;/li&gt;    &lt;li&gt;Cc &lt;/li&gt;    &lt;li&gt;Subject &lt;/li&gt;    &lt;li&gt;To &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;Due to the fact that there are four properties included with this task, as opposed to the one property we dealt with in Part 1 and Part 2, we will not be able to use the Tag property of the associated control in the same way as in those examples. With that said, we will in fact use the Tag property but we will have to do a little extra magic to get it to work. Thankfully that Tag property is of type object which gives us the flexibility we will need to make this work. In order to make this solution as reusable as possible I decided to use an interface that can be used in any project referencing this code. Before I loose you, give me one more moment of your time to see how simple this really is. Here is the interface:&lt;/p&gt;  &lt;pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;&lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;interface&lt;/span&gt; IEmailComposeData
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;{
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;        &lt;span style="color: #0000ff"&gt;string&lt;/span&gt; Body { &lt;span style="color: #0000ff"&gt;get&lt;/span&gt;; &lt;span style="color: #0000ff"&gt;set&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: 12px"&gt;        &lt;span style="color: #0000ff"&gt;string&lt;/span&gt; Cc { &lt;span style="color: #0000ff"&gt;get&lt;/span&gt;; &lt;span style="color: #0000ff"&gt;set&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: 12px"&gt;        &lt;span style="color: #0000ff"&gt;string&lt;/span&gt; Subject { &lt;span style="color: #0000ff"&gt;get&lt;/span&gt;; &lt;span style="color: #0000ff"&gt;set&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: 12px"&gt;        &lt;span style="color: #0000ff"&gt;string&lt;/span&gt; To { &lt;span style="color: #0000ff"&gt;get&lt;/span&gt;; &lt;span style="color: #0000ff"&gt;set&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: 12px"&gt;}&lt;/pre&gt;&lt;/pre&gt;

&lt;p&gt;Whoa, ok so it just mimics the properties exposed by the EmailComposeTask! Why in the world would I do something like this?!? We the answer is actually pretty simple, to leverage the powerful binding framework baked into Silverlight. An example is probably the easiest way to explain this, so here is a class that I used in a recent project.&lt;/p&gt;

&lt;pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;    &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; partial &lt;span style="color: #0000ff"&gt;class&lt;/span&gt; Submission
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;        : IEmailComposeData
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;    {
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;        &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; Submission()
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;        {
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;        }
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;        #region IEmailComposeData Members
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;        &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;string&lt;/span&gt; Body
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;        {
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;            &lt;span style="color: #0000ff"&gt;get&lt;/span&gt; { &lt;span style="color: #0000ff"&gt;return&lt;/span&gt; &lt;span style="color: #0000ff"&gt;string&lt;/span&gt;.Empty; }
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;            &lt;span style="color: #0000ff"&gt;set&lt;/span&gt; { }  &lt;span style="color: #008000"&gt;//No op&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: 12px"&gt;        }
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;        &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;string&lt;/span&gt; Cc
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;        {
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;            &lt;span style="color: #0000ff"&gt;get&lt;/span&gt; { &lt;span style="color: #0000ff"&gt;return&lt;/span&gt; &lt;span style="color: #0000ff"&gt;string&lt;/span&gt;.Empty; }
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;            &lt;span style="color: #0000ff"&gt;set&lt;/span&gt; { }  &lt;span style="color: #008000"&gt;//No op&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: 12px"&gt;        }
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;        &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;string&lt;/span&gt; Subject
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;        {
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;            &lt;span style="color: #0000ff"&gt;get&lt;/span&gt; { &lt;span style="color: #0000ff"&gt;return&lt;/span&gt; "&lt;span style="color: #8b0000"&gt;Thank you for your feedback of &lt;/span&gt;" + &lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.ApplicationName; }
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;            &lt;span style="color: #0000ff"&gt;set&lt;/span&gt; { }  &lt;span style="color: #008000"&gt;//No op&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: 12px"&gt;        }
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;        &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;string&lt;/span&gt; To
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;        {
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;            &lt;span style="color: #0000ff"&gt;get&lt;/span&gt; { &lt;span style="color: #0000ff"&gt;return&lt;/span&gt; &lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.EmailAddress; }          
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;            &lt;span style="color: #0000ff"&gt;set&lt;/span&gt; { }  &lt;span style="color: #008000"&gt;//No op&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: 12px"&gt;        }
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;        #endregion
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;    }&lt;/pre&gt;&lt;/pre&gt;

&lt;p&gt;What I did here is I created a partial class of a class generated by a service reference and wrapped a few properties into the IEmailComposeData interface. I also included a little prefix text to the subject and a property from the generated class. The point this should illustrate is that you can implement this interface in any class and provide the expected properties to the behavior, which I will show here:&lt;/p&gt;

&lt;pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;&lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;class&lt;/span&gt; LaunchEmailComposeAction : TriggerAction&lt;Control&gt;
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;{
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;    &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;bool&lt;/span&gt; UseDataObject { &lt;span style="color: #0000ff"&gt;get&lt;/span&gt;; &lt;span style="color: #0000ff"&gt;set&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: 12px"&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;    &lt;span style="color: #0000ff"&gt;protected&lt;/span&gt; &lt;span style="color: #0000ff"&gt;override&lt;/span&gt; &lt;span style="color: #0000ff"&gt;void&lt;/span&gt; Invoke(&lt;span style="color: #0000ff"&gt;object&lt;/span&gt; o)
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;    {
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;        EmailComposeTask task = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; EmailComposeTask();
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;        &lt;span style="color: #0000ff"&gt;if&lt;/span&gt; (&lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.UseDataObject)
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;        {
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;            var data = &lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.AssociatedObject.Tag &lt;span style="color: #0000ff"&gt;as&lt;/span&gt; IEmailComposeData;
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;            task.Body = data.Body;
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;            task.Cc = data.Cc;                
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;            task.Subject = data.Subject;
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;            task.To = data.To;
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;        }
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;        &lt;span style="color: #0000ff"&gt;else&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: 12px"&gt;        {
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;            task.To = &lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.AssociatedObject.Tag.ToString();
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;        }
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;        task.Show();
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;    }
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;}&lt;/pre&gt;&lt;/pre&gt;

&lt;p&gt; &lt;/p&gt;

&lt;p&gt;As you can see, the behavior includes a property UseDataObject to tell the Invoke method if it should try to cast the AssociatedObject’s Tag to the provided interface and pull the data out of it for the properties of EmailComposeTask. If the UseDataObject is set to false then it tries to grab a To string out of the Tag property. I included this just for simple situation when you simply want to launch an email with the To field filled out automatically. However, using the data object allows you to create XAML that looks like this:&lt;/p&gt;

&lt;pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;&lt;span style="color: #0000ff"&gt;&lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;HyperlinkButton&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: 12px"&gt;	 &lt;span style="color: #ff0000"&gt;Content&lt;/span&gt;=&lt;span style="color: #0000ff"&gt;"{Binding EmailAddress, Mode=OneWay}"&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: 12px"&gt;	 &lt;span style="color: #ff0000"&gt;Tag&lt;/span&gt;=&lt;span style="color: #0000ff"&gt;"{Binding Mode=OneWay}"&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&gt;&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: 12px"&gt;	&lt;span style="color: #0000ff"&gt;&lt;&lt;/span&gt;&lt;span style="color: #c71585"&gt;Custom&lt;/span&gt;:&lt;span style="color: #800000"&gt;Interaction.Triggers&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&gt;&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: 12px"&gt;		&lt;span style="color: #0000ff"&gt;&lt;&lt;/span&gt;&lt;span style="color: #c71585"&gt;Custom&lt;/span&gt;:&lt;span style="color: #800000"&gt;EventTrigger&lt;/span&gt; &lt;span style="color: #ff0000"&gt;EventName&lt;/span&gt;=&lt;span style="color: #0000ff"&gt;"Click"&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&gt;&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: 12px"&gt;			&lt;span style="color: #0000ff"&gt;&lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;ITLackey&lt;/span&gt;&lt;span style="color: #ff0000"&gt;_Phone7_Common_Behaviors&lt;/span&gt;:&lt;span style="color: #ff0000"&gt;LaunchEmailComposeAction&lt;/span&gt;  &lt;span style="color: #ff0000"&gt;UseDataObject&lt;/span&gt;=&lt;span style="color: #0000ff"&gt;"True"&lt;/span&gt; &lt;span style="color: #0000ff"&gt;/&gt;&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: 12px"&gt;		&lt;span style="color: #0000ff"&gt;&lt;/&lt;/span&gt;&lt;span style="color: #c71585"&gt;Custom&lt;/span&gt;:&lt;span style="color: #800000"&gt;EventTrigger&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&gt;&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: 12px"&gt;	&lt;span style="color: #0000ff"&gt;&lt;/&lt;/span&gt;&lt;span style="color: #c71585"&gt;Custom&lt;/span&gt;:&lt;span style="color: #800000"&gt;Interaction.Triggers&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&gt;&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: 12px"&gt;&lt;span style="color: #0000ff"&gt;&lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;HyperlinkButton&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&gt;&lt;/span&gt;&lt;/pre&gt;&lt;/pre&gt;

&lt;p&gt;In this XAML the EmailAddress from the Submission class (shown above) is used as the content and the Submission object itself is bound to the Tag property. Since we implemented the IEmailComposeData interface in the Submission class it will be successfully parsed by the behavior and the email will be prepopulated with the information provided by the properties of the Submission class. In this case the To field will be filled in with the EmailAddress and the Subject will be filled in with “Thank you for your feedback of “ + ApplicationName.&lt;/p&gt;

&lt;p&gt;I completely understand and acknowledge that this example includes additional complexity compared to the examples shown in Part 1 &amp; 2; however, I hope that the power of repackaging this task for reusability can be seen and will out weigh the little bit of extra complexity. Obviously, you can trim this down to support only a single field or however you see fit. This solution worked for me and allowed me to pass in all of the data the task supports and is open to add data if the task is expanded to include some additional properties such as ATTACHMENT (hint hint Windows Phone 7 Team! &lt;img style="border-bottom-style: none; border-right-style: none; border-top-style: none; border-left-style: none" class="wlEmoticon wlEmoticon-winkingsmile" alt="Winking smile" src="/Portals/0/Blog/Files/2/145/Windows-Live-Writer-Getting-the-right-behaviors-in-your-Phon_ECEB-wlEmoticon-winkingsmile_2.png" /&gt; ).&lt;/p&gt;

&lt;p&gt; &lt;/p&gt;

&lt;p&gt;Hope this helps!&lt;/p&gt;&lt;br /&gt;&lt;a href=http://openlightgroup.net/Blog/tabid/58/EntryId/145/Getting-the-right-behaviors-in-your-Phone-7-App-ndash-Part-3-Email-lsquo-em.aspx&gt;More ...&lt;/a&gt;</description>
      <author>webmaster@openlightgroup.net</author>
      <comments>http://openlightgroup.net/Blog/tabid/58/EntryId/145/Getting-the-right-behaviors-in-your-Phone-7-App-ndash-Part-3-Email-lsquo-em.aspx#Comments</comments>
      <slash:comments>0</slash:comments>
      <guid isPermaLink="true">http://openlightgroup.net/Blog/tabid/58/EntryId/145/Getting-the-right-behaviors-in-your-Phone-7-App-ndash-Part-3-Email-lsquo-em.aspx</guid>
      <pubDate>Wed, 22 Dec 2010 13:45:26 GMT</pubDate>
      <trackback:ping>http://www.openlightgroup.netDesktopModules/BlogTrackback.aspx?id=145</trackback:ping>
    </item>
    <item>
      <title>Getting the right behaviors in your Phone 7 App &amp;ndash; Part 2 Binding &amp;amp; Browsing</title>
      <link>http://openlightgroup.net/Blog/tabid/58/EntryId/144/Getting-the-right-behaviors-in-your-Phone-7-App-ndash-Part-2-Binding-amp-Browsing.aspx</link>
      <description>&lt;p&gt;In this example we will look at the WebBrowserTask and how a little bit of code can create a great design time experience for the times that you need to launch a browser in a Phone 7 app. Like the PhoneCallTask, the WebBrowserTask only contains one property. So,  this example will look very similar to the one we looked at in Part 1. I will jump straight to the code as the concept will be identical to our previous example.&lt;/p&gt;  &lt;pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;&lt;span style="color: #0000ff"&gt;using&lt;/span&gt; System.Windows.Controls;
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;&lt;span style="color: #0000ff"&gt;using&lt;/span&gt; System.Windows.Interactivity;
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;&lt;span style="color: #0000ff"&gt;using&lt;/span&gt; Microsoft.Phone.Tasks;
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;&lt;span style="color: #0000ff"&gt;namespace&lt;/span&gt; ITLackey.Phone7.Common.Behaviors
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;{
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;    &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;class&lt;/span&gt; LaunchBrowserAction : TriggerAction&lt;Control&gt;
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;    {
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;        &lt;span style="color: #0000ff"&gt;protected&lt;/span&gt; &lt;span style="color: #0000ff"&gt;override&lt;/span&gt; &lt;span style="color: #0000ff"&gt;void&lt;/span&gt; Invoke(&lt;span style="color: #0000ff"&gt;object&lt;/span&gt; parameter)
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;        {
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;            WebBrowserTask task = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; WebBrowserTask();
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;            task.URL = &lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.AssociatedObject.Tag.ToString();
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;            task.Show();
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;        }
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;    }
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;}&lt;/pre&gt;&lt;/pre&gt;

&lt;p&gt; &lt;/p&gt;

&lt;p&gt;Again, we are simply using the Tag property of the associated control to pass in the data we need for our task. In this case it is the URL that we would like to direct the browser to when it is launched. Here is an example of using this behavior on a button:&lt;/p&gt;

&lt;pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;&lt;span style="color: #0000ff"&gt;&lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;Button&lt;/span&gt; &lt;span style="color: #ff0000"&gt;x&lt;/span&gt;:&lt;span style="color: #ff0000"&gt;Name&lt;/span&gt;=&lt;span style="color: #0000ff"&gt;"FeedbackUrl"&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: 12px"&gt;     &lt;span style="color: #ff0000"&gt;Content&lt;/span&gt;=&lt;span style="color: #0000ff"&gt;"You may also submit feedback via the web"&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: 12px"&gt;     &lt;span style="color: #ff0000"&gt;Tag&lt;/span&gt;=&lt;span style="color: #0000ff"&gt;"{Binding SubmitFeedbackUrl}"&lt;/span&gt; &lt;span style="color: #0000ff"&gt;&gt;&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: 12px"&gt;	&lt;span style="color: #0000ff"&gt;&lt;&lt;/span&gt;&lt;span style="color: #c71585"&gt;Custom&lt;/span&gt;:&lt;span style="color: #800000"&gt;Interaction.Triggers&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&gt;&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: 12px"&gt;		&lt;span style="color: #0000ff"&gt;&lt;&lt;/span&gt;&lt;span style="color: #c71585"&gt;Custom&lt;/span&gt;:&lt;span style="color: #800000"&gt;EventTrigger&lt;/span&gt; &lt;span style="color: #ff0000"&gt;EventName&lt;/span&gt;=&lt;span style="color: #0000ff"&gt;"Click"&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&gt;&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: 12px"&gt;			&lt;span style="color: #0000ff"&gt;&lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;ITLackey&lt;/span&gt;&lt;span style="color: #ff0000"&gt;_Phone7_Common_Behaviors&lt;/span&gt;:&lt;span style="color: #ff0000"&gt;LaunchBrowserAction&lt;/span&gt;&lt;span style="color: #0000ff"&gt;/&gt;&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: 12px"&gt;		&lt;span style="color: #0000ff"&gt;&lt;/&lt;/span&gt;&lt;span style="color: #c71585"&gt;Custom&lt;/span&gt;:&lt;span style="color: #800000"&gt;EventTrigger&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&gt;&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: 12px"&gt;	&lt;span style="color: #0000ff"&gt;&lt;/&lt;/span&gt;&lt;span style="color: #c71585"&gt;Custom&lt;/span&gt;:&lt;span style="color: #800000"&gt;Interaction.Triggers&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&gt;&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: 12px"&gt;&lt;span style="color: #0000ff"&gt;&lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;Button&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&gt;&lt;/span&gt;&lt;/pre&gt;&lt;/pre&gt;

&lt;p&gt;Here we are just bound the SubmitFeedbackUrl to the Tag property of the button and dropped the behavior on. Done. That is all there is too it. Pretty simple example but now you can launch a browser session straight to the URL you want from any control in your Phone 7 app.&lt;/p&gt;

&lt;p&gt;Enjoy!&lt;/p&gt;&lt;br /&gt;&lt;a href=http://openlightgroup.net/Blog/tabid/58/EntryId/144/Getting-the-right-behaviors-in-your-Phone-7-App-ndash-Part-2-Binding-amp-Browsing.aspx&gt;More ...&lt;/a&gt;</description>
      <author>webmaster@openlightgroup.net</author>
      <comments>http://openlightgroup.net/Blog/tabid/58/EntryId/144/Getting-the-right-behaviors-in-your-Phone-7-App-ndash-Part-2-Binding-amp-Browsing.aspx#Comments</comments>
      <slash:comments>0</slash:comments>
      <guid isPermaLink="true">http://openlightgroup.net/Blog/tabid/58/EntryId/144/Getting-the-right-behaviors-in-your-Phone-7-App-ndash-Part-2-Binding-amp-Browsing.aspx</guid>
      <pubDate>Wed, 22 Dec 2010 13:43:54 GMT</pubDate>
      <trackback:ping>http://www.openlightgroup.netDesktopModules/BlogTrackback.aspx?id=144</trackback:ping>
    </item>
    <item>
      <title>Getting the right behaviors in your Phone 7 App &amp;ndash; Part 1 Phone Home</title>
      <link>http://openlightgroup.net/Blog/tabid/58/EntryId/143/Getting-the-right-behaviors-in-your-Phone-7-App-ndash-Part-1-Phone-Home.aspx</link>
      <description>&lt;p&gt;This multiple part series will focus on packaging up a few common “tasks” into reusable behaviors. I hope to cover tasks for phone calls, sending emails, launching the browser etc. Most of the articles in this series will be short and typically will contain only a few lines of code. The majority of the code will deal with the objects contained in the Microsoft.Phone.Tasks namespace which contains several classes used to launch a task or choose a piece of data from the phone.&lt;/p&gt;  &lt;p&gt;In this post (part 1) will we tackle what I consider to be the most obvious task to use on a phone… making a phone call. Again this will require only a few lines of code, so I will go ahead and drop it all right here and then run through what it does and how to use it.&lt;/p&gt;  &lt;pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;&lt;span style="color: #0000ff"&gt;using&lt;/span&gt; Microsoft.Phone.Tasks;
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;&lt;span style="color: #0000ff"&gt;using&lt;/span&gt; System.Windows;
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;&lt;span style="color: #0000ff"&gt;using&lt;/span&gt; System.Windows.Controls;
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;&lt;span style="color: #0000ff"&gt;using&lt;/span&gt; System.Windows.Interactivity;
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;&lt;span style="color: #0000ff"&gt;namespace&lt;/span&gt; ITLackey.Phone7.Common.Behaviors
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;{
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;     &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;class&lt;/span&gt; LaunchPhoneDialerAction : TriggerAction&lt;Control&gt;
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;    {
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;        &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; LaunchPhoneDialerAction()
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;        {
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;           
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;        }
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;        &lt;span style="color: #0000ff"&gt;protected&lt;/span&gt; &lt;span style="color: #0000ff"&gt;override&lt;/span&gt; &lt;span style="color: #0000ff"&gt;void&lt;/span&gt; Invoke(&lt;span style="color: #0000ff"&gt;object&lt;/span&gt; o)
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;        {
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;            PhoneCallTask task = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; PhoneCallTask();
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;            
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;	   task.PhoneNumber = &lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.AssociatedObject.Tag.ToString(); 
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;            
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;            task.Show();
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;        }
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;    }
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;}&lt;/pre&gt;&lt;/pre&gt;

&lt;p&gt; &lt;/p&gt;

&lt;p&gt;What we have here is a standard “Action” (as you would see in any Silverlight application) that can be dropped onto any object that derives from the Control base class (For a refresher on behaviors check out this article by Michael &lt;a title="http://openlightgroup.nethttp://www.openlightgroup.net/Blog/tabid/58/EntryId/17/Creating-a-simple-Silverlight-3-Behavior.aspx" href="http://www.openlightgroup.net/Blog/tabid/58/EntryId/17/Creating-a-simple-Silverlight-3-Behavior.aspx"&gt;http://openlightgroup.nethttp://www.openlightgroup.net/Blog/tabid/58/EntryId/17/Creating-a-simple-Silverlight-3-Behavior.aspx&lt;/a&gt; and now there is a handy template available in Blend).  The real work for this example is done inside of the Invoke method and by the majority of work I am referring to the three lines of code.&lt;/p&gt;

&lt;p&gt;The Phone 7 team has done a fine job providing and easy way to launch the phone dialer prepopulated with a phone number. In this example, we are pulling the phone number out of the Tag property of the control this action is associated with. This allows us to bind the Tag property to some dynamically loaded data so that this action could be used inside of a ListBox ItemTemplate for example. That would look something like this:&lt;/p&gt;

&lt;pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;&lt;span style="color: #0000ff"&gt;&lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;ListBox&lt;/span&gt; &lt;span style="color: #ff0000"&gt;x&lt;/span&gt;:&lt;span style="color: #ff0000"&gt;Name&lt;/span&gt;=&lt;span style="color: #0000ff"&gt;"listBox"&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&gt;&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: 12px"&gt;	&lt;span style="color: #0000ff"&gt;&lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;ListBox.ItemTemplate&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&gt;&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: 12px"&gt;		&lt;span style="color: #0000ff"&gt;&lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;DataTemplate&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&gt;&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: 12px"&gt;			&lt;span style="color: #0000ff"&gt;&lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;HyperlinkButton&lt;/span&gt; &lt;span style="color: #ff0000"&gt;Tag&lt;/span&gt;=&lt;span style="color: #0000ff"&gt;"{Binding PhoneNumber}" Content=”{Binding PhoneNumber}”&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&gt;&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: 12px"&gt;				&lt;span style="color: #0000ff"&gt;&lt;&lt;/span&gt;&lt;span style="color: #c71585"&gt;Custom&lt;/span&gt;:&lt;span style="color: #800000"&gt;Interaction.Triggers&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&gt;&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: 12px"&gt;					&lt;span style="color: #0000ff"&gt;&lt;&lt;/span&gt;&lt;span style="color: #c71585"&gt;Custom&lt;/span&gt;:&lt;span style="color: #800000"&gt;EventTrigger&lt;/span&gt; &lt;span style="color: #ff0000"&gt;EventName&lt;/span&gt;=&lt;span style="color: #0000ff"&gt;"Click"&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&gt;&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: 12px"&gt;						&lt;span style="color: #0000ff"&gt;&lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;ITLackey&lt;/span&gt;&lt;span style="color: #ff0000"&gt;_Phone7_Common_Behaviors&lt;/span&gt;:&lt;span style="color: #ff0000"&gt;LaunchPhoneDialerAction&lt;/span&gt;&lt;span style="color: #0000ff"&gt;/&gt;&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: 12px"&gt;					&lt;span style="color: #0000ff"&gt;&lt;/&lt;/span&gt;&lt;span style="color: #c71585"&gt;Custom&lt;/span&gt;:&lt;span style="color: #800000"&gt;EventTrigger&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&gt;&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: 12px"&gt;				&lt;span style="color: #0000ff"&gt;&lt;/&lt;/span&gt;&lt;span style="color: #c71585"&gt;Custom&lt;/span&gt;:&lt;span style="color: #800000"&gt;Interaction.Triggers&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&gt;&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: 12px"&gt;			&lt;span style="color: #0000ff"&gt;&lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;HyperlinkButton&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&gt;&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: 12px"&gt;		&lt;span style="color: #0000ff"&gt;&lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;DataTemplate&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&gt;&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: 12px"&gt;	&lt;span style="color: #0000ff"&gt;&lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;ListBox.ItemTemplate&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&gt;&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: 12px"&gt;&lt;span style="color: #0000ff"&gt;&lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;ListBox&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&gt;&lt;/span&gt;&lt;/pre&gt;&lt;/pre&gt;

&lt;p&gt;This would only display a list of phone numbers, obviously you would typically want to include a more useful item template, but hopefully this illustrates the point. Anytime you click on one of the phone numbers the phone dialer will launch preloaded with that phone number. &lt;/p&gt;

&lt;p&gt;Well there you have it, a reusable phone dialer launching action that can be dropped onto any control in your phone app. Unfortunately, sine Phone 7 uses Silverlight 3 we cannot bind the phone number data directly to a property on the action due to the lack of support in Silverlight 3 to bind to objects that do not inherit from FrameworkElement. (This article shows the announcement of this feature being added to Silverlight 4 &lt;a title="http://timheuer.com/blog/archive/2009/11/18/whats-new-in-silverlight-4-complete-guide-new-features.aspx#dobind" href="http://timheuer.com/blog/archive/2009/11/18/whats-new-in-silverlight-4-complete-guide-new-features.aspx#dobind"&gt;http://timheuer.com/blog/archive/2009/11/18/whats-new-in-silverlight-4-complete-guide-new-features.aspx#dobind&lt;/a&gt;  ). This is why we have to use the Tag property of the associated object. I feel that is a small price to pay for the reusability  of this commonly used action.&lt;/p&gt;

&lt;p&gt;As always any feedback, improvements, questions etc. are appreciated!&lt;/p&gt;&lt;br /&gt;&lt;a href=http://openlightgroup.net/Blog/tabid/58/EntryId/143/Getting-the-right-behaviors-in-your-Phone-7-App-ndash-Part-1-Phone-Home.aspx&gt;More ...&lt;/a&gt;</description>
      <author>webmaster@openlightgroup.net</author>
      <comments>http://openlightgroup.net/Blog/tabid/58/EntryId/143/Getting-the-right-behaviors-in-your-Phone-7-App-ndash-Part-1-Phone-Home.aspx#Comments</comments>
      <slash:comments>4</slash:comments>
      <guid isPermaLink="true">http://openlightgroup.net/Blog/tabid/58/EntryId/143/Getting-the-right-behaviors-in-your-Phone-7-App-ndash-Part-1-Phone-Home.aspx</guid>
      <pubDate>Tue, 21 Dec 2010 06:01:19 GMT</pubDate>
      <trackback:ping>http://www.openlightgroup.netDesktopModules/BlogTrackback.aspx?id=143</trackback:ping>
    </item>
    <item>
      <title>Phone 7 Back Button and the ListPicker control</title>
      <link>http://openlightgroup.net/Blog/tabid/58/EntryId/140/Phone-7-Back-Button-and-the-ListPicker-control.aspx</link>
      <description>&lt;p&gt;I had disappeared once again for far too long; however the time has been well spent. I have been heads down coding apps for Phone7 and learning the nuances of the platform. I have also learned much about the certification process in which your apps must go through before making it to the marketplace. I hope to share a few tips &amp; tricks with you from what I have learned in this and upcoming articles.&lt;/p&gt;  &lt;p&gt;This post will focus on the requirement stated in the certification documentation regarding back button navigation when menus or dialog boxes are present on the current page.  Over the last few days I have had two separate apps fail certification due to an oversight in this area. I decided I would post what I have learned and hopefully help prevent others from encountering the same issues when they submit their apps.&lt;/p&gt;  &lt;p&gt;While developing my first Phone 7 app I was stumped momentarily at the absence of a ComboBox in the phone controls. I use this control so often in Silverlight that I had to wonder what I would do without it. I quickly found that we are supposed to use a ListPicker control from the control toolkit in place of the traditional ComboBox. Great! So off I went dropping them into my app and chugging along ignorant to what this meant in regards to navigation through the app. I wasn’t until recently that I was pointed to the section of the certification requirements document that says:&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;“If the current page displays a context menu or a dialog, the pressing of the Back button      &lt;br /&gt;must close the menu or dialog and cancel the backward navigation to the previous page.” &lt;/p&gt;    &lt;p&gt;– Windows Phone 7 Application Certification Requirements.pdf Section 5.2.4&lt;/p&gt;    &lt;p&gt;* Link to the document as of 12/04/10: &lt;a title="direct link to the PDF file" href="http://go.microsoft.com/fwlink/?LinkID=183220"&gt;direct link to the PDF file&lt;/a&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;Apparently, this includes ListPicker controls that are in the expanded mode (waiting for a selection to be made). This caused me to rework some pieces of apps I was currently developing. Then I decided instead of writing the same code in each page code-behind, I would just write a behavior I could drop on each ListPicker to handle the back button press event.&lt;/p&gt;  &lt;p&gt;The main piece of code that takes care of the issue is simple and only takes a few lines of code:&lt;/p&gt;  &lt;pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;&lt;span style="color: #0000ff"&gt;private&lt;/span&gt; &lt;span style="color: #0000ff"&gt;void&lt;/span&gt; page_BackKeyPress(&lt;span style="color: #0000ff"&gt;object&lt;/span&gt; sender, System.ComponentModel.CancelEventArgs e)
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;{
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;      &lt;span style="color: #0000ff"&gt;if&lt;/span&gt; (&lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.AssociatedObject.ListPickerMode == ListPickerMode.Expanded)
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;      {
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;          &lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.AssociatedObject.ListPickerMode = ListPickerMode.Normal;
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;          e.Cancel = &lt;span style="color: #0000ff"&gt;true&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: 12px"&gt;                
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;      }
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;}&lt;/pre&gt;&lt;/pre&gt;

&lt;p&gt; &lt;/p&gt;

&lt;p&gt;First check to see if the ListPicker is expanded and if so set it back to the normal mode and cancel the navigation by setting the Cancel property of the event args to true. That’s is all there is too it. So simple it is easy to forget and cause your app to fail certification. Now that I have packaged this logic into a behavior, I just have to remember to drop it on my ListPicker controls that will not use the FullMode. For more information on the ListPicker check out the toolkit page on CodePlex: &lt;a title="http://silverlight.codeplex.com/" href="http://silverlight.codeplex.com/"&gt;http://silverlight.codeplex.com/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;To make it easy, here is the code for the in its entirety behavior:&lt;/p&gt;

&lt;pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;&lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;class&lt;/span&gt; CancelBackButtonListPickerBehavior : Behavior&lt;ListPicker&gt;
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;{
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;    &lt;span style="color: #0000ff"&gt;private&lt;/span&gt; PhoneApplicationPage _page;
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;    &lt;span style="color: #0000ff"&gt;protected&lt;/span&gt; &lt;span style="color: #0000ff"&gt;override&lt;/span&gt; &lt;span style="color: #0000ff"&gt;void&lt;/span&gt; OnAttached()
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;    {
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;        &lt;span style="color: #0000ff"&gt;base&lt;/span&gt;.OnAttached();
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;        &lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.AssociatedObject.Loaded += &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; RoutedEventHandler(AssociatedObject_Loaded);
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;          
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;    }
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;    &lt;span style="color: #0000ff"&gt;void&lt;/span&gt; AssociatedObject_Loaded(&lt;span style="color: #0000ff"&gt;object&lt;/span&gt; sender, RoutedEventArgs e)
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;    {
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;        _page = FindParentOfType&lt;PhoneApplicationPage&gt;(&lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.AssociatedObject);
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;        _page.BackKeyPress += &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; EventHandler&lt;System.ComponentModel.CancelEventArgs&gt;(page_BackKeyPress);
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;                       
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;    }
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;    &lt;span style="color: #0000ff"&gt;protected&lt;/span&gt; &lt;span style="color: #0000ff"&gt;override&lt;/span&gt; &lt;span style="color: #0000ff"&gt;void&lt;/span&gt; OnDetaching()
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;    {
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;        &lt;span style="color: #0000ff"&gt;base&lt;/span&gt;.OnDetaching();
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;        _page.BackKeyPress -= &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; EventHandler&lt;System.ComponentModel.CancelEventArgs&gt;(page_BackKeyPress);
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;        &lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.AssociatedObject.Loaded -= &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; RoutedEventHandler(AssociatedObject_Loaded);
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;    }
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;    &lt;span style="color: #0000ff"&gt;void&lt;/span&gt; page_BackKeyPress(&lt;span style="color: #0000ff"&gt;object&lt;/span&gt; sender, System.ComponentModel.CancelEventArgs e)
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;    {
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;        &lt;span style="color: #0000ff"&gt;if&lt;/span&gt; (&lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.AssociatedObject.ListPickerMode == ListPickerMode.Expanded)
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;        {
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;            &lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.AssociatedObject.ListPickerMode = ListPickerMode.Normal;
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;            e.Cancel = &lt;span style="color: #0000ff"&gt;true&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: 12px"&gt;                
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;        }
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;    }
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;    &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;static&lt;/span&gt; T FindParentOfType&lt;T&gt;(FrameworkElement element)
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;    {
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;        var parent = VisualTreeHelper.GetParent(element) &lt;span style="color: #0000ff"&gt;as&lt;/span&gt; FrameworkElement;
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;        &lt;span style="color: #0000ff"&gt;while&lt;/span&gt; (parent != &lt;span style="color: #0000ff"&gt;null&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: 12px"&gt;        {
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;            &lt;span style="color: #0000ff"&gt;if&lt;/span&gt; (parent &lt;span style="color: #0000ff"&gt;is&lt;/span&gt; T)
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;                &lt;span style="color: #0000ff"&gt;return&lt;/span&gt; (T)(&lt;span style="color: #0000ff"&gt;object&lt;/span&gt;)parent;
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;            parent = VisualTreeHelper.GetParent(parent) &lt;span style="color: #0000ff"&gt;as&lt;/span&gt; FrameworkElement;
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;        }
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;        &lt;span style="color: #0000ff"&gt;return&lt;/span&gt; &lt;span style="color: #0000ff"&gt;default&lt;/span&gt;(T);
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;    }
&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;&lt;/pre&gt;&lt;pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;}&lt;/pre&gt;&lt;/pre&gt;

&lt;pre&gt; &lt;/pre&gt;

&lt;br /&gt;

&lt;p&gt;I hope this helps!&lt;/p&gt;&lt;br /&gt;&lt;a href=http://openlightgroup.net/Blog/tabid/58/EntryId/140/Phone-7-Back-Button-and-the-ListPicker-control.aspx&gt;More ...&lt;/a&gt;</description>
      <author>webmaster@openlightgroup.net</author>
      <comments>http://openlightgroup.net/Blog/tabid/58/EntryId/140/Phone-7-Back-Button-and-the-ListPicker-control.aspx#Comments</comments>
      <slash:comments>3</slash:comments>
      <guid isPermaLink="true">http://openlightgroup.net/Blog/tabid/58/EntryId/140/Phone-7-Back-Button-and-the-ListPicker-control.aspx</guid>
      <pubDate>Sat, 04 Dec 2010 18:55:46 GMT</pubDate>
      <trackback:ping>http://www.openlightgroup.netDesktopModules/BlogTrackback.aspx?id=140</trackback:ping>
    </item>
    <item>
      <title>Embrace your designer!</title>
      <link>http://openlightgroup.net/Blog/tabid/58/EntryId/124/Embrace-your-designer.aspx</link>
      <description>&lt;p&gt;Now before you go run off and start hugging the graphic artist down the hall, please finish reading this post. &lt;strong&gt;&lt;em&gt;We don’t want any HR issues, now do we?&lt;/em&gt;&lt;/strong&gt; &lt;/p&gt;  &lt;p&gt;I tend to agree with what Michael is saying in his post (&lt;a href="http://www.openlightgroup.nethttp://www.openlightgroup.net/Blog/tabid/58/EntryId/112/Silverlight-Why-I-feel-ldquo-Design-Is-The-Most-Important-Thing-rdquo.aspx" target="_blank"&gt;Silverlight: Why I feel “Design Is The Most Important Thing”&lt;/a&gt;), and think that it deserves some serious consideration by any professional developer. Far too long have we (developers) under valued how much a good “design” plays a part in good software. However, the designer I am referring to in this article spans graphic artists, UI designers, developers, machinist, architects, civil engineers… and on and on. This “designer” is the one that lives in all of us (yes you can now hug yourself if you like, but still not exactly what I’m talking about either). What I am trying to illustrate in this article is that we all have the ability to evaluate a good design or a poor design, granted this ability has varying degrees. Additionally, a lot of us are able to say “something about this just isn’t right” or “I love this… but I can’t say why exactly” but have not sharpened the skills to what our intuition is telling us.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://www.openlightgroup.net/Portals/0/Blog/Files/2/124/WLW-Embraceyourdesigner_76A8-PoorDesign.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="PoorDesign" border="0" alt="PoorDesign" src="/Portals/0/Blog/Files/2/124/WLW-Embraceyourdesigner_76A8-PoorDesign_thumb.png" width="260" height="176" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;(Image taken from the book &lt;a href="http://www.amazon.com/gp/product/0465067107?ie=UTF8&amp;tag=itlnet-20&amp;linkCode=as2&amp;camp=1789&amp;creative=390957&amp;creativeASIN=0465067107"&gt;The Design of Everyday Things&lt;/a&gt;&lt;img style="border-bottom-style: none !important; border-right-style: none !important; margin: 0px; border-top-style: none !important; border-left-style: none !important" border="0" alt="" src="http://www.assoc-amazon.com/e/ir?t=itlnet-20&amp;l=as2&amp;o=1&amp;a=0465067107" width="1" height="1" /&gt; which illustrates the idea that many times throughout history people have not listened or acknowledged their inner designer and in turn have caused poor design to take root in our world)&lt;/p&gt;  &lt;p&gt;Now this is where a few feathers are going to get ruffled, and honestly I kind of hope they do because I feel that they need to be. We developers are some of the biggest offenders when it comes to introducing poor design into the world and therefore the lives of others. Let’s be honest (this includes me and maybe this article is a form of confession), we know that our grey squares and white backgrounds are hideous! We know that the “Save Changes” button that is enabled even though there are no changes(!!!) confuses and frustrates users. We know that sticking the cool little animated gif on the page to tell the user &lt;em&gt;something&lt;/em&gt; is “Loading” or even better the one that lets the user know that &lt;em&gt;something&lt;/em&gt; is “Processing” (seriously do &lt;em&gt;&lt;strong&gt;we&lt;/strong&gt;&lt;/em&gt; even know what is processing?) for minutes doesn’t really cut it. The only feature that these poor designs provide is user frustration and calls to our typically over worked support teams. The list could go on and on, and we can come up for an excuse for each example. Like “when I started doing development it was so hard to make things look pretty” or “it takes too long to style an entire application and clients really don’t want to pay for that.” &lt;/p&gt;  &lt;p&gt;While some of these excuses may contain a bit of truth, they no longer provide the shelter we used to hide under. The truth is clients no longer care if the software simply works. It must provide an intuitive and enjoyable experience! I believe the world is transitioning from the “Information Age” into the “Innovation Age” and we have to grab a board and surf the wave or be swallowed by the undertow. Technology has moved us past the “wow I can actually get real-time stock information from the web” to “this has to feel like we are really interacting with this data.” Things like multi-touch and accelerometers have given us the ability to “get our hands” into the digital world! Seriously, who doesn’t want that awesome interface from Minority Report?!?!&lt;/p&gt;  &lt;p&gt;&lt;object width="640" height="385"&gt;&lt;param name="movie" value="http://www.youtube.com/v/NwVBzx0LMNQ?fs=1&amp;hl=en_US"&gt;&lt;/param&gt;&lt;param name="allowFullScreen" value="true"&gt;&lt;/param&gt;&lt;param name="allowscriptaccess" value="always"&gt;&lt;/param&gt;&lt;embed src="http://www.youtube.com/v/NwVBzx0LMNQ?fs=1&amp;hl=en_US" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="640" height="385"&gt;&lt;/embed&gt;&lt;/object&gt;&lt;/p&gt;  &lt;p&gt;Each day brings us closer to that reality in our homes, offices and even pockets. However, it is up to us the developers, architects and designers to make this reality happen. So, I suppose this is a call to arms of sorts. It is time for us to tear down the wall between the technological specialties (developers, graphic designers, interactive designers, solution architects, etc.) and realize we ALL play a part in the overall design of our digital world. Each of us needs to open our eyes a little wider and look around. We need to focus on questions like: What in our world is enjoyable to use? Why does it feel that way? What can we do to make our software/solutions feel this way?&lt;/p&gt;  &lt;p&gt;The revolution begun in my mind thanks to a series of books that I have read over the last few months. I credit my director for starting me on this journey by discussing the innovation firm IDEO with our team at work and showing us the television special showing how the successfully redesign the shopping cart is a week. Below is part one of the special, there are three parts to the episode. The other two videos should show up in the related videos once part one completes. I highly recommend watching the entire series!&lt;/p&gt;  &lt;p&gt;&lt;object width="480" height="385"&gt;&lt;param name="movie" value="http://www.youtube.com/v/oUazVjvsMHs?fs=1&amp;hl=en_US"&gt;&lt;/param&gt;&lt;param name="allowFullScreen" value="true"&gt;&lt;/param&gt;&lt;param name="allowscriptaccess" value="always"&gt;&lt;/param&gt;&lt;embed src="http://www.youtube.com/v/oUazVjvsMHs?fs=1&amp;hl=en_US" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="480" height="385"&gt;&lt;/embed&gt;&lt;/object&gt;&lt;/p&gt;  &lt;p&gt;One of the interesting pieces of information in these videos is that their “design team” is made up of people from drastically different backgrounds. For example, there is a anthropologist, a biologist, an engineer, a linguist etc. Each of these individuals provide a unique perspective to the concepts explored by the team allowing for a more holistic vision of the “problem domain” or “design challenge.” The idea that we are all designers started here for me and the was further affirmed while reading the &lt;a href="http://www.amazon.com/gp/product/1591843170?ie=UTF8&amp;tag=itlnet-20&amp;linkCode=as2&amp;camp=1789&amp;creative=390957&amp;creativeASIN=1591843170"&gt;Purple Cow&lt;/a&gt;&lt;img style="border-bottom-style: none !important; border-right-style: none !important; margin: 0px; border-top-style: none !important; border-left-style: none !important" border="0" alt="" src="http://www.assoc-amazon.com/e/ir?t=itlnet-20&amp;l=as2&amp;o=1&amp;a=1591843170" width="1" height="1" /&gt; book recommended to me by my teammate Ken. This book as well as the book &lt;a href="http://www.amazon.com/gp/product/0071638938?ie=UTF8&amp;tag=itlnet-20&amp;linkCode=as2&amp;camp=1789&amp;creative=390957&amp;creativeASIN=0071638938"&gt;Innovate the Pixar Way&lt;/a&gt;&lt;img style="border-bottom-style: none !important; border-right-style: none !important; margin: 0px; border-top-style: none !important; border-left-style: none !important" border="0" alt="" src="http://www.assoc-amazon.com/e/ir?t=itlnet-20&amp;l=as2&amp;o=1&amp;a=0071638938" width="1" height="1" /&gt; really started the process of questioning my internal design processes and the way I view innovation and what is remarkable. Another great book that helped to inspire and clarify a refinement of the design process I will be using from now on is &lt;a href="http://www.amazon.com/gp/product/0789742799?ie=UTF8&amp;tag=itlnet-20&amp;linkCode=as2&amp;camp=1789&amp;creative=390957&amp;creativeASIN=0789742799"&gt;Dynamic Prototyping with SketchFlow in Expression Blend: Sketch Your Ideas...And Bring Them to Life!&lt;/a&gt;&lt;img style="border-bottom-style: none !important; border-right-style: none !important; margin: 0px; border-top-style: none !important; border-left-style: none !important" border="0" alt="" src="http://www.assoc-amazon.com/e/ir?t=itlnet-20&amp;l=as2&amp;o=1&amp;a=0789742799" width="1" height="1" /&gt; This book made me realize that I was insulting SketchFlow with my half hearted attempts to use the tool. It is so much more powerful than I gave it credit for! However, the power is not the tool in and of itself but how the tool allows us to change the way we design our applications. The relationship and feedback that is created when it is used properly is priceless!&lt;/p&gt;  &lt;p&gt;So I know this post may seem a bit too abstract and/or sporadic when compared to other content on this site that focuses on “how to” do things. However, I have found a new way of seeing the world and feel inspired to make better designs and encourage you to do so. Michael has definitely caught the design bug and is learning to surf the new wave. Many of the topics he discussed in his &lt;a href="http://www.openlightgroup.nethttp://www.openlightgroup.net/Blog/tabid/58/EntryId/112/Silverlight-Why-I-feel-ldquo-Design-Is-The-Most-Important-Thing-rdquo.aspx" target="_blank"&gt;article&lt;/a&gt; are the more practical examples of the underlying concepts I have been trying to bring to light. Believe me, I agree 100% that we need the artistic folks ( &lt;em&gt;I AM NOT ONE OF THEM NO MATTER HOW MUCH I WISH I WAS&lt;/em&gt; ) such as the graphic designers and UI specialists! We are not all that kind of designer, but we all design what we are specialists at. For example, the graphic artist that make the amazing visual artifacts for the application typically has no idea how to “design” the service that the application is going to need to fill that visual with useful data. For a developer or application architect it is our job to design a great experience by building a great service to return that data in a way that allows the visual designers work to really be appreciated. No more three minutes of watching a progress bar as we retrieve data! Design your service to be responsive, otherwise no matter how great the application looks it will still “feel” clunky. (Michael has another post that give some good information about new tools to help design a more responsive application: &lt;a href="http://www.openlightgroup.net/Blog/tabid/58/EntryId/99/Simple-Silverlight-4-Example-Using-oData-and-RX-Extensions.aspx" target="_blank"&gt;Simple Silverlight 4 Example Using oData and RX Extensions&lt;/a&gt;)&lt;/p&gt;  &lt;p&gt;To wrap up this rant, there are a lot of resources out about what good design is, processes used to create good designs and tools to help you implement the designs. I encourage, maybe even beg, you to check out some of the books, videos and articles I mentioned here. I truly hope you find inspiration to take your “designing” to the next level and to push those around you to do the same. We are all victims of bad design, but we have the power to change that… it is our world that we are creating.&lt;/p&gt;  &lt;p&gt;So now that you have read this, there is only one question that needs to be answered to determine the direction of our collective future:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://www.openlightgroup.net/Portals/0/Blog/Files/2/124/WLW-Embraceyourdesigner_76A8-6644The_red_pill_or_the_blue_pill_2.jpg"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="6644The_red_pill_or_the_blue_pill" border="0" alt="6644The_red_pill_or_the_blue_pill" src="/Portals/0/Blog/Files/2/124/WLW-Embraceyourdesigner_76A8-6644The_red_pill_or_the_blue_pill_thumb.jpg" width="244" height="148" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;&lt;em&gt;“You take the blue pill - the story ends, you wake up in your bed and believe whatever you want to believe. You take the red pill - you stay in Wonderland and I show you how deep the rabbit-hole goes.”&lt;/em&gt;&lt;/p&gt;&lt;br /&gt;&lt;a href=http://openlightgroup.net/Blog/tabid/58/EntryId/124/Embrace-your-designer.aspx&gt;More ...&lt;/a&gt;</description>
      <author>webmaster@openlightgroup.net</author>
      <comments>http://openlightgroup.net/Blog/tabid/58/EntryId/124/Embrace-your-designer.aspx#Comments</comments>
      <slash:comments>1</slash:comments>
      <guid isPermaLink="true">http://openlightgroup.net/Blog/tabid/58/EntryId/124/Embrace-your-designer.aspx</guid>
      <pubDate>Fri, 03 Sep 2010 04:29:06 GMT</pubDate>
      <trackback:ping>http://www.openlightgroup.netDesktopModules/BlogTrackback.aspx?id=124</trackback:ping>
    </item>
    <item>
      <title>St. Louis Day of .Net Review</title>
      <link>http://openlightgroup.net/Blog/tabid/58/EntryId/121/St-Louis-Day-of-Net-Review.aspx</link>
      <description>&lt;p&gt;&lt;strong&gt;AWESOME!&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;If you live anywhere near St. Louis, you have to attend this event next year! If you live further out and can still make it, it is definitely worth your time and money. Speaking of money, the registration fee was only $200 for two full days of learning. That is an amazing price! The value is incredible compared to the cost of attending TechEd or PDC or the other big conferences. I was privileged enough to attend TechEd in 2009 and had a great time, learned some cool stuff (and got to meet Michael in person for the first time). To compare the two conferences: Ounce for ounce STLDODN is either equal to or greater than the value I experienced at TechEd.&lt;/p&gt;  &lt;p&gt;The speakers were great, the topics were on point and the atmosphere was charged with excitement and passion… or maybe that was just all the free coffee I pounded down. Seriously, you could tell that the attendees where enjoying the sessions and excited about what they were learning. The caliber of speakers, again, was on par with one of the major conferences and brought with them some great knowledge and experience to share.&lt;/p&gt;  &lt;p&gt;I also feel that part of the increased value is due to the fact that most of the attendees and a fair amount of the speakers live and work in the area. This allows for some great “networking” (though I kind of dislike that term – prefer “relationship building”) and general socializing with others that are familiar with the local industry. I am convinced that St. Louis must have one of the greatest .Net communities in the country.&lt;/p&gt;  &lt;p&gt;And of course, there was schwag and prize giveaways. Some of the prizes included a laptop, a Wii, 1TB External HD (which I won!!! Thanks &lt;a href="http://www.stlouisdayofdotnet.com/Home.aspx" target="_blank"&gt;STLDODN&lt;/a&gt;!), software licenses and more!&lt;/p&gt;  &lt;p&gt;I just wanted to write a little blurb about my experience with the St. Louis Day of .Net and encourage anyone that can attend to definitely do so next year! Check out the &lt;a href="http://www.stlouisdayofdotnet.com/Home.aspx" target="_blank"&gt;St. Louis Day of .Net website&lt;/a&gt; for more information, and I will be sure and post something here and on Twitter (@itlackey) when registration for next year opens.&lt;/p&gt;  &lt;p&gt;Before I wrap up I wanted to say thanks to all the individuals that went the extra mile to make this happen and volunteered your time to make this event possible and the sponsors that contributed to keep the costs down.&lt;/p&gt;  &lt;p&gt;Special thanks to &lt;a href="http://www.stlouisdayofdotnet.com/SpeakerDetail.aspx?SpeakerID=17"&gt;Kevin Grossnicklaus&lt;/a&gt;, Scott Spradlin, &lt;a href="http://www.stlouisdayofdotnet.com/SpeakerDetail.aspx?SpeakerID=10"&gt;Chris Deweese&lt;/a&gt;, &lt;a href="http://www.stlouisdayofdotnet.com/SpeakerDetail.aspx?SpeakerID=29"&gt;Dru Sellers&lt;/a&gt;, &lt;a href="http://www.stlouisdayofdotnet.com/SpeakerDetail.aspx?SpeakerID=14"&gt;Jeff Fattic&lt;/a&gt;, &lt;a href="http://www.stlouisdayofdotnet.com/SpeakerDetail.aspx?SpeakerID=24"&gt;Brad Nunnally&lt;/a&gt; for taking the time after and between session to answer questions and help myself and my team become better at what we do!&lt;/p&gt;  &lt;p&gt;P.S. I did not write this just because I won the HD :P&lt;/p&gt;&lt;br /&gt;&lt;a href=http://openlightgroup.net/Blog/tabid/58/EntryId/121/St-Louis-Day-of-Net-Review.aspx&gt;More ...&lt;/a&gt;</description>
      <author>webmaster@openlightgroup.net</author>
      <comments>http://openlightgroup.net/Blog/tabid/58/EntryId/121/St-Louis-Day-of-Net-Review.aspx#Comments</comments>
      <slash:comments>4</slash:comments>
      <guid isPermaLink="true">http://openlightgroup.net/Blog/tabid/58/EntryId/121/St-Louis-Day-of-Net-Review.aspx</guid>
      <pubDate>Sun, 22 Aug 2010 16:53:28 GMT</pubDate>
      <trackback:ping>http://www.openlightgroup.netDesktopModules/BlogTrackback.aspx?id=121</trackback:ping>
    </item>
    <item>
      <title>How to show a ChildWindow from a ViewModel using a custom Action</title>
      <link>http://openlightgroup.net/Blog/tabid/58/EntryId/117/How-to-show-a-ChildWindow-from-a-ViewModel-using-a-custom-Action.aspx</link>
      <description>&lt;p&gt;We this is a classic example of “the early bird gets the worm.” I have been on hiatus for far too long, but have not been idle. I have actually been planning this blog entry for a few weeks, along with another one (more on this in a minute). As it turns out, Michael and Haruhiro where working on pretty much the same concept. They beat me to the finish line with there solution as you can see here: &lt;a title="http://openlightgroup.nethttp://www.openlightgroup.nethttp://www.openlightgroup.nethttp://www.openlightgroup.net/Blog/tabid/58/EntryId/116/Using-the-ldquo-Hisowa-Simple-PopUp-Behavior-rdquo-in-a-DataGrid.aspx" href="http://www.openlightgroup.nethttp://www.openlightgroup.nethttp://www.openlightgroup.net/Blog/tabid/58/EntryId/116/Using-the-ldquo-Hisowa-Simple-PopUp-Behavior-rdquo-in-a-DataGrid.aspx" target="_blank"&gt;Using the “Hisowa Simple PopUp Behavior” in a DataGrid&lt;/a&gt;. Since I took a slightly different approach, I decided to go ahead and post this article. &lt;/p&gt;  &lt;p&gt;Additionally, I believe that the more information is examined the best solution will be formed based on pieces of all the information. I want to be very clear, I think the solution described in Haruhiro’s article is great! This article is not being posted to “one up” or discredit Haruhiro’s work in any way and I suggest that if you have not read his post, you should.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Side Note:      &lt;br /&gt;&lt;/strong&gt;The other blog entry I planned on posting is titled “Embrace your Designer” and is along some of the same topics as Michael’s post &lt;a href="http://www.openlightgroup.net/Blog/tabid/58/EntryId/112/Silverlight-Why-I-feel-ldquo-Design-Is-The-Most-Important-Thing-rdquo.aspx"&gt;Silverlight: Why I feel “Design Is The Most Important Thing”&lt;/a&gt;. After seeing the articles that Michael and Haruhiro put together, I had to tell Michael to “stop stealing my ideas!” I am seriously starting to wonder if he “chipped” me when I met up with him in Cali.&lt;/p&gt;  &lt;p&gt;With that said, “now for something completely different” … well kind of.&lt;/p&gt;  &lt;p&gt;I have seen many example and questions regarding how to use a childwindow control when using MVVM. Most examples have either been highly criticized as not “pure MVVM” or overly complicated for a majority of applications. To me, one of the main benefits of MVVM is the simplicity that comes with the pattern. Why then would you want to implement an entire “Childwindow Service Layer” or something equally as complicated? So I started thinking “there has to be an easy way to do this in a MVVM purest fashion.”  That lead to the idea of building a behavior (or action to be specific) that could show a childwindow control. Thanks to the selection of triggers built into Silverlight, the action could be invoked several different ways with no code necessary.&lt;/p&gt;  &lt;p&gt;For example, here is a button that is wired to a command on a ViewModel.&lt;/p&gt;  &lt;p&gt; &lt;/p&gt;  &lt;pre style="border-bottom: #cecece 1px solid; border-left: #cecece 1px solid; padding-bottom: 5px; background-color: #fbfbfb; min-height: 40px; padding-left: 5px; width: 650px; padding-right: 5px; overflow: auto; border-top: #cecece 1px solid; border-right: #cecece 1px solid; padding-top: 5px"&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;   &lt;span style="color: #0000ff"&gt;&lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;Button&lt;/span&gt; &lt;span style="color: #ff0000"&gt;x&lt;/span&gt;:&lt;span style="color: #ff0000"&gt;Name&lt;/span&gt;=&lt;span style="color: #0000ff"&gt;"button"&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: 12px"&gt;     &lt;span style="color: #ff0000"&gt;Content&lt;/span&gt;=&lt;span style="color: #0000ff"&gt;"Use Command"&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: 12px"&gt;     &lt;span style="color: #ff0000"&gt;Command&lt;/span&gt;=&lt;span style="color: #0000ff"&gt;"{Binding RequestResponseCommand}"&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: 12px"&gt;     &lt;span style="color: #0000ff"&gt;/&gt;&lt;/span&gt;&lt;/pre&gt;&lt;/pre&gt;

&lt;p&gt; &lt;/p&gt;

&lt;p&gt;The command on the ViewModel simply raises an event:&lt;/p&gt;

&lt;pre style="border-bottom: #cecece 1px solid; border-left: #cecece 1px solid; padding-bottom: 5px; background-color: #fbfbfb; min-height: 40px; padding-left: 5px; width: 650px; padding-right: 5px; overflow: auto; border-top: #cecece 1px solid; border-right: #cecece 1px solid; padding-top: 5px"&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;        &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;void&lt;/span&gt; RequestResponse(&lt;span style="color: #0000ff"&gt;object&lt;/span&gt; param)
&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;        {
&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;            &lt;span style="color: #0000ff"&gt;if&lt;/span&gt; (&lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.RequestingResponse != &lt;span style="color: #0000ff"&gt;null&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: 12px"&gt;                &lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.RequestingResponse(&lt;span style="color: #0000ff"&gt;this&lt;/span&gt;, &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; EventArgs());
&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;        }&lt;/pre&gt;&lt;/pre&gt;

&lt;p&gt; &lt;/p&gt;

&lt;p&gt;Which is handled by an EventTrigger that has the ShowChildWindowAction associated with it:&lt;/p&gt;

&lt;pre style="border-bottom: #cecece 1px solid; border-left: #cecece 1px solid; padding-bottom: 5px; background-color: #fbfbfb; min-height: 40px; padding-left: 5px; width: 650px; padding-right: 5px; overflow: auto; border-top: #cecece 1px solid; border-right: #cecece 1px solid; padding-top: 5px"&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;&lt;span style="color: #0000ff"&gt;&lt;&lt;/span&gt;&lt;span style="color: #c71585"&gt;i&lt;/span&gt;:&lt;span style="color: #800000"&gt;EventTrigger&lt;/span&gt; &lt;span style="color: #ff0000"&gt;SourceObject&lt;/span&gt;=&lt;span style="color: #0000ff"&gt;"{Binding}"&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: 12px"&gt;                &lt;span style="color: #ff0000"&gt;EventName&lt;/span&gt;=&lt;span style="color: #0000ff"&gt;"RequestingResponse"&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&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: 12px"&gt;&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;    &lt;span style="color: #0000ff"&gt;&lt;&lt;/span&gt;&lt;span style="color: #c71585"&gt;behaviors&lt;/span&gt;:&lt;span style="color: #800000"&gt;ShowChildWindowAction&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: 12px"&gt;&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;        &lt;span style="color: #0000ff"&gt;&lt;&lt;/span&gt;&lt;span style="color: #c71585"&gt;behaviors&lt;/span&gt;:&lt;span style="color: #800000"&gt;ShowChildWindowAction.ChildWindow&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&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: 12px"&gt;            &lt;span style="color: #0000ff"&gt;&lt;&lt;/span&gt;&lt;span style="color: #c71585"&gt;controls&lt;/span&gt;:&lt;span style="color: #800000"&gt;ResponseWindow&lt;/span&gt; &lt;span style="color: #ff0000"&gt;x&lt;/span&gt;:&lt;span style="color: #ff0000"&gt;Name&lt;/span&gt;=&lt;span style="color: #0000ff"&gt;"CommandWindow"&lt;/span&gt; &lt;span style="color: #0000ff"&gt;/&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: 12px"&gt;        &lt;span style="color: #0000ff"&gt;&lt;/&lt;/span&gt;&lt;span style="color: #c71585"&gt;behaviors&lt;/span&gt;:&lt;span style="color: #800000"&gt;ShowChildWindowAction.ChildWindow&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&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: 12px"&gt;    &lt;span style="color: #0000ff"&gt;&lt;/&lt;/span&gt;&lt;span style="color: #c71585"&gt;behaviors&lt;/span&gt;:&lt;span style="color: #800000"&gt;ShowChildWindowAction&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&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: 12px"&gt;&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;&lt;span style="color: #0000ff"&gt;&lt;/&lt;/span&gt;&lt;span style="color: #c71585"&gt;i&lt;/span&gt;:&lt;span style="color: #800000"&gt;EventTrigger&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&gt;&lt;/span&gt;&lt;/pre&gt;&lt;/pre&gt;

&lt;p&gt;So that is all that is needed to display a childwindow; however, that is not very useful in and of itself. Typically we want to know if the window was “cancelled” or “confirmed” and be able to response accordingly. We sometimes also want to have a custom childwindow and to know if any data was changed in the childwindow. This action allows for those scenarios through a set of five properties.&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;AttachDataContext: If set to true, attaches the DataContext of the control the EventTrigger is associated with. This is useful if you want to send the ViewModel (or any other DataContext) to the childwindow for binding purposes etc. 
    &lt;ul&gt;
      &lt;li&gt;&lt;em&gt;&lt;strong&gt;Note: If you attach the DataContext to the childwindow, any properties changed on that DataContext will change immediately and will not be undone if the window is cancelled.&lt;/strong&gt;&lt;/em&gt; &lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;

  &lt;li&gt;ClosedCommand: The ICommand to be executed when the childwindow is closed. &lt;/li&gt;

  &lt;li&gt;CommandParameterProperty: The property name of the childwindow control that is used as the parameter of the ClosedCommand when executed. &lt;/li&gt;

  &lt;li&gt;ExecuteCommandOnCancel: Specifies if the ClosedCommand should be executed if the DialogResult of the window is “cancelled” or closed. &lt;/li&gt;

  &lt;li&gt;ChildWindow: Is a nested childwindow control that is created and shown when the action is invoked. This allows you to build and customize a control that inherits from ChildWindow and use it as the window to be shown. &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Here is an example of what the XAML might look like for a button that calls a command only with the DialogResult of a custom ChildWindow control is true and pass the value of the Response property of the ChildWindow to the command:&lt;/p&gt;

&lt;pre style="border-bottom: #cecece 1px solid; border-left: #cecece 1px solid; padding-bottom: 5px; background-color: #fbfbfb; min-height: 40px; padding-left: 5px; width: 650px; padding-right: 5px; overflow: auto; border-top: #cecece 1px solid; border-right: #cecece 1px solid; padding-top: 5px"&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;&lt;span style="color: #0000ff"&gt;&lt;&lt;/span&gt;&lt;span style="color: #c71585"&gt;behaviors&lt;/span&gt;:&lt;span style="color: #800000"&gt;ShowChildWindowAction&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: 12px"&gt;                                    &lt;span style="color: #ff0000"&gt;CommandParameterProperty&lt;/span&gt;=&lt;span style="color: #0000ff"&gt;"Response"&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: 12px"&gt;                                    &lt;span style="color: #ff0000"&gt;ClosedCommand&lt;/span&gt;=&lt;span style="color: #0000ff"&gt;"{Binding UpdateResponseCommand}"&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&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: 12px"&gt;    &lt;span style="color: #0000ff"&gt;&lt;&lt;/span&gt;&lt;span style="color: #c71585"&gt;behaviors&lt;/span&gt;:&lt;span style="color: #800000"&gt;ShowChildWindowAction.ChildWindow&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&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: 12px"&gt;        &lt;span style="color: #0000ff"&gt;&lt;&lt;/span&gt;&lt;span style="color: #c71585"&gt;controls&lt;/span&gt;:&lt;span style="color: #800000"&gt;ResponseWindow&lt;/span&gt; &lt;span style="color: #ff0000"&gt;x&lt;/span&gt;:&lt;span style="color: #ff0000"&gt;Name&lt;/span&gt;=&lt;span style="color: #0000ff"&gt;"CommandWindow"&lt;/span&gt; &lt;span style="color: #0000ff"&gt;/&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: 12px"&gt;    &lt;span style="color: #0000ff"&gt;&lt;/&lt;/span&gt;&lt;span style="color: #c71585"&gt;behaviors&lt;/span&gt;:&lt;span style="color: #800000"&gt;ShowChildWindowAction.ChildWindow&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&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: 12px"&gt;&lt;span style="color: #0000ff"&gt;&lt;/&lt;/span&gt;&lt;span style="color: #c71585"&gt;behaviors&lt;/span&gt;:&lt;span style="color: #800000"&gt;ShowChildWindowAction&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&gt;&lt;/span&gt;&lt;/pre&gt;&lt;/pre&gt;

&lt;p&gt; &lt;/p&gt;

&lt;p&gt;Hopefully you are thinking, “Wow this is the greatest thing I have ever seen!” No? Okay, how about something more realistic like, “This seems useful, but how does it work?”&lt;/p&gt;

&lt;p&gt;Well, the action was actually fairly simple to build. All of the properties except for ClosedCommand and ChildWindow are standard properties. ClosedCommand is a dependency property that allows for the command to be bound to an ICommand property of your ViewModel. &lt;/p&gt;

&lt;p&gt;&lt;em&gt;&lt;strong&gt;Note&lt;/strong&gt;: I have included the source code for an example project so I will not show all of the code here. However, feel free to download the code and browse\use\modify it as you see fit.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;In the overridden OnAttached method we handle attaching the DataContext of the associated control and wiring up an event handler to the Closed event of the childwindow if needed.&lt;/p&gt;

&lt;pre style="border-bottom: #cecece 1px solid; border-left: #cecece 1px solid; padding-bottom: 5px; background-color: #fbfbfb; min-height: 40px; padding-left: 5px; width: 650px; padding-right: 5px; overflow: auto; border-top: #cecece 1px solid; border-right: #cecece 1px solid; padding-top: 5px"&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;&lt;span style="color: #0000ff"&gt;protected&lt;/span&gt; &lt;span style="color: #0000ff"&gt;override&lt;/span&gt; &lt;span style="color: #0000ff"&gt;void&lt;/span&gt; OnAttached()
&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;{
&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;    &lt;span style="color: #0000ff"&gt;base&lt;/span&gt;.OnAttached();
&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;    &lt;span style="color: #0000ff"&gt;if&lt;/span&gt; (&lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.AttachDataContext)
&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;        ChildWindow.DataContext = &lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.AssociatedObject.DataContext;
&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;    &lt;span style="color: #0000ff"&gt;if&lt;/span&gt; (&lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.ClosedCommand != &lt;span style="color: #0000ff"&gt;null&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: 12px"&gt;        ChildWindow.Closed += &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; EventHandler(window_Closed);
&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;}&lt;/pre&gt;&lt;/pre&gt;

&lt;p&gt; &lt;/p&gt;

&lt;p&gt;The window_Closed method is where we determine if we need to call the ClosedCommand based on the DialogResult and the ExecuteCommandOnCancel values. If so, we create the parameter for the command using reflection (&lt;em&gt;This ones for you Ken! :)&lt;/em&gt; ), if a CommandParameter value is specified. Finally we execute the ClosedCommand. Hopefully my C# is clearer than my English:&lt;/p&gt;

&lt;pre style="border-bottom: #cecece 1px solid; border-left: #cecece 1px solid; padding-bottom: 5px; background-color: #fbfbfb; min-height: 40px; padding-left: 5px; width: 650px; padding-right: 5px; overflow: auto; border-top: #cecece 1px solid; border-right: #cecece 1px solid; padding-top: 5px"&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;&lt;span style="color: #0000ff"&gt;void&lt;/span&gt; window_Closed(&lt;span style="color: #0000ff"&gt;object&lt;/span&gt; sender, EventArgs e)
&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;{
&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;    ChildWindow window = (ChildWindow)sender;
&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;    &lt;span style="color: #0000ff"&gt;if&lt;/span&gt; (&lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.ClosedCommand != &lt;span style="color: #0000ff"&gt;null&lt;/span&gt; &amp;&amp;
&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;        (&lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.ExecuteCommandOnCancel ||
&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;            (window.DialogResult.HasValue &amp;&amp; window.DialogResult.Value == &lt;span style="color: #0000ff"&gt;true&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: 12px"&gt;    {
&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;        &lt;span style="color: #0000ff"&gt;object&lt;/span&gt; param = &lt;span style="color: #0000ff"&gt;null&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: 12px"&gt;&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;        &lt;span style="color: #0000ff"&gt;if&lt;/span&gt; (!String.IsNullOrEmpty(&lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.CommandParameterProperty))
&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;            param = sender.GetType().GetProperty(&lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.CommandParameterProperty).GetValue(sender, &lt;span style="color: #0000ff"&gt;null&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: 12px"&gt;&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;        &lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.ClosedCommand.Execute(param);
&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;    }
&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"&gt;}&lt;/pre&gt;&lt;/pre&gt;

&lt;p&gt;The rest of the behavior is pretty straightforward. In the Invoke method we simply call Show on the childwindow and in the OnDetaching method we remove the Closed event handler. &lt;/p&gt;

&lt;p&gt;That about wraps it up. I intentionally chose the simplest way to provide the functionality that I required and I am sure there are MANY enhancements that can me made to this behavior. Some of which can probably be found in the &lt;a href="http://www.openlightgroup.nethttp://www.openlightgroup.nethttp://www.openlightgroup.net/Blog/tabid/58/EntryId/116/Using-the-ldquo-Hisowa-Simple-PopUp-Behavior-rdquo-in-a-DataGrid.aspx" target="_blank"&gt;HisowaSimplePopUpBehavior&lt;/a&gt;. Please do check out that &lt;a href="http://www.openlightgroup.nethttp://www.openlightgroup.nethttp://www.openlightgroup.net/Blog/tabid/58/EntryId/116/Using-the-ldquo-Hisowa-Simple-PopUp-Behavior-rdquo-in-a-DataGrid.aspx" target="_blank"&gt;article&lt;/a&gt; as well and use the foundations that have been laid here to make something awesome!&lt;/p&gt;

&lt;p&gt;I plan on included this control in the &lt;a href="http://olgcommon.codeplex.com/" target="_blank"&gt;OLGCommon&lt;/a&gt; project so keep your eye on that, and feel free to submit enhancements.&lt;/p&gt;

&lt;p&gt;As always, we value your feedback!&lt;/p&gt;

&lt;p&gt;Here is the source code for the example project and behavior: &lt;a href="http://www.openlightgroup.net/LinkClick.aspx?fileticket=uvgC%2bxeVZDg%3d" target="_blank"&gt;ShowChildWindowExample.zip&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Updated 8/14/2010: I have upload a new example project that removed the reference to the OLGCommon assembly and changed the ChildWindow property of the behavior to be a dependency property to allow for binding.&lt;/p&gt;&lt;br /&gt;&lt;a href=http://openlightgroup.net/Blog/tabid/58/EntryId/117/How-to-show-a-ChildWindow-from-a-ViewModel-using-a-custom-Action.aspx&gt;More ...&lt;/a&gt;</description>
      <author>webmaster@openlightgroup.net</author>
      <comments>http://openlightgroup.net/Blog/tabid/58/EntryId/117/How-to-show-a-ChildWindow-from-a-ViewModel-using-a-custom-Action.aspx#Comments</comments>
      <slash:comments>5</slash:comments>
      <guid isPermaLink="true">http://openlightgroup.net/Blog/tabid/58/EntryId/117/How-to-show-a-ChildWindow-from-a-ViewModel-using-a-custom-Action.aspx</guid>
      <pubDate>Sat, 14 Aug 2010 00:23:49 GMT</pubDate>
      <trackback:ping>http://www.openlightgroup.netDesktopModules/BlogTrackback.aspx?id=117</trackback:ping>
    </item>
  </channel>
</rss>
