<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:atom="https://www.w3.org/2005/Atom" xmlns:sy="https://purl.org/rss/1.0/modules/syndication/" xmlns:dc="https://purl.org/dc/elements/1.1/" xmlns:content="https://purl.org/rss/1.0/modules/content/" xmlns:wfw="https://wellformedweb.org/CommentAPI/" xmlns:slash="https://purl.org/rss/1.0/modules/slash/"
  version="2.0">
  <channel>
    <title>.NET Developer Guidance</title>
    <atom:link
      href="https://docs.microsoft.com/archive/blogs/kashiffl/feed.xml"
      rel="self"
      type="application/rss+xml" />
    <link>https://docs.microsoft.com/archive/blogs/kashiffl/feed.xml</link>
    <description>Karl Shifflett&amp;#039;s developer guidance for creating modular, loosely coupled, maintainable .NET applications</description>
    <lastBuildDate>Wed, 17 Apr 2019 04:02:21 GMT</lastBuildDate>
    <language>en-US</language>
    <sy:updatePeriod>hourly</sy:updatePeriod>
    <sy:updateFrequency>1</sy:updateFrequency>
    <item>
      <title>To Every Thing There Is a Season</title>
      <link>https://docs.microsoft.com/archive/blogs/kashiffl/to-every-thing-there-is-a-season</link>
      <pubDate>Fri, 21 Oct 2011 07:14:56 GMT</pubDate>
      <dc:creator><![CDATA[karl140.6]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/kashiffl/2011/10/21/to-every-thing-there-is-a-season/</guid>
      <description><![CDATA[When someone leads with a quote from Ecclesiastes 3.1, you know some sort of change is about to be...]]></description>
      <content:encoded><![CDATA[<p>When someone leads with a quote from Ecclesiastes 3.1, you know some sort of change is about to be announced.</p>
<p>Friday, 28 Oct 2011 will be my last day in Redmond, and unfortunately Microsoft and the patterns &amp; practices team.</p>
<p>My decision to leave Redmond was driven solely by the&nbsp;real estate market in this area. This was a very difficult decision choosing between a life goal of building a new home, a short commute, and trying to stay with Microsoft in Redmond.</p>
<p>On 29 Oct 2011, I&rsquo;ll be moving to Boise, Idaho and after a short break will begin a new career with Gayle Manufacturing Company. I&rsquo;m looking forward to becoming part of the GMC family and transitioning back to an architect-developer role. Over the winter I&rsquo;ll work with a home builder and hope to break ground in March or April of 2012.</p>
<h1>Leaving Microsoft</h1>
<p>Leaving Redmond is easy (for the above reason), leaving Microsoft is difficult. I&rsquo;m grateful for the opportunities I&rsquo;ve been given over the last 3 years. Except for the Marine Corps, Microsoft is the best company I&rsquo;ve ever worked for. I would not hesitate to recommend the opportunities at Microsoft to anyone, this super place to work.</p>
<p>I will very much miss the dedicated and very smart people at Microsoft. Leaving Redmond also means moving away from friends in the area; I will miss you as well.</p>
<h1>Prism</h1>
<p>For&nbsp;questions on Prism please post them here: <a href="https://compositewpf.codeplex.com/discussions">https://compositewpf.codeplex.com/discussions</a>. The Prism team provides outstanding support.</p>
<h1>Close</h1>
<p>I would love to stay in touch:</p>
<p>blog: <a href="https://karlshifflett.wordpress.com/">https://karlshifflett.wordpress.com/</a></p>
<p>twitter: <a href="https://twitter.com/#!/kdawg02">@kdawg02</a></p>
<p>&nbsp;</p>
<p>Microsoft and the people of Microsoft, thank you very much for the last three years.</p>
<p>&nbsp;</p>]]></content:encoded>
    </item>
    <item>
      <title>Released: Project Silk Client-Side Web Development for Modern Browsers</title>
      <link>https://docs.microsoft.com/archive/blogs/kashiffl/released-project-silk-client-side-web-development-for-modern-browsers</link>
      <pubDate>Sun, 18 Sep 2011 15:57:02 GMT</pubDate>
      <dc:creator><![CDATA[karl140.6]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/kashiffl/2011/09/18/released-project-silk-client-side-web-development-for-modern-browsers/</guid>
      <description><![CDATA[The Microsoft patterns &amp; practices team is excited to announce the release of Project Silk....]]></description>
      <content:encoded><![CDATA[<p>The Microsoft patterns &amp; practices team is excited to announce the release of Project Silk.</p>  <h1>Project Silk</h1>  <h3><em>Client-Side Web Development for Modern Browsers</em></h3>  <p>Project Silk provides guidance for building maintainable cross-browser web applications that are characterized by an intentional design, rich interactivity, and a responsive user interface (UI). The result is an immersive and engaging user experience (UX). Such applications take advantage of the latest web standards, including HTML5, CSS3, and ECMAScript version 5, and modern web technologies such as jQuery and ASP.NET MVC 3.</p>  <p>The concepts explained in this book are demonstrated via a real-world customer-facing web application called the Mileage Stats Reference Implementation (Mileage Stats). Mileage Stats allows users to track and compare their vehicles' fuel efficiency, usage, and operating costs, and to schedule vehicle maintenance reminders. The image below shows the Mileage Stats client-side objects and their implementation mapped to libraries or frameworks.</p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/40/09/metablogapi/2133.SilkArch_6AD8DD9B.jpg" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-40-09-metablogapi/2133.SilkArch_5F00_6AD8DD9B.jpg"><img style="background-image: none; border-right-width: 0px; margin: 0px 5px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="SilkArch" border="0" alt="SilkArch" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/40/09/metablogapi/4760.SilkArch_thumb_0A87B764.jpg" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-40-09-metablogapi/4760.SilkArch_5F00_thumb_5F00_0A87B764.jpg" width="480" height="271" /></a></p>  <p>Building a rich web application that reduces the number of full-page loads, includes animations, and is responsible for updating the UI dynamically requires a thoughtful approach to managing structure, modularity, communication, navigation, and data. The book details how the Project Silk team designed Mileage Stats and solved a number of challenges.</p>  <h2>Links</h2>  <ul>   <li><a href="https://www.microsoft.com/download/en/details.aspx?id=27290">Project Silk download</a></span> </li>    <li><a href="https://msdn.microsoft.com/en-us/library/hh396380.aspx">Project Silk Home Page on MSDN</a></span> </li>    <li><a href="https://silk.codeplex.com/">Project Silk Community on CodePlex</a></span> </li>    <li><a href="https://msdn.microsoft.com/en-us/library/hh404078.aspx">Project Silk Road Map</a></span> </li>    <li><a href="https://channel9.msdn.com/posts/Project-Silk-Mileage-Stats-Application">Mileage Stats Video</a> </li> </ul>  <h2>Audience</h2>  <ul>   <li>This guidance is intended for web developers and assumes you have some hands-on experience with ASP.NET MVC, CSS, HTML, JavaScript, and jQuery. </li> </ul>  <h2>In this Release</h2>  <ul>   <li>Project Silk Mileage Stats Reference Implementation full source code </li>    <li>Widget QuickStart documentation and source code </li>    <li>Unit Test Hands on Labs (3) </li>    <li>Project Silk: Client-Side Web Development for Modern Browsers online documentation </li>    <li>Mileage Stats Video </li> </ul>  <h2>About patterns &amp; practices</h2>  <p>The Microsoft patterns &amp; practices team provides a wide range of guidance to help customers save time and reduce risk on their software development projects by incorporating proven patterns and practices.&#160; This applied engineering guidance includes both production quality source code and in-depth documentation.</p>  <p>The guidance is designed to help software development teams:</p>  <ul>   <li>Make critical design and technology selection decisions by highlighting the appropriate solution architectures, technologies, and Microsoft products for common scenarios </li>    <li>Understand the most important concepts needed for success by explaining the relevant patterns and prescribing the important practices </li>    <li>Get started with a proven code base by providing thoroughly tested software and source code that embodies the recommendations </li> </ul>  <p>For more information: <a href="https://msdn.microsoft.com/practices">https://msdn.microsoft.com/practices</a></p>  <p>Have a great day,</p>  <p><span style="color: rgb(192,148,63)">Just a grain of sand on the worlds beaches.</span></p>]]></content:encoded>
    </item>
    <item>
      <title>Project Silk Drop 13</title>
      <link>https://docs.microsoft.com/archive/blogs/kashiffl/project-silk-drop-13</link>
      <pubDate>Wed, 13 Jul 2011 07:42:51 GMT</pubDate>
      <dc:creator><![CDATA[karl140.6]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/kashiffl/2011/07/13/project-silk-drop-13/</guid>
      <description><![CDATA[The patterns &amp; practices Web Guidance team released Drop 13 of Project Silk (7-13-2011). The...]]></description>
      <content:encoded><![CDATA[<p>The patterns &amp; practices Web Guidance team released <a href="https://silk.codeplex.com/releases/view/69914" target="_blank">Drop 13 of Project Silk (7-13-2011)</a><u></u>. The code changes for this release were minor.</p>  <p>Video</p>  <p>If you have not seen the Project Silk video check it out <a href="https://channel9.msdn.com/posts/Project-Silk-Mileage-Stats-Application" target="_blank">here</a>.</p>  <h1>Chapters</h1>  <p>The following chapters are ready for review:</p>  <ul>   <li>Design and Layout (new) </li>    <li>Modularity (early draft) </li>    <li>Communication (early draft) </li>    <li>Navigation (early draft) </li>    <li>Server-Side Implementation (updated) </li>    <li>Introduction (updated) </li>    <li>Architecture </li>    <li>Client Data Management and Caching </li>    <li>jQuery UI Widgets </li>    <li>Application Notifications </li>    <li>Security </li>    <li>Unit Testing Web Applications </li>    <li>Widget QuickStart </li>    <li>How to: Check UIElement Properties with Coded UI Test </li>    <li>How to: Create Automation Negative case with Coded UI Test </li>    <li>How to: Create Web Client UI Test using Coded UI Test </li> </ul>  <p>The following chapters are currently being written or will be started soon:</p>  <ul>   <li>HTML Templates </li> </ul>  <h1>Close</h1>  <p>We welcome and appreciate your feedback on the application and book content.</p>  <p>Have a great day,</p>  <p>Karl</p>  <p>   <p><span style="color: rgb(192,148,63)"></span></p></p>]]></content:encoded>
    </item>
    <item>
      <title>Project Silk Documentation Drop: New Chapters Ready for Review</title>
      <link>https://docs.microsoft.com/archive/blogs/kashiffl/project-silk-documentation-drop-new-chapters-ready-for-review</link>
      <pubDate>Wed, 25 May 2011 08:36:55 GMT</pubDate>
      <dc:creator><![CDATA[karl140.6]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/kashiffl/2011/05/25/project-silk-documentation-drop-new-chapters-ready-for-review/</guid>
      <description><![CDATA[Project Silk from patterns &amp; practices, provides guidance for building cross-browser Web...]]></description>
      <content:encoded><![CDATA[<p><a href="https://silk.codeplex.com/" target="_blank">Project Silk</a> from patterns &amp; practices, provides guidance for building cross-browser Web applications with a focus on client-side interactivity. These applications take advantage of the latest Web standards like HTML5, CSS3 and ECMAScript 5 along with modern Web technologies such as jQuery, Internet Explorer 9 and ASP.NET MVC3. </p>  <h1>Guidance Chapters Ready for Review</h1>  <p><a href="https://silk.codeplex.com/releases/view/66995" target="_blank">Today’s drop</a> includes the following chapters (provided in CHM or PDF format) that are ready for community review. Our team very much appreciates your feedback and technical review. All documentation feedback should be posted in the <a href="https://silk.codeplex.com/workitem/list/basic" target="_blank">Issue Tracker</a>; if required, a document can be attached along with the feedback. </p>  <ul>   <li>Architecture </li>    <li>jQuery UI Widgets </li>    <li>Server-Side Implementation </li>    <li>Security </li>    <li>Unit Testing Web Applications </li>    <li>Widget QuickStart </li>    <li>How to: Check UIElement Properties with Coded UI Test </li>    <li>How to: Create Automation Negative case with Coded UI Test </li>    <li>How to: Create Web Client Test Automation with Coded UI Test </li> </ul>  <h1>jQuery UI Widget Chapter</h1>  <p>The jQuery UI Widget chapter provides comprehensive coverage of the jQuery UI Widget Factory and how to author your own widgets. </p>  <p>Project Silk uses widgets to modularize its client-side JavaScript. Widgets are powerful objects that provide a good amount of built-in infrastructure yet are simple to use. The above Architecture chapter provides the high-level view of Project Silk and explains the important role widgets play.</p>  <p>What you can expect to learn from the widget chapter:</p>  <ul>   <li>How to define and apply widgets </li>    <li>How to manage the lifetime of widgets </li>    <li>How to define default options that permit overrides and change notifications </li>    <li>How to use options for decoupling behavior and facilitating event subscriptions </li>    <li>How to use private methods to improve the readability of the code </li>    <li>How to define and use public methods, properties, and events </li>    <li>How to inherit from a base widget </li> </ul>  <h1>Downloads</h1>  <p>Latest documentation drop (24 May 2011): <a href="https://silk.codeplex.com/releases/view/66995">https://silk.codeplex.com/releases/view/66995</a></p>  <p>Latest code drop (Drop 9 – 10 May 2011): <a href="https://silk.codeplex.com/releases/view/66045">https://silk.codeplex.com/releases/view/66045</a></p>  <p>Have a great day,</p>  <p>Karl </p>]]></content:encoded>
    </item>
    <item>
      <title>Registration Open for Prism, Unity, WPF, MVVM Boise Training Event</title>
      <link>https://docs.microsoft.com/archive/blogs/kashiffl/registration-open-for-prism-unity-wpf-mvvm-boise-training-event</link>
      <pubDate>Thu, 12 May 2011 17:35:29 GMT</pubDate>
      <dc:creator><![CDATA[karl140.6]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/kashiffl/2011/05/12/registration-open-for-prism-unity-wpf-mvvm-boise-training-event/</guid>
      <description><![CDATA[Registration is now open for the&#160; patterns &amp; practices Prism, Unity, WPF, MVVM training...]]></description>
      <content:encoded><![CDATA[<p><img src="https://compositewpf.codeplex.com/Images/pnp_logo.png" /></p>  <p><font color="#333333">Registration is now open for the&#160; <a href="https://msdn.microsoft.com/en-us/practices/bb190332" target="_blank">patterns &amp; practices</a><font color="#0066cc"></font> <a href="https://compositewpf.codeplex.com/" target="_blank"><font color="#0066cc">Prism</font></a>, <a href="https://unity.codeplex.com/" target="_blank"><font color="#0066cc">Unity</font></a>, WPF, <a href="https://karlshifflett.wordpress.com/2010/11/07/in-the-box-ndash-mvvm-training/" target="_blank"><font color="#0066cc">MVVM training</font></a> event, 27-29 June in Boise, ID. All event information can be found on the registration page.</font></p>  <p><strong>Register:</strong>&#160; <a href="https://prismboise-eorg.eventbrite.com/" target="_blank">https://prismboise-eorg.eventbrite.com/</a></p>  <p>In addition a dinner is planned for Sunday, 26 June at the <a href="https://www.goodwoodbbq.com/" target="_blank">Goodwood Barbecue Company</a> at 6:00pm.</p>  <p><strong>Register:</strong> <a href="https://prismboisedinner-eorg.eventbrite.com/" target="_blank">https://prismboisedinner-eorg.eventbrite.com/</a></p>  <p>Very much looking forward to these events.</p>  <p>Have a great day,</p>  <p>Karl</p>]]></content:encoded>
    </item>
    <item>
      <title>Announcing a Prism, Unity, WPF, MVVM Training Event</title>
      <link>https://docs.microsoft.com/archive/blogs/kashiffl/announcing-a-prism-unity-wpf-mvvm-training-event</link>
      <pubDate>Sat, 07 May 2011 10:00:00 GMT</pubDate>
      <dc:creator><![CDATA[karl140.6]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/kashiffl/2011/05/07/announcing-a-prism-unity-wpf-mvvm-training-event/</guid>
      <description><![CDATA[Save the dates for a 3 day patterns &amp; practices&nbsp;Prism, Unity, WPF, MVVM training event,...]]></description>
      <content:encoded><![CDATA[<p><img src="https://compositewpf.codeplex.com/Images/pnp_logo.png" style="margin: 0px 5px;" /></p>
<p>Save the dates for a 3 day <a target="_blank" href="https://msdn.microsoft.com/en-us/practices/bb190332">patterns &amp; practices</a>&nbsp;<a target="_blank" href="https://compositewpf.codeplex.com/">Prism</a>, <a target="_blank" href="https://unity.codeplex.com/">Unity</a>, WPF, <a target="_blank" href="https://karlshifflett.wordpress.com/2010/11/07/in-the-box-ndash-mvvm-training/">MVVM training</a> event, 27-29 June in Boise, ID.</p>
<p>Join three Prism Team members <a target="_blank" href="https://blogs.msdn.com/b/bobbrum/">Bob Brumfield</a> (lead developer), <a target="_blank" href="https://blogs.southworks.net/geoff/">Geoff Cox</a> (developer), and myself (program manager) for an information packed 2 days of instruction followed up by a day of pair-programming.</p>
<p>Day one will consist of WPF and MVVM topics; day two Prism 4.0 and Unity; day three is dedicated to pair-programming, getting your questions answered, and an opportunity for you to apply the last two days&rsquo; training against your scenarios and programming style. The pair-programming day is always so much fun along with some wicked coding.</p>
<p>This is a free event for 75 attendees. Each seat has a desktop, power and wireless.</p>
<p>Registration will open soon and will be announced on my blog and twitter.</p>
<p>Very much looking forward to spending time with developers and taking in the beauty of Idaho.</p>
<p>Have a great day,</p>
<p>Karl</p>
<p><span style="color: #c0943f;">&nbsp;</span></p>]]></content:encoded>
    </item>
    <item>
      <title>Project Silk jQuery UI Widget QuickStart</title>
      <link>https://docs.microsoft.com/archive/blogs/kashiffl/project-silk-jquery-ui-widget-quickstart</link>
      <pubDate>Mon, 11 Apr 2011 19:26:00 GMT</pubDate>
      <dc:creator><![CDATA[karl140.6]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/kashiffl/2011/04/11/project-silk-jquery-ui-widget-quickstart/</guid>
      <description><![CDATA[Project Silk provides guidance for building cross-browser Web applications with a focus on...]]></description>
      <content:encoded><![CDATA[<p><a target="_blank" href="https://silk.codeplex.com/">Project Silk</a> provides guidance for building cross-browser Web applications with a focus on client-side interactivity. These applications take advantage of the latest Web standards like HTML5, CSS3 and ECMAScript 5 along with modern Web technologies such as jQuery, Internet Explorer 9 and ASP.NET MVC3. </p>
<p>This Widget QuickStart illustrates the way <a target="_blank" href="https://silk.codeplex.com/">Project Silk</a> uses the <a target="_blank" href="https://docs.jquery.com/UI/Developer_Guide">jQuery UI widget factory</a> to create maintainable components that implement client-side behavior. The approach used in this QuickStart is often referred to as progressive enhancement. </p>
<h1>Business Scenario </h1>
<p>Our team has been asked to enable cross-browser, keyword lookup with hyperlinking to popular Internet websites. This feature will need to be added dynamically to all company web pages. </p>
<p>Another team has been tasked with tagging the web page keywords. The words will be dynamically tagged based on server-side business logic driven by agreements with 3<sup>rd</sup> parties. </p>
<p>The focus of this QuickStart will be enabling the client-side behavior for the tagged keywords. When a user hovers over a keyword, the browser will display a popup of popular links for that keyword from the delicious.com bookmarking service. </p>
<h1>Walkthrough </h1>
<p>To interact with the completed scenario, follow the below steps: </p>
<p>Open the <strong>default.htm</strong> file using Internet Explorer 9. After the file's content is displayed you'll need to click on the "Allow block content" button at the bottom of the browser window. This is a security feature of Internet Explorer 9. </p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/40/09/metablogapi/4251.WidgetQuickStartFigure10_262FC6F5.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-01-40-09-metablogapi/4251.WidgetQuickStartFigure10_5F00_262FC6F5.png"><img height="467" width="604" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/40/09/metablogapi/3187.WidgetQuickStartFigure10_thumb_6B386E5E.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-01-40-09-metablogapi/3187.WidgetQuickStartFigure10_5F00_thumb_5F00_6B386E5E.png" alt="WidgetQuickStartFigure10" border="0" title="WidgetQuickStartFigure10" style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" /></a></p>
<p>After allowing blocked content, you'll notice the keywords have a new color and have been underlined with a dash line as pictured below. </p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/40/09/metablogapi/6708.WidgetQuickStartFigure20_18B98E22.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-01-40-09-metablogapi/6708.WidgetQuickStartFigure20_5F00_18B98E22.png"><img height="466" width="604" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/40/09/metablogapi/8053.WidgetQuickStartFigure20_thumb_7F518AE7.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-01-40-09-metablogapi/8053.WidgetQuickStartFigure20_5F00_thumb_5F00_7F518AE7.png" alt="WidgetQuickStartFigure20" border="0" title="WidgetQuickStartFigure20" style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" /></a></p>
<p>Using your mouse, hover over an underlined keyword. A popup with the top 10 most popular links for that keyword will be displayed. Notice the keyword has been repeated in the title of the popup. </p>
<ol>
<li>One second after moving your mouse away from the keyword, the popup will close unless your mouse is within the boundary of the popup. </li>
<li>
<div>If the keyword is on the left side of the page the popup will open to the right of the mouse. If the keyword is on the right side of the page the popup will open to the left side of the mouse as in the below image. </div>
</li>
</ol>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/40/09/metablogapi/1512.WidgetQuickStartFigure30_65E987AD.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-01-40-09-metablogapi/1512.WidgetQuickStartFigure30_5F00_65E987AD.png"><img height="294" width="604" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/40/09/metablogapi/3582.WidgetQuickStartFigure30_thumb_05986176.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-01-40-09-metablogapi/3582.WidgetQuickStartFigure30_5F00_thumb_5F00_05986176.png" alt="WidgetQuickStartFigure30" border="0" title="WidgetQuickStartFigure30" style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" /></a></p>
<p>Move your mouse over the popup. You can now click on a link. When clicked, a new browser window will open and navigate to the URL of the clicked link. </p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/40/09/metablogapi/5241.WidgetQuickStartFigure40_3E430B83.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-01-40-09-metablogapi/5241.WidgetQuickStartFigure40_5F00_3E430B83.png"><img height="296" width="604" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/40/09/metablogapi/7888.WidgetQuickStartFigure40_thumb_30049293.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-01-40-09-metablogapi/7888.WidgetQuickStartFigure40_5F00_thumb_5F00_30049293.png" alt="WidgetQuickStartFigure40" border="0" title="WidgetQuickStartFigure40" style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" /></a></p>
<p>Moving your mouse out of the popup boundary will cause the popup to be closed. </p>
<h1>Conceptual View </h1>
<p>This section graphically illustrates the relationship of the jQuery UI widgets to the HTML page elements. </p>
<p>The image below shows a single <strong>infobox</strong> widget attached to the page's <strong>body</strong> element. Additionally, a <strong>tagger</strong> widget has been attached to each keyword. </p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/40/09/metablogapi/5635.WidgetQuickStartFigure50_085E1669.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-01-40-09-metablogapi/5635.WidgetQuickStartFigure50_5F00_085E1669.png"><img height="329" width="604" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/40/09/metablogapi/5228.WidgetQuickStartFigure50_thumb_2402A25F.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-01-40-09-metablogapi/5228.WidgetQuickStartFigure50_5F00_thumb_5F00_2402A25F.png" alt="WidgetQuickStartFigure50" border="0" title="WidgetQuickStartFigure50" style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" /></a></p>
<p>The below HTML reveals a keyword tagging strategy that leverages HTML5 data attributes. Each of the keywords has been wrapped in a <strong>span</strong> tag with the <strong>data-tag</strong> data attribute applied. For our scenario imagine the keyword wrapping was accomplished on the server-side. </p>
<pre class="code"><span style="color: blue">&lt;!</span><span style="color: maroon">DOCTYPE </span><span style="color: red">html</span><span style="color: blue">&gt;
&lt;</span><span style="color: maroon">html</span><span style="color: blue">&gt;
&lt;</span><span style="color: maroon">head</span><span style="color: blue">&gt;
  &lt;</span><span style="color: maroon">title</span><span style="color: blue">&gt;</span>Project Silk: Delicious Widget QuickStart<span style="color: blue">&lt;/</span><span style="color: maroon">title</span><span style="color: blue">&gt;
  &lt;</span><span style="color: maroon">link </span><span style="color: red">rel</span><span style="color: blue">="stylesheet" </span><span style="color: red">href</span><span style="color: blue">="style.css" /&gt;
  &lt;</span><span style="color: maroon">meta </span><span style="color: red">http-equiv</span><span style="color: blue">="X-UA-Compatible" </span><span style="color: red">content</span><span style="color: blue">="IE=9"&gt;
&lt;/</span><span style="color: maroon">head</span><span style="color: blue">&gt;
&lt;</span><span style="color: maroon">body</span><span style="color: blue">&gt;
  &lt;</span><span style="color: maroon">div </span><span style="color: red">id</span><span style="color: blue">="container"&gt;
    &lt;</span><span style="color: maroon">img </span><span style="color: red">src</span><span style="color: blue">="projectsilk.png" /&gt;
    &lt;</span><span style="color: maroon">h1</span><span style="color: blue">&gt;
      </span>Project Silk Overview<span style="color: blue">&lt;/</span><span style="color: maroon">h1</span><span style="color: blue">&gt;
    &lt;</span><span style="color: maroon">p</span><span style="color: blue">&gt;
      </span>Project Silk provides guidance and example implementations
      that describe and illustrate recommended practices for 
      building next generation web applications using web 
      technologies like <span style="color: blue">&lt;</span><span style="color: maroon">span </span><span style="color: red">data-tag</span><span style="color: blue">&gt;</span>HTML5<span style="color: blue">&lt;/</span><span style="color: maroon">span</span><span style="color: blue">&gt;</span>, 
      <span style="color: blue">&lt;</span><span style="color: maroon">span </span><span style="color: red">data-tag</span><span style="color: blue">&gt;</span>jQuery<span style="color: blue">&lt;/</span><span style="color: maroon">span</span><span style="color: blue">&gt;</span>, <span style="color: blue">&lt;</span><span style="color: maroon">span </span><span style="color: red">data-tag</span><span style="color: blue">&gt;</span>CSS3<span style="color: blue">&lt;/</span><span style="color: maroon">span</span><span style="color: blue">&gt;
      </span>and Internet Explorer 9. The guidance will be taught in 
      the context of real-world development scenarios rather 
      than focusing on <span style="color: blue">&lt;</span><span style="color: maroon">span </span><span style="color: red">data-tag</span><span style="color: blue">&gt;</span>technology<span style="color: blue">&lt;/</span><span style="color: maroon">span</span><span style="color: blue">&gt; 
      </span>features.<span style="color: blue">&lt;/</span><span style="color: maroon">p</span><span style="color: blue">&gt;
</span></pre>
<h1>Attaching Widgets </h1>
<p>Widgets are attached to HTML elements. When a widget is attached its <strong>options</strong> can also be set. </p>
<pre class="code">(<span style="color: blue">function </span>($) {
  $(<span style="color: maroon">'body'</span>).infobox({
    dataUrl: <span style="color: maroon">'https://feeds.delicious.com/v2/json/popular/'
  </span>});
  $(<span style="color: maroon">'span[data-tag]'</span>).tagger();
} (jQuery));</pre>
<p>The above code demonstrates the <strong>infobox</strong> widget being attached to the <strong>body</strong> element. The <strong>dataUrl</strong> <strong>option</strong> value will be used when performing popular keyword link look-ups. </p>
<p>The jQuery selector <strong>'span[data-tag]'</strong> returns a jQuery wrapped set that contains all <strong>span</strong> tags with a <strong>data-tag</strong> attribute. Think of a jQuery wrapped set as a collection or an array. A <strong>tagger</strong> widget will be attached to each of the <strong>span</strong> tags in the returned collection. </p>
<h1>Widget Initialization </h1>
<p>When created, the jQuery UI widget factory will call the private method <strong>_create</strong>. This method provides the developer an opportunity to perform widget setup actions. Examples include building and injecting markup, adding CSS classes, binding events, etc. </p>
<pre class="code">_create: <span style="color: blue">function </span>() {
  <span style="color: blue">var </span>self = <span style="color: blue">this</span>;
  self._targetElement = $(<span style="color: maroon">'&lt;div class="qs-info-box" /&gt;'</span>);
  $(<span style="color: maroon">'body'</span>).append(self._targetElement);
  self._targetElement.hover(
    <span style="color: blue">function </span>() {  <span style="color: #006400">// mouseenter
      </span>self._isMouseOver = <span style="color: blue">true</span>;
    },
    <span style="color: blue">function </span>() {  <span style="color: #006400">// mouseleave
      </span>self._isMouseOver = <span style="color: blue">false</span>;
      self.hideTagLinks();
    }
  );
}</pre>
<p>The above code snippet first sets up a closure for <strong>this</strong> called <strong>self</strong>, so that the widget can be referenced in the hover event handlers. </p>
<p>Recall that the <strong>infobox</strong> widget is attached to the <strong>body</strong> element; however, it currently has no UI element in the DOM to work with. The element <strong>div.qs-info-box </strong>will contain the UI for this widget. It will be stored in the _<strong>targetElement</strong> variable and attached to the <strong>body</strong> element. Now the <strong>infobox</strong> widget has a DOM element it can reference, manipulate, and attach event handlers to. </p>
<p>The <strong>hover</strong> behavior is defined by two functions. The first function is the <strong>mouseenter</strong> event handler and the second function is the <strong>mouseleave</strong> event handler. </p>
<h1>Widget Interactions </h1>
<p>An interesting challenge with this scenario is giving the user time to click the links without showing the popup longer than needed. The implementation requires coordination between the two widgets. </p>
<h2>Mouse Entering a Keyword </h2>
<p>When the mouse enters the keyword span, the <strong>mousenter</strong> event handler in the <strong>tagger</strong> widget is invoked. </p>
<pre class="code"><span style="color: blue">function </span>(event) {  <span style="color: #006400">// mouseenter
  </span>clearTimeout(timer);
  screenWidth = window.innerWidth;
  <span style="color: blue">if </span>(event.pageX &gt; screenWidth / 2) {
    offsetX = -270;
  }
  self._locatedInfoBox.infobox(<span style="color: maroon">'displayTagLinks'</span>,
                              $(<span style="color: blue">this</span>).text(),
                              event.pageY + offsetY,
                              event.pageX + offsetX);
}</pre>
<p>The following describes the steps to displays the keyword links within the popup (<strong>_targetElement</strong>) in the above code. </p>
<ul>
<li><strong>clearTimeout</strong> - This clears the timer created when the mouse previously left the keyword. </li>
<li>Calculate the horizontal offset depending on the location of the mouse relative to the center of the screen. </li>
<li>Pass the keyword text and X,Y positions for the popup to the <strong>displayTagLinks</strong> function<strong> </strong>on the <strong>infobox</strong> widget. </li>
<li>
<p>Inside the <strong>displayTagLinks</strong> function, the URL is augmented with the keyword text in preparation for the Ajax request. The maximum number of items to be returned is also included in the URL according to the requirements of the delicious.com service as seen in this line of code:</p>
<pre class="code">url = <span style="color: blue">this</span>.options.dataUrl + tag + <span style="color: maroon">'?count=' </span>+ self.options.maxItems;</pre>
</li>
<li>
<p>On successful completion of the Ajax call, the contents of the popup are constructed and applied to the <strong>_targetElement</strong> using its jQuery <strong>html</strong> function. Before showing the popup with the <strong>show</strong> function, the position is set using the jQuery <strong>css</strong> function. You can see this in the <strong>_displayResult </strong>function below, which is called by the <strong>success</strong> and <strong>error</strong> Ajax handlers.</p>
<pre class="code">_displayResult: <span style="color: blue">function </span>(element, html, top, left) {
  element.html(html);
  element.css({ top: top, left: left });
  element.show();
}</pre>
</li>
<li>The Ajax error condition behaves in a similar fashion except an error message will be display in lieu of the links if an Ajax error occurs. </li>
</ul>
<h2>Mouse Leaving a Keyword </h2>
<p>When the mouse leaves the keyword span, a 1000 millisecond delay is set to call the <strong>hideTagLinks</strong> function on the <strong>infobox</strong> widget. The popup is only hidden if the mouse is not over it. Effectively, the 1000ms delay provides the user time to move the mouse from the keywords to the links. </p>
<pre class="code">hideTagLinks: <span style="color: blue">function </span>() {
  <span style="color: blue">if </span>(!<span style="color: blue">this</span>._isMouseOver) {
    <span style="color: blue">this</span>._targetElement.hide();
  }
}</pre>
<h2>Mouse Entering the Popup </h2>
<p>Internally the <strong>infobox</strong> widget maintains state about whether the mouse is over the popup or not using the <strong>_isMouseOver</strong> property. </p>
<p>When the mouse enters the popup, <strong>_isMouseOver</strong> is set to <strong>true</strong>. </p>
<pre class="code"><span style="color: blue">function </span>() {  <span style="color: #006400">// mouseenter
  </span>self._isMouseOver = <span style="color: blue">true</span>;
}</pre>
<h2>Mouse Leaving the Popup </h2>
<p>When the mouse leaves the popup, <strong>_isMouseOver</strong> is set to <strong>false</strong> and <strong>hideTagLinks</strong> is invoked. </p>
<pre class="code"><span style="color: blue">function </span>() {  <span style="color: #006400">// mouseleave
  </span>self._isMouseOver = <span style="color: blue">false</span>;
  self.hideTagLinks();
}

hideTagLinks: <span style="color: blue">function </span>() {
  <span style="color: blue">if </span>(!<span style="color: blue">this</span>._isMouseOver) {
    <span style="color: blue">this</span>._targetElement.hide();
  }
}</pre>
<h1>Download</h1>
<p>The source code and Microsoft Word document version of the blog post can be downloaded at: <a target="_blank" href="https://silk.codeplex.com/releases/view/64272">https://silk.codeplex.com/releases/view/64272</a></p>
<h1>More Information </h1>
<p>You may find the following links useful in your investigation of the jQuery UI widget factory: </p>
<ul>
<li><a target="_blank" href="https://jqueryui.com/docs/Developer_Guide">https://jqueryui.com/docs/Developer_Guide</a> </li>
<li><a target="_blank" href="https://wiki.jqueryui.com/w/page/12138135/Widget-factory">https://wiki.jqueryui.com/w/page/12138135/Widget-factory</a> </li>
<li><a target="_blank" href="https://www.erichynds.com/jquery/tips-for-developing-jquery-ui-widgets/">https://www.erichynds.com/jquery/tips-for-developing-jquery-ui-widgets/</a> </li>
<li><a target="_blank" href="https://bililite.com/blog/understanding-jquery-ui-widgets-a-tutorial/">https://bililite.com/blog/understanding-jquery-ui-widgets-a-tutorial/</a> </li>
</ul>
<h1>Comments </h1>
<p>Microsoft values your opinion about our products, guidance, documentation and samples.&nbsp; You can leave feedback on this blog post or on the The Project Silk site at: <a target="_blank" href="https://silk.codeplex.com/releases/view/64272">https://silk.codeplex.com/releases/view/64272</a> </p>
<p>Thank you for your feedback and have a great day, </p>
<p>Karl Shifflett </p>]]></content:encoded>
    </item>
    <item>
      <title>Prism 4 Region Navigation with Silverlight Frame Navigation and Unity</title>
      <link>https://docs.microsoft.com/archive/blogs/kashiffl/prism-4-region-navigation-with-silverlight-frame-navigation-and-unity</link>
      <pubDate>Thu, 10 Mar 2011 16:58:00 GMT</pubDate>
      <dc:creator><![CDATA[karl140.6]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/kashiffl/2011/03/10/prism-4-region-navigation-with-silverlight-frame-navigation-and-unity/</guid>
      <description><![CDATA[I have had several requests to demonstrate how to use Unity with Prism 4 Region Navigation and the...]]></description>
      <content:encoded><![CDATA[<p>I have had several requests to demonstrate how to use Unity with Prism 4 Region Navigation and the Silverlight Frame Navigation framework.</p>
<p>The primary purpose of this blog post is to provide an example of using Unity for dependency resolution when writing a Silverlight application that also uses Prism 4 Region Navigation and the Silverlight Frame Navigation framework.</p>
<h1>Required Reading</h1>
<p>If you have not yet read these blog post please do so now.</p>
<ul>
<li><a target="_blank" href="https://blogs.msdn.com/b/kashiffl/archive/2010/10/04/prism-v4-region-navigation-pipeline.aspx"><span style="color: #0066cc;">Prism v4 Region Navigation Pipeline</span></a> </li>
<li><a target="_blank" href="https://blogs.msdn.com/b/kashiffl/archive/2010/10/05/integrating-prism-v4-region-navigation-with-silverlight-frame-navigation.aspx"><span style="color: #0066cc;">Integrating Prism v4 Region Navigation with Silverlight Frame Navigation</span></a> </li>
<li><a target="_blank" href="https://blogs.msdn.com/b/kashiffl/archive/2011/02/09/cancelling-a-navigation-request-using-prism-v4-region-navigation-with-silverlight-frame-navigation.aspx">Cancelling a Navigation Request using Prism v4 Region Navigation with Silverlight Frame Navigation</a> </li>
</ul>
<p>These blog posts provide critical foundational information that will not be repeat in this blog post.</p>
<h1>Example Code</h1>
<p>This blog post is a direct port of the code from the above Cancelling a Navigation Request using Prism v4 Region Navigation with Silverlight Frame Navigation post that uses MEF for dependency resolution.&nbsp; That code has been ported to use Unity instead.&nbsp; </p>
<p>The code in this blog post includes the prompt for navigation cancelling feature that gets called when navigating away from the inventory item page. This prompt demonstrates implementing the IConfirmNavigationRequest.ConfirmNavigationRequest method in Silverlight when the Silverlight Frame Navigation framework is also being used.</p>
<h1>Configuring the Unity Container</h1>
<p>When using Unity with Prism 4 Region Navigation in either Silverlight or WPF applications, the Unity container needs to be configured in a special way.&nbsp; This is required because of the way the Prism Region Navigation API requests objects from the Unity container.</p>
<p>The below text is taken from the &ldquo;Basic Region Navigation&rdquo; section of on Prism 4 MSDN documentation page: <a href="https://msdn.microsoft.com/en-us/library/gg430861(v=PandP.40).aspx">https://msdn.microsoft.com/en-us/library/gg430861(v=PandP.40).aspx</a>.&nbsp; </p>
<p><img height="300" width="867" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/40/09/metablogapi/1055.ConfiguringUnity_7CB93658.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-01-40-09-metablogapi/1055.ConfiguringUnity_5F00_7CB93658.png" alt="ConfiguringUnity" border="0" title="ConfiguringUnity" 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" /></p>
<p>The following code snippet is from the Bootstrapper.cs file in the, &ldquo;ThePhoneCompany&rdquo; project.&nbsp; This shows how to properly register views with Unity that will be navigated to using the Prism 4 Navigation API.&nbsp; The views are registered as type Object and then the type full name is used to name the view in the Unity container.</p>
<p>Notice how I have chosen to use the type full name instead of the type name.&nbsp; Using the type full name prevents name collisions across different modules and makes navigating across modules very easy.</p>
<pre class="code"><span style="color: blue">protected override void </span>ConfigureContainer() {
    <span style="color: blue">base</span>.ConfigureContainer();

    Container
        .RegisterType&lt;<span style="color: #2b91af">Object</span>, <span style="color: #2b91af">AboutView</span>&gt;(<span style="color: blue">typeof</span>(<span style="color: #2b91af">AboutView</span>).FullName)
        .RegisterType&lt;<span style="color: #2b91af">Object</span>, <span style="color: #2b91af">HomeView</span>&gt;(<span style="color: blue">typeof</span>(<span style="color: #2b91af">HomeView</span>).FullName);
}</pre>
<p>The below UriMapper XAML is from the ShellView.&nbsp; You can see how the above view type full names map to the below Urls.&nbsp; </p>
<p>Example:&nbsp; User navigates to /#/HomeView, the Region Navigation API will request the &ldquo;ThePhoneCompany.Views.HomeView&rdquo; named object from the Unity Container and begin the navigation process.&nbsp; </p>
<p>Example: User navigates to /#/Inventory/ItemView/1009, the Region Navigation API will request the &ldquo;ThePhoneCompany.Inventory.Views.ItemView&rdquo; named object from the Unity Container and begin the navigation process.</p>
<pre class="code"><span style="color: blue">&lt;</span><span style="color: #a31515">navigation</span><span style="color: blue">:</span><span style="color: #a31515">Frame.UriMapper</span><span style="color: blue">&gt;
    &lt;</span><span style="color: #a31515">uriMapper</span><span style="color: blue">:</span><span style="color: #a31515">UriMapper</span><span style="color: blue">&gt;
                        
        </span><span style="color: green">&lt;!--Default applicaiton mapper--&gt;
        </span><span style="color: blue">&lt;</span><span style="color: #a31515">uriMapper</span><span style="color: blue">:</span><span style="color: #a31515">UriMapping </span><span style="color: red">Uri</span><span style="color: blue">="" </span><span style="color: red">MappedUri</span><span style="color: blue">="/ThePhoneCompany.Views.HomeView"/&gt;
                       
        </span><span style="color: green">&lt;!--Used to add a new record--&gt;
        </span><span style="color: blue">&lt;</span><span style="color: #a31515">uriMapper</span><span style="color: blue">:</span><span style="color: #a31515">UriMapping </span><span style="color: red">Uri</span><span style="color: blue">="/{moduleName}/{pageName}/add" </span><span style="color: red">MappedUri</span><span style="color: blue">="ThePhoneCompany.{moduleName}.Views.{pageName}?key=0"/&gt;
                        
        </span><span style="color: green">&lt;!--Used to edit a record--&gt;
        </span><span style="color: blue">&lt;</span><span style="color: #a31515">uriMapper</span><span style="color: blue">:</span><span style="color: #a31515">UriMapping </span><span style="color: red">Uri</span><span style="color: blue">="/{moduleName}/{pageName}/{key}" </span><span style="color: red">MappedUri</span><span style="color: blue">="ThePhoneCompany.{moduleName}.Views.{pageName}?key={key}"/&gt;

        </span><span style="color: green">&lt;!--Used to view a page--&gt;
        </span><span style="color: blue">&lt;</span><span style="color: #a31515">uriMapper</span><span style="color: blue">:</span><span style="color: #a31515">UriMapping </span><span style="color: red">Uri</span><span style="color: blue">="/{moduleName}/{pageName}" </span><span style="color: red">MappedUri</span><span style="color: blue">="ThePhoneCompany.{moduleName}.Views.{pageName}"/&gt;
                        
        </span><span style="color: green">&lt;!--Used to navigate to a page in the Shell--&gt;
        </span><span style="color: blue">&lt;</span><span style="color: #a31515">uriMapper</span><span style="color: blue">:</span><span style="color: #a31515">UriMapping </span><span style="color: red">Uri</span><span style="color: blue">="/{pageName}" </span><span style="color: red">MappedUri</span><span style="color: blue">="/ThePhoneCompany.Views.{pageName}"/&gt;

    &lt;/</span><span style="color: #a31515">uriMapper</span><span style="color: blue">:</span><span style="color: #a31515">UriMapper</span><span style="color: blue">&gt;
&lt;/</span><span style="color: #a31515">navigation</span><span style="color: blue">:</span><span style="color: #a31515">Frame.UriMapper</span><span style="color: blue">&gt;
</span></pre>
<p>The below code snippet is from the InventoryModule.cs file.&nbsp; Notice again how the views are registered in the Unity Container as type Object and named using the type full name.</p>
<pre class="code"><span style="color: blue">public class </span><span style="color: #2b91af">InventoryModule </span>: <span style="color: #2b91af">IModule </span>{

    <span style="color: blue">public </span>InventoryModule(<span style="color: #2b91af">IUnityContainer </span>container) {
        container
            .RegisterType&lt;<span style="color: #2b91af">InventoryViewModel</span>&gt;()
            .RegisterType&lt;<span style="color: #2b91af">ItemViewModel</span>&gt;()
            .RegisterType&lt;<span style="color: #2b91af">CategoryViewModel</span>&gt;()
            .RegisterType&lt;<span style="color: #2b91af">Object</span>, <span style="color: #2b91af">InventoryView</span>&gt;(<span style="color: blue">typeof </span>(<span style="color: #2b91af">InventoryView</span>).FullName)
            .RegisterType&lt;<span style="color: #2b91af">Object</span>, <span style="color: #2b91af">ItemView</span>&gt;(<span style="color: blue">typeof </span>(<span style="color: #2b91af">ItemView</span>).FullName)
            .RegisterType&lt;<span style="color: #2b91af">Object</span>, <span style="color: #2b91af">CategoryView</span>&gt;(<span style="color: blue">typeof </span>(<span style="color: #2b91af">CategoryView</span>).FullName);
    }

    <span style="color: blue">public void </span>Initialize() {
           
    }
}</pre>
<h1>Running the Sample Code</h1>
<p><strong>Requirements</strong>: you must <a target="_blank" href="https://www.microsoft.com/downloads/en/details.aspx?FamilyID=3453ab2b-2067-41e4-b087-312d8385cf1b&amp;displaylang=en">download Prism 4</a> or later and run the <strong>RegisterPrismBinaries.bat</strong> batch file. The Prism v4 Readme covers this file in detail. If you do not want to run this batch file, you'll need to remove and re-add the references to the Prism assemblies. </p>
<p>The attached code uses Unity for dependency resolution.&nbsp; This code also demonstrates cancelling a navigation request. To see this in action, run the application, select Inventory in the menu bar, select an inventory item to edit, then press the Close button on the inventory item form. A MessageBox will prompt you to continue the navigation or cancel it.</p>
<h1>Comments </h1>
<p>Microsoft values your opinion about our products, guidance, documentation and samples. </p>
<p>Thank you for your feedback and have a great day, </p>
<p>Karl Shifflett </p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Components.PostAttachments/00/10/13/96/00/SLPrismNavigationUnity.zip" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-components-postattachments/00-10-13-96-00/SLPrismNavigationUnity.zip">SLPrismNavigationUnity.zip</a></p>]]></content:encoded>
    </item>
    <item>
      <title>Cancelling a Navigation Request using Prism v4 Region Navigation with Silverlight Frame Navigation</title>
      <link>https://docs.microsoft.com/archive/blogs/kashiffl/cancelling-a-navigation-request-using-prism-v4-region-navigation-with-silverlight-frame-navigation</link>
      <pubDate>Wed, 09 Feb 2011 13:32:00 GMT</pubDate>
      <dc:creator><![CDATA[karl140.6]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/kashiffl/2011/02/09/cancelling-a-navigation-request-using-prism-v4-region-navigation-with-silverlight-frame-navigation/</guid>
      <description><![CDATA[I have had inquiries from developers asking how to implement cancelling a navigation request when...]]></description>
      <content:encoded><![CDATA[<p>I have had inquiries from developers asking how to implement cancelling a navigation request when using Prism Region Navigation with Silverlight Frame Navigation.</p>
<p>This is a follow up blog post to <a target="_blank" href="https://blogs.msdn.com/b/kashiffl/archive/2010/10/05/integrating-prism-v4-region-navigation-with-silverlight-frame-navigation.aspx">Integrating Prism v4 Region Navigation with Silverlight Frame Navigation</a>.&nbsp; Please read this blog post if you have not already done so.</p>
<p>If you have not read the blog post <a target="_blank" href="https://blogs.msdn.com/b/kashiffl/archive/2010/10/04/prism-v4-region-navigation-pipeline.aspx">Prism v4 Region Navigation Pipeline</a>, please read this to get an understanding of Prism Region Navigation, the interfaces and the pipeline.&nbsp; This blog post also covers IConfirmNavigationRequest in detail.</p>
<h1>Background</h1>
<p>When using Prism region navigation with WPF or Silverlight, developers can implement the IConfirmNavigationRequest interface and in the ConfirmNavigationRequest method, display a dialog, get a response and invoke the callback that was passed as an argument to ConfirmNavigationRequest.&nbsp; This dialog does not have to be a modal or thread blocking dialog because the Prism Region Navigation pipeline is halted until the callback is invoked.</p>
<p>In order for a region navigation request to be cancelled in a Silverlight application that also uses the Silverlight frame navigation framework, a modal dialog is required when getting the response from the user.&nbsp; This is because navigation is initiated by the Silverlight frame navigation framework and not the Prism region navigation.&nbsp; Even if the Prism region navigation is used to initiate the request, the request is still routed to Silverlight frame navigation framework for processing.&nbsp; The Silverlight frame navigation framework does not support halting the request like the Prism navigation API does, this is why a thread blocking dialog is required to get the input from the user before allowing the navigation request to continue processing.</p>
<h1>Prism Documentation on Interaction Requests</h1>
<p>Please read the following Prism documentation on Interaction Requests before proceeding.&nbsp; This fully explains the concepts of the Interaction Request and I won&rsquo;t repeat that content here.</p>
<p><a target="_blank" href="https://msdn.microsoft.com/en-us/library/gg405494(v=PandP.40).aspx#UserInteractionPatterns">https://msdn.microsoft.com/en-us/library/gg405494(v=PandP.40).aspx#UserInteractionPatterns</a></p>
<h1>How to Implement Cancelling a Prism 4 Navigation Request when using Silverlight Frame Navigation</h1>
<ul>
<li>In the view, set up a Prism Interaction Request in the XAML </li>
<li>In the view model expose public property of type InteractionRequest&lt;Confirmation&gt; </li>
<li>In the view model implement IConfimNavigationRequest </li>
</ul>
<p>The following XAML snippet is from the ItemView.xaml file.</p>
<ul>
<li>The NavigationRequest property exposed on the view model </li>
<li>The MessageBoxNotificationAction is in MessageBoxNotificationAction.cs.&nbsp; </li>
</ul>
<p>&nbsp;</p>
<pre class="code"><span style="color: blue">&lt;</span><span style="color: #a31515">ie</span><span style="color: blue">:</span><span style="color: #a31515">Interaction.Triggers</span><span style="color: blue">&gt;
    &lt;</span><span style="color: #a31515">prism</span><span style="color: blue">:</span><span style="color: #a31515">InteractionRequestTrigger </span><span style="color: red">SourceObject</span><span style="color: blue">="{</span><span style="color: #a31515">Binding </span><span style="color: red">NavigationRequest</span><span style="color: blue">}"&gt;
        &lt;</span><span style="color: #a31515">infra</span><span style="color: blue">:</span><span style="color: #a31515">MessageBoxNotificationAction </span><span style="color: blue">/&gt;
    &lt;/</span><span style="color: #a31515">prism</span><span style="color: blue">:</span><span style="color: #a31515">InteractionRequestTrigger</span><span style="color: blue">&gt;
&lt;/</span><span style="color: #a31515">ie</span><span style="color: blue">:</span><span style="color: #a31515">Interaction.Triggers</span><span style="color: blue">&gt;
</span></pre>
<p>The below code snippet is from MessageBoxNotificationAction.cs. </p>
<p>The Silverlight MessageBox is used to get the response from the user.&nbsp; The Silverlight MessageBox is a thread blocking message box.&nbsp; This is required when cancelling a Silverlight Frame navigation request.&nbsp; Currently, the Silverlight MessageBox is the only thread blocking message box available in Silverlight.&nbsp; Unfortunately this message box can&rsquo;t be styled or modified by the developer.</p>
<pre class="code"><span style="color: blue">public class </span><span style="color: #2b91af">MessageBoxNotificationAction </span>: <span style="color: #2b91af">TriggerAction</span>&lt;<span style="color: #2b91af">FrameworkElement</span>&gt; {

    <span style="color: blue">protected override void </span>Invoke(<span style="color: blue">object </span>parameter) {
        <span style="color: blue">var </span>args = parameter <span style="color: blue">as </span><span style="color: #2b91af">InteractionRequestedEventArgs</span>;
        <span style="color: blue">if</span>(args == <span style="color: blue">null</span>) {
            <span style="color: blue">return</span>;
        }

        <span style="color: blue">var </span>confirmation = (<span style="color: #2b91af">Confirmation</span>)args.Context;
        <span style="color: #2b91af">MessageBoxResult </span>result = <span style="color: #2b91af">MessageBox</span>.Show(confirmation.Content.ToString(), confirmation.Title, <span style="color: #2b91af">MessageBoxButton</span>.OKCancel);

        confirmation.Confirmed = result == <span style="color: #2b91af">MessageBoxResult</span>.OK;
        args.Callback();
    }
}</pre>
<p>The below three code snippets are from ItemViewModel.cs.</p>
<p>The above view XAML data binds to the below NavigationRequest property exposed on the view model. </p>
<pre class="code"><span style="color: blue">public </span><span style="color: #2b91af">InteractionRequest</span>&lt;<span style="color: #2b91af">Confirmation</span>&gt; NavigationRequest { <span style="color: blue">get</span>; <span style="color: blue">private set</span>; }</pre>
<p>The NavigationRequest property is initialized in the view model constructor.</p>
<pre class="code">[<span style="color: #2b91af">ImportingConstructor</span>]
<span style="color: blue">public </span>ItemViewModel(<span style="color: #2b91af">IRegionManager </span>regionManager) {
    _regionManager = regionManager;
    NavigationRequest = <span style="color: blue">new </span><span style="color: #2b91af">InteractionRequest</span>&lt;<span style="color: #2b91af">Confirmation</span>&gt;();
}</pre>
<p>The below code is the implementation for the IConfirmNavigationRequest interface. IConfirmNavigationRequest derives from the INavigationRequest interface and adds a single method ConfirmNavigationRequest.</p>
<pre class="code"><span style="color: blue">void </span><span style="color: #2b91af">IConfirmNavigationRequest</span>.ConfirmNavigationRequest(<span style="color: #2b91af">NavigationContext </span>navigationContext, <span style="color: #2b91af">Action</span>&lt;<span style="color: #2b91af">Boolean</span>&gt; continuationCallback) {
    <span style="color: blue">this</span>.NavigationRequest.Raise(
        <span style="color: blue">new </span><span style="color: #2b91af">Confirmation </span>{
            Content = <span style="color: #a31515">"Would you like to continue navigating away?"</span>,
            Title = <span style="color: #a31515">"Navigation Confirmation"
        </span>}, confirmation =&gt; continuationCallback(confirmation.Confirmed));
}</pre>
<p>During the processing of the navigation request the above ConfirmNavigationRequest method will be called causing the following code to be executed:</p>
<ul>
<li>Raise method on the InteractionRequest is invoked.&nbsp; (NavigationRequest property exposes InteractionRequest) </li>
<li>The triggers in the XAML trigger the above MessageBoxNotificationAction.Invoke method </li>
<li>The result of the MessageBoxNotificationAction.Invoke method are returned in the Confirmation, Confirmed property </li>
<li>The Prism Region Navigation API will either cancel or continue the navigation request based on the Confirm property</li>
</ul>
<h1>Running the Sample Code</h1>
<p><strong>Requirements</strong>: you must download Prism 4 or later and run the <strong>RegisterPrismBinaries.bat</strong> batch file. The Prism v4 Readme covers this file in detail. If you do not want to run this batch file, you'll need to remove and re-add the references to the Prism assemblies. </p>
<p>I have attached a modified version of the code that demonstrates cancelling a navigation request.&nbsp; To see this in action, run the application, select Inventory in the menu bar, select an inventory item to edit, then press the Close button on the inventory item form.&nbsp; A MessageBox will prompt you to continue the navigation or cancel it.</p>
<h1>Comments </h1>
<p>Microsoft values your opinion about our products, guidance, documentation and samples. </p>
<p>Thank you for your feedback and have a great day, </p>
<p>Karl Shifflett </p>
<p>Patterns &amp; Practices Prism Team </p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Components.PostAttachments/00/10/12/70/01/SilverlightPrismv4IntegratedNavigationWithCancellationEnabled.zip" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-components-postattachments/00-10-12-70-01/SilverlightPrismv4IntegratedNavigationWithCancellationEnabled.zip">SilverlightPrismv4IntegratedNavigationWithCancellationEnabled.zip</a></p>]]></content:encoded>
    </item>
    <item>
      <title>p &amp; p Web Guidance Survey</title>
      <link>https://docs.microsoft.com/archive/blogs/kashiffl/p-p-web-guidance-survey</link>
      <pubDate>Thu, 02 Dec 2010 04:49:26 GMT</pubDate>
      <dc:creator><![CDATA[karl140.6]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/kashiffl/2010/12/02/p-p-web-guidance-survey/</guid>
      <description><![CDATA[The Microsoft patterns &amp; practices team has just started a new web guidance project that will...]]></description>
      <content:encoded><![CDATA[<p>The Microsoft patterns &amp; practices team has just started a new web guidance project that will run from now until Apr 2011. </p>  <p>p &amp; p projects are community driven.&#160; This is your initial opportunity to feed into the web guidance project.</p>  <p>We very much value your opinion and kindly request your response to this VERY short survey.</p>  <p><u><font color="#800080"><a title="https://www.surveymonkey.com/s/wcg/" href="https://www.surveymonkey.com/s/wcg" rel="nofollow" target="_blank">https://www.surveymonkey.com/s/wcg</a></font></u></p>  <p>Have a great day,</p>  <p>Karl</p>]]></content:encoded>
    </item>
  </channel>
</rss>