<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" media="screen" href="/styles/xslt/rss.xslt"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:media="http://search.yahoo.com/mrss/" xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" xmlns:c9="http://channel9.msdn.com">
<channel>
	<title>SlickThought  - Channel 9</title>
    <atom:link rel="self" type="application/rss+xml" href="http://channel9.msdn.com/Blogs/SlickThought/feed"></atom:link>
    <itunes:summary>Channel 9 Blog for SlickThought</itunes:summary>
    <itunes:author>Microsoft</itunes:author>
    <itunes:subtitle></itunes:subtitle>
    <image>
      <url>http://mschnlnine.vo.llnwd.net/d1/Dev/App_Themes/C9/images/feedimage.png</url>
      <title>SlickThought  - Channel 9</title>
      <link>http://channel9.msdn.com/Blogs/SlickThought</link>
    </image>
    <itunes:image href="http://mschnlnine.vo.llnwd.net/d1/Dev/App_Themes/C9/images/feedimage.png"></itunes:image>
    <itunes:category text="Technology"></itunes:category>
    <description>Channel 9 Blog for SlickThought</description>
    <link>http://channel9.msdn.com/Blogs/SlickThought</link>
    <language>en</language>
    <pubDate>Tue, 21 May 2013 11:03:52 GMT</pubDate>
    <lastBuildDate>Tue, 21 May 2013 11:03:52 GMT</lastBuildDate>
    <generator>Rev9</generator>
    <c9:totalResults>15</c9:totalResults>
    <c9:pageCount>1</c9:pageCount>
    <c9:pageSize>25</c9:pageSize>
  <item>
      <title>Building Multiscreen Applications - Part 1</title>
      <description><![CDATA[ <p>This multi-part screencast series will look at the fundamentals involved in building multiscreen applications using Microsoft Silverlight and Visual Studio 2010. Starting with an overview of the Microsoft ecosystem,&nbsp;Part 1 lays the foundation for future episodes, introducing key concepts that will be developed throughout the series. This includes a basic review of MVVM and project setup, as well as other items developers should concern themselves with as they get ready to build a multiscreen solution.</p><p>&nbsp;</p><p><a href="http://s3.amazonaws.com/slickthought/Downloads/Code/nScreen-Part1.zip">Project code can be downloaded here</a>.</p> <img src="http://m.webtrends.com/dcs1wotjh10000w0irc493s0e_6x1g/njs.gif?dcssip=channel9.msdn.com&dcsuri=http://channel9.msdn.com/Blogs/SlickThought/feed&WT.dl=0&WT.entryid=Entry:RSSView:bb975965d8cf40e6a9599e910154a2ec">]]></description>
      <comments>http://channel9.msdn.com/Blogs/SlickThought/Building-Multiscreen-Applications-Part-1</comments>
      <itunes:summary> This multi-part screencast series will look at the fundamentals involved in building multiscreen applications using Microsoft Silverlight and Visual Studio 2010. Starting with an overview of the Microsoft ecosystem,&amp;nbsp;Part 1 lays the foundation for future episodes, introducing key concepts that will be developed throughout the series. This includes a basic review of MVVM and project setup, as well as other items developers should concern themselves with as they get ready to build a multiscreen solution. &amp;nbsp; Project code can be downloaded here. </itunes:summary>
      <itunes:duration>903</itunes:duration>
      <link>http://channel9.msdn.com/Blogs/SlickThought/Building-Multiscreen-Applications-Part-1</link>
      <pubDate>Tue, 01 Mar 2011 19:19:47 GMT</pubDate>
      <guid isPermaLink="false">http://channel9.msdn.com/Blogs/SlickThought/Building-Multiscreen-Applications-Part-1</guid>
      <media:thumbnail url="http://ak.channel9.msdn.com/ch9/a2ec/bb975965-d8cf-40e6-a959-9e910154a2ec/Multiscreen1_100_ch9.jpg" height="75" width="100"></media:thumbnail>
      <media:thumbnail url="http://ak.channel9.msdn.com/ch9/a2ec/bb975965-d8cf-40e6-a959-9e910154a2ec/Multiscreen1_220_ch9.jpg" height="165" width="220"></media:thumbnail>
      <media:thumbnail url="http://ak.channel9.msdn.com/ch9/a2ec/bb975965-d8cf-40e6-a959-9e910154a2ec/Multiscreen1_512_ch9.jpg" height="384" width="512"></media:thumbnail>
      <media:group>
        <media:content url="http://ak.channel9.msdn.com/ch9/a2ec/bb975965-d8cf-40e6-a959-9e910154a2ec/Multiscreen1_2MB_ch9.wmv" expression="full" duration="903" fileSize="257146979" type="video/x-ms-wmv" medium="video"></media:content>
        <media:content url="http://ak.channel9.msdn.com/ch9/a2ec/bb975965-d8cf-40e6-a959-9e910154a2ec/Multiscreen1_ch9.mp3" expression="full" duration="903" fileSize="7226435" type="audio/mp3" medium="audio"></media:content>
        <media:content url="http://ak.channel9.msdn.com/ch9/a2ec/bb975965-d8cf-40e6-a959-9e910154a2ec/Multiscreen1_ch9.wma" expression="full" duration="903" fileSize="7310707" type="audio/x-ms-wma" medium="audio"></media:content>
        <media:content url="http://ak.channel9.msdn.com/ch9/a2ec/bb975965-d8cf-40e6-a959-9e910154a2ec/Multiscreen1_ch9.wmv" expression="full" duration="903" fileSize="43402851" type="video/x-ms-wmv" medium="video"></media:content>
        <media:content url="http://ak.channel9.msdn.com/ch9/a2ec/bb975965-d8cf-40e6-a959-9e910154a2ec/Multiscreen1_high_ch9.mp4" expression="full" duration="903" fileSize="251906006" type="video/mp4" medium="video"></media:content>
        <media:content url="http://ak.channel9.msdn.com/ch9/a2ec/bb975965-d8cf-40e6-a959-9e910154a2ec/Multiscreen1_low_ch9.mp4" expression="full" duration="903" fileSize="25818418" type="video/mp4" medium="video"></media:content>
        <media:content url="http://files.ch9.ms/ch9/a2ec/bb975965-d8cf-40e6-a959-9e910154a2ec/Multiscreen1.ism/manifest" expression="full" duration="903" fileSize="8426" type="video/x-ms-wmv" medium="video"></media:content>
      </media:group>      
      <enclosure url="http://ak.channel9.msdn.com/ch9/a2ec/bb975965-d8cf-40e6-a959-9e910154a2ec/Multiscreen1_ch9.wmv" length="43402851" type="video/x-ms-wmv"></enclosure>
      <dc:creator>Jeff Brand</dc:creator>
      <itunes:author>Jeff Brand</itunes:author>
      <slash:comments>0</slash:comments>
      <wfw:commentRss>http://channel9.msdn.com/Blogs/SlickThought/Building-Multiscreen-Applications-Part-1/RSS</wfw:commentRss>
      <category>.NET 4.0</category>
      <category>.NET Framework 4.0</category>
      <category>MVVM</category>
      <category>Silveright 4</category>
    </item>
  <item>
      <title>Simple Dependency Injection with XAML</title>
      <description><![CDATA[ <p>Have you ever wanted the flexibility of dependency injection without having to implement a full-blown IoC solution?&nbsp; Maybe you just want an easy way to pass concrete services to your ViewModel?&nbsp; This short video will show you you can use XAML to configure your ViewModels to provide a property-based dependency injection solution.&nbsp; You can also read a <a href="http://slickthought.net/post.aspx?id=3c779bba-d72f-4024-99a3-17acbcb647f7">full write up and download demo code&nbsp;on my blog</a>.</p> <img src="http://m.webtrends.com/dcs1wotjh10000w0irc493s0e_6x1g/njs.gif?dcssip=channel9.msdn.com&dcsuri=http://channel9.msdn.com/Blogs/SlickThought/feed&WT.dl=0&WT.entryid=Entry:RSSView:8113fd523f384587a0319e6e017aee5b">]]></description>
      <comments>http://channel9.msdn.com/Blogs/SlickThought/Simple-Dependency-Injection-with-XAML</comments>
      <itunes:summary> Have you ever wanted the flexibility of dependency injection without having to implement a full-blown IoC solution?&amp;nbsp; Maybe you just want an easy way to pass concrete services to your ViewModel?&amp;nbsp; This short video will show you you can use XAML to configure your ViewModels to provide a property-based dependency injection solution.&amp;nbsp; You can also read a full write up and download demo code&amp;nbsp;on my blog. </itunes:summary>
      <itunes:duration>670</itunes:duration>
      <link>http://channel9.msdn.com/Blogs/SlickThought/Simple-Dependency-Injection-with-XAML</link>
      <pubDate>Tue, 18 Jan 2011 21:25:39 GMT</pubDate>
      <guid isPermaLink="false">http://channel9.msdn.com/Blogs/SlickThought/Simple-Dependency-Injection-with-XAML</guid>
      <media:thumbnail url="http://ak.channel9.msdn.com/ch9/ee5b/8113fd52-3f38-4587-a031-9e6e017aee5b/SimpleXamlDI_100_ch9.jpg" height="75" width="100"></media:thumbnail>
      <media:thumbnail url="http://ak.channel9.msdn.com/ch9/ee5b/8113fd52-3f38-4587-a031-9e6e017aee5b/SimpleXamlDI_220_ch9.jpg" height="165" width="220"></media:thumbnail>
      <media:thumbnail url="http://ak.channel9.msdn.com/ch9/ee5b/8113fd52-3f38-4587-a031-9e6e017aee5b/SimpleXamlDI_512_ch9.jpg" height="384" width="512"></media:thumbnail>
      <media:thumbnail url="http://ak.channel9.msdn.com/ch9/ee5b/8113fd52-3f38-4587-a031-9e6e017aee5b/SimpleXamlDI_custom_ch9.jpg" height="384" width="512"></media:thumbnail>
      <media:group>
        <media:content url="http://ak.channel9.msdn.com/ch9/ee5b/8113fd52-3f38-4587-a031-9e6e017aee5b/SimpleXamlDI_2MB_ch9.wmv" expression="full" duration="670" fileSize="103625471" type="video/x-ms-wmv" medium="video"></media:content>
        <media:content url="http://ak.channel9.msdn.com/ch9/ee5b/8113fd52-3f38-4587-a031-9e6e017aee5b/SimpleXamlDI_ch9.mp3" expression="full" duration="670" fileSize="5364208" type="audio/mp3" medium="audio"></media:content>
        <media:content url="http://ak.channel9.msdn.com/ch9/ee5b/8113fd52-3f38-4587-a031-9e6e017aee5b/SimpleXamlDI_ch9.wma" expression="full" duration="670" fileSize="5427199" type="audio/x-ms-wma" medium="audio"></media:content>
        <media:content url="http://ak.channel9.msdn.com/ch9/ee5b/8113fd52-3f38-4587-a031-9e6e017aee5b/SimpleXamlDI_ch9.wmv" expression="full" duration="670" fileSize="32729453" type="video/x-ms-wmv" medium="video"></media:content>
        <media:content url="http://ak.channel9.msdn.com/ch9/ee5b/8113fd52-3f38-4587-a031-9e6e017aee5b/SimpleXamlDI_high_ch9.mp4" expression="full" duration="670" fileSize="182831654" type="video/mp4" medium="video"></media:content>
        <media:content url="http://ak.channel9.msdn.com/ch9/ee5b/8113fd52-3f38-4587-a031-9e6e017aee5b/SimpleXamlDI_low_ch9.mp4" expression="full" duration="670" fileSize="18725103" type="video/mp4" medium="video"></media:content>
        <media:content url="http://ak.channel9.msdn.com/ch9/ee5b/8113fd52-3f38-4587-a031-9e6e017aee5b/SimpleXamlDI_Zune_ch9.wmv" expression="full" duration="670" fileSize="29241508" type="video/x-ms-wmv" medium="video"></media:content>
        <media:content url="http://smooth.ch9.ms/ch9/ee5b/8113fd52-3f38-4587-a031-9e6e017aee5b/SimpleXamlDI.ism/manifest" expression="full" duration="670" fileSize="8426" type="video/x-ms-wmv" medium="video"></media:content>
      </media:group>      
      <enclosure url="http://ak.channel9.msdn.com/ch9/ee5b/8113fd52-3f38-4587-a031-9e6e017aee5b/SimpleXamlDI_ch9.wmv" length="32729453" type="video/x-ms-wmv"></enclosure>
      <dc:creator>Jeff Brand</dc:creator>
      <itunes:author>Jeff Brand</itunes:author>
      <slash:comments>5</slash:comments>
      <wfw:commentRss>http://channel9.msdn.com/Blogs/SlickThought/Simple-Dependency-Injection-with-XAML/RSS</wfw:commentRss>
      <category>Silverlight</category>
      <category>XAML</category>
    </item>
  <item>
      <title>Three Reasons Developers Should Use Expression Blend</title>
      <description><![CDATA[ <p>Lots of developers are building XAML-based applications today.&nbsp; Be it WPF, Silverlight or Windows Phone 7, I have seen a lot of people struggle with certain tasks in Visual Studio that would be much easier if undertaken in Expression Blend.&nbsp; Blend seems to be somewhat intimidating to developers, especially those that are already wrestling with learning XAML. Having spent time in both tools, I can tell you that Blend can make three things dramatically easier, and you should learn how to do these three things with Blend, even if you never use it for anything else.</p><p><a href="http://s3.amazonaws.com/slickthought/Downloads/Code/DevelopersUseBlend.zip">Demo code</a></p><p>&nbsp;</p> <img src="http://m.webtrends.com/dcs1wotjh10000w0irc493s0e_6x1g/njs.gif?dcssip=channel9.msdn.com&dcsuri=http://channel9.msdn.com/Blogs/SlickThought/feed&WT.dl=0&WT.entryid=Entry:RSSView:c1c12c831c7645eb8cc59e0f011f4bf9">]]></description>
      <comments>http://channel9.msdn.com/Blogs/SlickThought/Three-Reasons-Developers-Should-Use-Expression-Blend</comments>
      <itunes:summary> Lots of developers are building XAML-based applications today.&amp;nbsp; Be it WPF, Silverlight or Windows Phone 7, I have seen a lot of people struggle with certain tasks in Visual Studio that would be much easier if undertaken in Expression Blend.&amp;nbsp; Blend seems to be somewhat intimidating to developers, especially those that are already wrestling with learning XAML. Having spent time in both tools, I can tell you that Blend can make three things dramatically easier, and you should learn how to do these three things with Blend, even if you never use it for anything else. Demo code &amp;nbsp; </itunes:summary>
      <itunes:duration>838</itunes:duration>
      <link>http://channel9.msdn.com/Blogs/SlickThought/Three-Reasons-Developers-Should-Use-Expression-Blend</link>
      <pubDate>Fri, 15 Oct 2010 18:35:16 GMT</pubDate>
      <guid isPermaLink="false">http://channel9.msdn.com/Blogs/SlickThought/Three-Reasons-Developers-Should-Use-Expression-Blend</guid>
      <media:thumbnail url="http://ecn.channel9.msdn.com/o9/ch9/4bf9/c1c12c83-1c76-45eb-8cc5-9e0f011f4bf9/BlendForDevelopers_100_ch9.jpg" height="75" width="100"></media:thumbnail>
      <media:thumbnail url="http://ecn.channel9.msdn.com/o9/ch9/4bf9/c1c12c83-1c76-45eb-8cc5-9e0f011f4bf9/BlendForDevelopers_220_ch9.jpg" height="165" width="220"></media:thumbnail>
      <media:thumbnail url="http://ecn.channel9.msdn.com/o9/ch9/4bf9/c1c12c83-1c76-45eb-8cc5-9e0f011f4bf9/BlendForDevelopers_512_ch9.jpg" height="384" width="512"></media:thumbnail>
      <media:group>
        <media:content url="http://ecn.channel9.msdn.com/o9/ch9/4bf9/c1c12c83-1c76-45eb-8cc5-9e0f011f4bf9/BlendForDevelopers_2MB_ch9.wmv" expression="full" duration="838" fileSize="177138479" type="video/x-ms-wmv" medium="video"></media:content>
        <media:content url="http://ecn.channel9.msdn.com/o9/ch9/4bf9/c1c12c83-1c76-45eb-8cc5-9e0f011f4bf9/BlendForDevelopers_ch9.mp3" expression="full" duration="838" fileSize="6710275" type="audio/mp3" medium="audio"></media:content>
        <media:content url="http://ecn.channel9.msdn.com/o9/ch9/4bf9/c1c12c83-1c76-45eb-8cc5-9e0f011f4bf9/BlendForDevelopers_ch9.mp4" expression="full" duration="838" fileSize="59021611" type="video/mp4" medium="video"></media:content>
        <media:content url="http://ecn.channel9.msdn.com/o9/ch9/4bf9/c1c12c83-1c76-45eb-8cc5-9e0f011f4bf9/BlendForDevelopers_ch9.wma" expression="full" duration="838" fileSize="6788009" type="audio/x-ms-wma" medium="audio"></media:content>
        <media:content url="http://ecn.channel9.msdn.com/o9/ch9/4bf9/c1c12c83-1c76-45eb-8cc5-9e0f011f4bf9/BlendForDevelopers_ch9.wmv" expression="full" duration="838" fileSize="37050459" type="video/x-ms-wmv" medium="video"></media:content>
      </media:group>      
      <enclosure url="http://ecn.channel9.msdn.com/o9/ch9/4bf9/c1c12c83-1c76-45eb-8cc5-9e0f011f4bf9/BlendForDevelopers_ch9.wmv" length="37050459" type="video/x-ms-wmv"></enclosure>
      <dc:creator>Jeff Brand</dc:creator>
      <itunes:author>Jeff Brand</itunes:author>
      <slash:comments>2</slash:comments>
      <wfw:commentRss>http://channel9.msdn.com/Blogs/SlickThought/Three-Reasons-Developers-Should-Use-Expression-Blend/RSS</wfw:commentRss>
      <category>Blend</category>
      <category>Silverlight</category>
      <category>Windows Phone 7</category>
      <category>WP7</category>
      <category>WPF</category>
      <category>XAML</category>
    </item>
  <item>
      <title>Managing Windows Phone 7 Trial Applications</title>
      <description><![CDATA[
<p>Windows Phone 7 provides the <b>LicenseInformation</b> class that includes the
<b>IsTrial()</b> method.&nbsp; <b>IsTrial()</b> allows you to check, at runtime, if the running application has been installed from the Marketplace as a trial application, or if the user has purchased the application.&nbsp; Developers are able to use
<b>IsTrial()</b> to change the behavior of their application based on whether or not the user is running a trial version or a paid for version.&nbsp; Unfortunately for WP7 devs, there is no easy way to control the
<b>IsTrial()</b> results when developing and debugging their applications. <b>IsTrial()</b> will always return
<b>False</b> when developing an application.&nbsp; Even more disappointing, <b>LicenseInformation</b> is a sealed class and there is no
<b>ILicenseInfo</b> interface that you could use to mock out your own implementation while developing.
</p>
<p>In addition, each developer is left to his or her own devices to come up with a system for controlling how their trial software behaves.&nbsp; Simple things like turning off features in the trial version is pretty straightforward, but if you want to have more
 complex behavior, things get trickier.&nbsp; What if you want someone to be able to use your application for 30 days before you disable features?&nbsp; How about 10 uses of the application before they need to buy the full version?&nbsp; You are on your own.</p>
<p><b>TrialManager</b> is a simple piece of code that you can add to any WP7 project to help manage the behavior of your trial apps.&nbsp;
<b>TrialManager</b> will also make it easier to simulate you application running in Trial mode when creating your apps.&nbsp; You can get the source to
<b>TrialManager</b> <a shape="rect" href="https://s3.amazonaws.com/slickthought/Downloads%2FCode%2FTrialManager.zip" shape="rect">
here</a>.&nbsp; Feel free to use it, modify, etc.&nbsp; The only licensing restriction is that I ask you send me an email, letting me know you are using the code in some form or fashion.</p>
<br />Get more details at <a shape="rect" href="http://slickthought.net/post/2010/08/30/Managing-Trial-Applications-for-Windows-Phone-7.aspx" shape="rect">
http://slickthought.net/post/2010/08/30/Managing-Trial-Applications-for-Windows-Phone-7.aspx</a>
<br /><br />Source code <a shape="rect" href="https://s3.amazonaws.com/slickthought/Downloads%2FCode%2FTrialManager.zip" shape="rect">
download</a>  <img src="http://m.webtrends.com/dcs1wotjh10000w0irc493s0e_6x1g/njs.gif?dcssip=channel9.msdn.com&dcsuri=http://channel9.msdn.com/Blogs/SlickThought/feed&WT.dl=0&WT.entryid=Entry:RSSView:ff6fe9de55fa42c296e29de901875c0f">]]></description>
      <comments>http://channel9.msdn.com/Blogs/SlickThought/Managing-Windows-Phone-7-Trial-Applications</comments>
      <itunes:summary>
Windows Phone 7 provides the LicenseInformation class that includes the
IsTrial() method.&amp;nbsp; IsTrial() allows you to check, at runtime, if the running application has been installed from the Marketplace as a trial application, or if the user has purchased the application.&amp;nbsp; Developers are able to use
IsTrial() to change the behavior of their application based on whether or not the user is running a trial version or a paid for version.&amp;nbsp; Unfortunately for WP7 devs, there is no easy way to control the
IsTrial() results when developing and debugging their applications. IsTrial() will always return
False when developing an application.&amp;nbsp; Even more disappointing, LicenseInformation is a sealed class and there is no
ILicenseInfo interface that you could use to mock out your own implementation while developing.
 
In addition, each developer is left to his or her own devices to come up with a system for controlling how their trial software behaves.&amp;nbsp; Simple things like turning off features in the trial version is pretty straightforward, but if you want to have more
 complex behavior, things get trickier.&amp;nbsp; What if you want someone to be able to use your application for 30 days before you disable features?&amp;nbsp; How about 10 uses of the application before they need to buy the full version?&amp;nbsp; You are on your own. 
TrialManager is a simple piece of code that you can add to any WP7 project to help manage the behavior of your trial apps.&amp;nbsp;
TrialManager will also make it easier to simulate you application running in Trial mode when creating your apps.&amp;nbsp; You can get the source to
TrialManager 
here.&amp;nbsp; Feel free to use it, modify, etc.&amp;nbsp; The only licensing restriction is that I ask you send me an email, letting me know you are using the code in some form or fashion. 
Get more details at 
http://slickthought.net/post/2010/08/30/Managing-Trial-Applications-for-Windows-Phone-7.aspx
Source code 
download </itunes:summary>
      <itunes:duration>727</itunes:duration>
      <link>http://channel9.msdn.com/Blogs/SlickThought/Managing-Windows-Phone-7-Trial-Applications</link>
      <pubDate>Mon, 30 Aug 2010 18:29:00 GMT</pubDate>
      <guid isPermaLink="false">http://channel9.msdn.com/Blogs/SlickThought/Managing-Windows-Phone-7-Trial-Applications</guid>
      <media:thumbnail url="http://ecn.channel9.msdn.com/o9/previewImages/100/569987_100x75.jpg" height="75" width="100"></media:thumbnail>
      <media:thumbnail url="http://ecn.channel9.msdn.com/o9/previewImages/220/569987_220x165.jpg" height="165" width="220"></media:thumbnail>
      <media:thumbnail url="http://ecn.channel9.msdn.com/o9/ch9/9987/569987/WP7TrialManager_320_ch9.jpg" height="240" width="320"></media:thumbnail>
      <media:thumbnail url="http://ecn.channel9.msdn.com/o9/ch9/9987/569987/WP7TrialManager_512_ch9.jpg" height="384" width="512"></media:thumbnail>
      <media:thumbnail url="http://ecn.channel9.msdn.com/o9/ch9/9987/569987/WP7TrialManager_85_ch9.jpg" height="64" width="85"></media:thumbnail>
      <media:group>
        <media:content url="http://ecn.channel9.msdn.com/o9/ch9/9987/569987/WP7TrialApplications_2MB_ch9.wmv" expression="full" duration="727" fileSize="68226809" type="video/x-ms-wmv" medium="video"></media:content>
        <media:content url="http://ecn.channel9.msdn.com/o9/ch9/9987/569987/WP7TrialManager_2MB_ch9.wmv" expression="full" duration="727" fileSize="52393813" type="video/x-ms-wmv" medium="video"></media:content>
        <media:content url="http://ecn.channel9.msdn.com/o9/ch9/9987/569987/WP7TrialManager_ch9.mp3" expression="full" duration="727" fileSize="5822313" type="audio/mp3" medium="audio"></media:content>
        <media:content url="http://ecn.channel9.msdn.com/o9/ch9/9987/569987/WP7TrialManager_ch9.mp4" expression="full" duration="727" fileSize="55177555" type="video/mp4" medium="video"></media:content>
        <media:content url="http://ecn.channel9.msdn.com/o9/ch9/9987/569987/WP7TrialManager_ch9.wma" expression="full" duration="727" fileSize="5889813" type="audio/x-ms-wma" medium="audio"></media:content>
        <media:content url="http://ecn.channel9.msdn.com/o9/ch9/9987/569987/WP7TrialManager_Zune_ch9.wmv" expression="full" duration="727" fileSize="31945848" type="video/x-ms-wmv" medium="video"></media:content>
      </media:group>      
      <enclosure url="http://ecn.channel9.msdn.com/o9/ch9/9987/569987/WP7TrialManager_2MB_ch9.wmv" length="52393813" type="video/x-ms-wmv"></enclosure>
      <dc:creator>Jeff Brand</dc:creator>
      <itunes:author>Jeff Brand</itunes:author>
      <slash:comments>0</slash:comments>
      <wfw:commentRss>http://channel9.msdn.com/Blogs/SlickThought/Managing-Windows-Phone-7-Trial-Applications/RSS</wfw:commentRss>
      <category>Windows Phone</category>
      <category>Windows Phone 7</category>
      <category>WP7</category>
    </item>
  <item>
      <title>Custom Per-Page Transitions for Windows Phone 7</title>
      <description><![CDATA[
<p>Continuing our previous explorations of the <em>TransitioningContentControl (<a href="http://slickthought.net/post.aspx?id=eea29142-2a3f-4e52-81b1-ec4be654c364">here</a> and
<a href="http://slickthought.net/post.aspx?id=3430eb28-b9a3-46d9-9c66-158f403cb204">
here</a> – all WinPhone content <a href="http://slickthought.net/category/Windows-Phone.aspx">
here</a>)</em>, we will now take a look at how we can extend the TCC to allow transitions to be defined on a per-page basis. Simply put, we would like to have a default transition for all pages, and to provide a list of custom transitions to use on a page-by-page
 basis. In addition to this article, you can <a href="http://ecn.channel9.msdn.com/o9/ch9/9/1/4/3/5/5/WP7CustomPageTransitionsUpdate_2MB_ch9.wmv">
watch a screencast</a> of making these changes, and source is linked at the end of the article.</p>
<p>Our first step is creating a simple class that will be used to hold Page-to-Transition mappings. That class is shown below:</p>
<ol>
<li>
<div><span>namespace</span> <span>System</span><span>.</span><span>Windows</span><span>.</span><span>Controls</span></div>
</li><li>
<div><span>{</span></div>
</li><li>
<div><span>&nbsp;&nbsp;&nbsp;&nbsp; public</span> <span>class</span> PageTransitionMapping</div>
</li><li>
<div><span>&nbsp;&nbsp;&nbsp;&nbsp; {</span></div>
</li><li>
<div><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; public</span> <span>string</span> Page <span>{</span> get<span>;</span> set<span>;</span>
<span>}</span></div>
</li><li>
<div><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; public</span> <span>string</span> Transition <span>{</span> get<span>;</span> set<span>;</span>
<span>}</span></div>
</li><li>
<div><span>&nbsp;&nbsp;&nbsp;&nbsp; }</span></div>
</li><li>
<div><span>}</span></div>
</li></ol>
<p></p>
<p>I added this class to the TCC folder from the previous screencast (<a href="http://s3.amazonaws.com/SpaghettiCode/download/FindAZip-CompleteTransitions-AprilCTP.zip">download here</a>). Notice that I changed the namespace to match the TCC’s namespace.</p>
<p>Next, the TCC is modified, allowing us to provide Page-To-Transition mappings via the App.xaml file. See below:</p>
<pre class="csharp"><ol><li><div><span>public</span> <span>class</span> TransitioningContentControl <span>:</span> ContentControl</div></li><li><div><span>{</span></div></li><li><div>&nbsp;</div></li><li><div>        <span>private</span> List<span>&lt;</span>PageTransitionMapping<span>&gt;</span> _mappings <span>=</span> <a href="http://www.google.com/search?q=new&#43;msdn.microsoft.com"><span>new</span></a> List<span>&lt;</span>PageTransitionMapping<span>&gt;</span><span>(</span><span>)</span><span>;</span></div></li><li><div>        <span>public</span> List<span>&lt;</span>PageTransitionMapping<span>&gt;</span> PageTransitionMappings <span>{</span> get <span>{</span> <span>return</span> _mappings<span>;</span> <span>}</span> <span>}</span></div></li><li><div>&nbsp; …</div></li></ol></pre>
<p>The _mappings field stores a List&lt;&gt; of PageTransitionMapping objects. These mapping objects are created by accessing the PageTransitionMappings property via App.xaml as shown below</p>
<p></p>
<p></p>
<pre class="xml"><ol><li><div><span><span>&lt;phoneNavigation:PhoneApplicationFrame</span> <span>x:Name</span>=<span>&quot;RootFrame&quot;</span> <span>Source</span>=<span>&quot;/MainPage.xaml&quot;</span><span>&gt;</span></span></div></li><li><div>            <span><span>&lt;phoneNavigation:PhoneApplicationFrame.Template<span>&gt;</span></span></span></div></li><li><div>                <span><span>&lt;ControlTemplate<span>&gt;</span></span></span></div></li><li><div>                    <span><span>&lt;layout:TransitioningContentControl</span> <span>Content</span>=<span>&quot;{TemplateBinding Content}&quot;</span> <span>Style</span>=<span>&quot;{StaticResource TransitioningStyle}&quot;</span><span>&gt;</span></span></div></li><li><div>                        <span><span>&lt;layout:TransitioningContentControl.PageTransitionMappings<span>&gt;</span></span></span></div></li><li><div>                            <span><span>&lt;layout:PageTransitionMapping</span> <span>Page</span>=<span>&quot;AprilCTP.Views.Favorites.Default&quot;</span> <span>Transition</span>=<span>&quot;SwingTransition&quot;</span> <span>/&gt;</span></span></div></li><li><div>                        <span><span>&lt;/layout:TransitioningContentControl.PageTransitionMappings<span>&gt;</span></span></span></div></li><li><div>                    <span><span>&lt;/layout:TransitioningContentControl<span>&gt;</span></span></span>    </div></li><li><div>                <span><span>&lt;/ControlTemplate<span>&gt;</span></span></span></div></li><li><div>            <span><span>&lt;/phoneNavigation:PhoneApplicationFrame.Template<span>&gt;</span></span></span></div></li></ol></pre>
<p>In this example, the Default.xaml page in the Views/Favorites folder has been mapped to use the SwingTransition. Just like before, all of the transitions used by the TCCC must be in the TCC’s Style definition (specifically, in the ControlTemplate’s VisualStateManager).</p>
<p>The next to last step is to update the way the TCC applies transitions to pages as they are displayed. To do this, we update the TCC’s StartTransition() method as shown below:</p>
<pre class="csharp"><ol><li><div> <span>private</span> <span>void</span> StartTransition<span>(</span><span>object</span> oldContent, <span>object</span> newContent<span>)</span></div></li><li><div>        <span>{</span></div></li><li><div>            <span>// both presenters must be available, otherwise a transition is useless.</span></div></li><li><div>            <span>if</span> <span>(</span>CurrentContentPresentationSite <span>!=</span> <span>null</span> <span>&amp;&amp;</span> PreviousContentPresentationSite <span>!=</span> <span>null</span><span>)</span></div></li><li><div>            <span>{</span></div></li><li><div>                PageTransitionMapping transitionMapping <span>=</span> <span>null</span><span>;</span></div></li><li><div>                var newPage <span>=</span> newContent <span>as</span> PhoneApplicationPage<span>;</span></div></li><li><div>&nbsp;</div></li><li><div>                <span>if</span> <span>(</span>newPage <span>!=</span> <span>null</span><span>)</span></div></li><li><div>                <span>{</span></div></li><li><div>                    <span>string</span> pageType <span>=</span> newPage<span>.</span><span>GetType</span><span>(</span><span>)</span><span>.</span><span>ToString</span><span>(</span><span>)</span><span>;</span></div></li><li><div>                    transitionMapping <span>=</span> <span>(</span><span>from</span> m <span>in</span> <span>this</span><span>.</span><span>PageTransitionMappings</span> <span>where</span> m<span>.</span><span>Page</span> <span>==</span> pageType <span>select</span> m<span>)</span><span>.</span><span>SingleOrDefault</span><span>(</span><span>)</span><span>;</span></div></li><li><div>                <span>}</span></div></li><li><div>&nbsp;</div></li><li><div>&nbsp;</div></li><li><div>&nbsp;</div></li><li><div>                <span>// and start a new transition</span></div></li><li><div>                <span>if</span> <span>(</span><span>!</span>IsTransitioning <span>||</span> RestartTransitionOnContentChange<span>)</span></div></li><li><div>                <span>{</span></div></li><li><div>                    IsTransitioning <span>=</span> <span>true</span><span>;</span></div></li><li><div>&nbsp;</div></li><li><div>                    <span>if</span> <span>(</span>transitionMapping <span>!=</span> <span>null</span><span>)</span></div></li><li><div>                    <span>{</span></div></li><li><div>                        Transition <span>=</span> transitionMapping<span>.</span><span>Transition</span><span>;</span></div></li><li><div>                    <span>}</span></div></li><li><div>                    <span>else</span></div></li><li><div>                        Transition <span>=</span> _standardTransition<span>;</span></div></li><li><div>&nbsp;</div></li><li><div>                    CurrentContentPresentationSite<span>.</span><span>Content</span> <span>=</span> newContent<span>;</span></div></li><li><div>                    PreviousContentPresentationSite<span>.</span><span>Content</span> <span>=</span> oldContent<span>;</span></div></li><li><div>                    VisualStateManager<span>.</span><span>GoToState</span><span>(</span><span>this</span>, NormalState, <span>false</span><span>)</span><span>;</span></div></li><li><div>                    VisualStateManager<span>.</span><span>GoToState</span><span>(</span><span>this</span>, Transition, <span>true</span><span>)</span><span>;</span></div></li><li><div>                <span>}</span></div></li><li><div>            <span>}</span></div></li><li><div>        <span>}</span></div></li></ol></pre>
<p>There are a couple of important points. First, the CurrentContextPresentionSite.Content = and the PreviousContentPresentationState.Content = lines of code have been moved a bit from where they appeared in the original code. Second, there is no real error
 handling for cases where you enter the wrong name for your custom transition inside the App.xaml mapping. This is more “proof of concept” code than production ready code. The TCC has a GetStoryboard method that you can use to make sure the transition is available
<em>–</em> it is just a matter of where you want to detect that and how you want to handle it in the case that a transition does not exist (falling back to the default transition is probably easiest).</p>
<p>The last thing we have to do is set the value for _standardTransition. We will set its value in the OnApplyTemplate() method inside the TCC. This method gets called one time when the TCC is first created and the template is applied. We will add the declaration
 for _standardTransition immediately before the method (stick it where ever you like):</p>
<pre class="csharp"><ol><li><div>        <span>private</span> <span>string</span> _standardTransition<span>;</span></div></li><li><div>        <span>/// &lt;summary&gt;</span></div></li><li><div>        <span>/// Builds the visual tree for the TransitioningContentControl control </span></div></li><li><div>        <span>/// when a new template is applied.</span></div></li><li><div>        <span>/// &lt;/summary&gt;</span></div></li><li><div>        <span>public</span> <span>override</span> <span>void</span> OnApplyTemplate<span>(</span><span>)</span></div></li></ol></pre>
<p>The OnApplyTemplate discovers the value of the TCC Transition property that was set in the Style in the App.xaml file. Setting _standardTransition to this value lets us use it whenever there is not a custom page transition defined. Update the OnApplyTemplate()
 method as shown: </p>
<pre class="csharp"><ol><li><div>            ^^^^ REST OF METHOD ^^^^</div></li><li><div>            _standardTransition <span>=</span> Transition<span>;</span></div></li><li><div>            VisualStateManager<span>.</span><span>GoToState</span><span>(</span><span>this</span>, NormalState, <span>false</span><span>)</span><span>;</span></div></li><li><div>        <span>}</span></div></li></ol></pre>
<p>&nbsp;</p>
<p>I have included the source for a <a href="http://s3.amazonaws.com/SpaghettiCode/download/FindAZip-CustomTransitions-AprilCTP.zip">
working solution here</a>.</p>
 <img src="http://m.webtrends.com/dcs1wotjh10000w0irc493s0e_6x1g/njs.gif?dcssip=channel9.msdn.com&dcsuri=http://channel9.msdn.com/Blogs/SlickThought/feed&WT.dl=0&WT.entryid=Entry:RSSView:50856d19f26c4279a0729dea00a5a23d">]]></description>
      <comments>http://channel9.msdn.com/Blogs/SlickThought/Custom-Per-Page-Transitions-for-Windows-Phone-7</comments>
      <itunes:summary>
Continuing our previous explorations of the TransitioningContentControl (here and

here – all WinPhone content 
here), we will now take a look at how we can extend the TCC to allow transitions to be defined on a per-page basis. Simply put, we would like to have a default transition for all pages, and to provide a list of custom transitions to use on a page-by-page
 basis. In addition to this article, you can 
watch a screencast of making these changes, and source is linked at the end of the article. 
Our first step is creating a simple class that will be used to hold Page-to-Transition mappings. That class is shown below: 


namespace System.Windows.Controls

{

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; public class PageTransitionMapping

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; public string Page { get; set;
}

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; public string Transition { get; set;
}

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }

}

 
I added this class to the TCC folder from the previous screencast (download here). Notice that I changed the namespace to match the TCC’s namespace. 
Next, the TCC is modified, allowing us to provide Page-To-Transition mappings via the App.xaml file. See below: 
public class TransitioningContentControl : ContentControl{&amp;nbsp;        private List&amp;lt;PageTransitionMapping&amp;gt; _mappings = new List&amp;lt;PageTransitionMapping&amp;gt;();        public List&amp;lt;PageTransitionMapping&amp;gt; PageTransitionMappings { get { return _mappings; } }&amp;nbsp; …
The _mappings field stores a List&amp;lt;&amp;gt; of PageTransitionMapping objects. These mapping objects are created by accessing the PageTransitionMappings property via App.xaml as shown below 
 
 
&amp;lt;phoneNavigation:PhoneApplicationFrame x:Name=&amp;quot;RootFrame&amp;quot; Source=&amp;quot;/MainPage.xaml&amp;quot;&amp;gt;            &amp;lt;phoneNavigation:PhoneApplicationFrame.Template&amp;gt;                &amp;lt;ControlTemplate&amp;gt;                    &amp;lt;layout:Transitionin</itunes:summary>
      <itunes:duration>618</itunes:duration>
      <link>http://channel9.msdn.com/Blogs/SlickThought/Custom-Per-Page-Transitions-for-Windows-Phone-7</link>
      <pubDate>Tue, 08 Jun 2010 09:00:00 GMT</pubDate>
      <guid isPermaLink="false">http://channel9.msdn.com/Blogs/SlickThought/Custom-Per-Page-Transitions-for-Windows-Phone-7</guid>
      <media:thumbnail url="http://ecn.channel9.msdn.com/o9/previewImages/100/553419_100x75.jpg" height="75" width="100"></media:thumbnail>
      <media:thumbnail url="http://ecn.channel9.msdn.com/o9/previewImages/220/553419_220x165.jpg" height="165" width="220"></media:thumbnail>
      <media:thumbnail url="http://ecn.channel9.msdn.com/o9/ch9/9/1/4/3/5/5/WP7CustomPageTransitionsUpdate_320_ch9.png" height="240" width="320"></media:thumbnail>
      <media:thumbnail url="http://ecn.channel9.msdn.com/o9/ch9/9/1/4/3/5/5/WP7CustomPageTransitionsUpdate_512_ch9.png" height="384" width="512"></media:thumbnail>
      <media:thumbnail url="http://ecn.channel9.msdn.com/o9/ch9/9/1/4/3/5/5/WP7CustomPageTransitionsUpdate_85_ch9.png" height="64" width="85"></media:thumbnail>
      <media:group>
        <media:content url="http://ecn.channel9.msdn.com/o9/ch9/9/1/4/3/5/5/WP7CustomPageTransitionsUpdate_2MB_ch9.wmv" expression="full" duration="618" fileSize="37736643" type="video/x-ms-wmv" medium="video"></media:content>
        <media:content url="http://ecn.channel9.msdn.com/o9/ch9/9/1/4/3/5/5/WP7CustomPageTransitionsUpdate_ch9.mp3" expression="full" duration="618" fileSize="4950040" type="audio/mp3" medium="audio"></media:content>
        <media:content url="http://ecn.channel9.msdn.com/o9/ch9/9/1/4/3/5/5/WP7CustomPageTransitionsUpdate_ch9.mp4" expression="full" duration="618" fileSize="25067187" type="video/mp4" medium="video"></media:content>
        <media:content url="http://ecn.channel9.msdn.com/o9/ch9/9/1/4/3/5/5/WP7CustomPageTransitionsUpdate_ch9.wma" expression="full" duration="618" fileSize="5009641" type="audio/x-ms-wma" medium="audio"></media:content>
        <media:content url="http://ecn.channel9.msdn.com/o9/ch9/9/1/4/3/5/5/WP7CustomPageTransitionsUpdate_ch9.wmv" expression="full" duration="618" fileSize="29902185" type="video/x-ms-wmv" medium="video"></media:content>
        <media:content url="http://ecn.channel9.msdn.com/o9/ch9/9/1/4/3/5/5/WP7CustomPageTransitionsUpdate_Zune_ch9.wmv" expression="full" duration="618" fileSize="35593191" type="video/x-ms-wmv" medium="video"></media:content>
      </media:group>      
      <enclosure url="http://ecn.channel9.msdn.com/o9/ch9/9/1/4/3/5/5/WP7CustomPageTransitionsUpdate_ch9.wmv" length="29902185" type="video/x-ms-wmv"></enclosure>
      <dc:creator>Jeff Brand</dc:creator>
      <itunes:author>Jeff Brand</itunes:author>
      <slash:comments>3</slash:comments>
      <wfw:commentRss>http://channel9.msdn.com/Blogs/SlickThought/Custom-Per-Page-Transitions-for-Windows-Phone-7/RSS</wfw:commentRss>
      <category>Windows Phone</category>
    </item>
  <item>
      <title>Windows Phone 7 April CTP and TransitioningContentControl</title>
      <description><![CDATA[
<p>In my original screencast (<a shape="rect" href="http://slickthought.net/post/2010/04/26/Simplifying-Page-Transitions-in-Windows-Phone-7-Silverlight-Applications.aspx" shape="rect">my blog</a> or on
<a shape="rect" href="http://channel9.msdn.com/posts/SlickThought/Simplify-Page-Transitions-in-Windows-Phone-7-Silverlight-Applications/" shape="rect">
here on Channel 9</a>), I showed you how to use the Silverlight Toolkit’s <i>TransitioningContentControl</i> to&nbsp;add automatic transitions between pages of your Windows Phone 7 Silverlight application.&nbsp; A few days after recording and posting that screencast,
 Microsoft released an updated version of the tools and the emulator.&nbsp; Soon after, I started to get reports from folks watching my screencast that the
<i>TransitioningContentControl</i> not only didn’t work with the April CTP release, but it prevented their entire application from running.</p>
<p>Bummer! <img src='http://ecn.channel9.msdn.com/o9/content/images/emoticons/emotion-5.gif' alt='Wink' />&nbsp; I started to dig into it, and it “appears” that the <i>TransitioningContentControl</i> is suffering from the bug talked about
<a shape="rect" href="http://www.manyniches.com/windows-phone/signed-assemblies-bug-in-the-windows-phone-tools-ctp-refresh/" shape="rect">
here</a>.&nbsp; I say it “appears” to be related to that because the symptoms are the same, but unfortunately, the provided fix does not work on the System.Windows.Controls.Layout.Toolkit assembly that is created by building the Silverlight Toolkit.&nbsp; I think it
 has something to do with the fact that the System.Windows.Controls.Layout.Toolkit project uses the output of several other projects, which are probably signed as well.&nbsp; I am not sure how that propagates&nbsp;into the final assembly, but the Powershell script does
 not fix things.</p>
<p>To solve the problem, I just went “brute force” and added the necessary source files from the
<i>TransitioningContentControl</i> project to my own project and called it good.&nbsp; A better step would have been to break that source out into its own project and create an unsigned assembly containing just the TCC that I could then reuse between Windows Phone
 projects, but I am assuming&nbsp;at this point that whatever the bug is (signed assembly or other), will be fixed in a future release.&nbsp; In the interim, this get the job done.&nbsp;
</p>
<p>Watch the short video (5 minutes) to see how to get things set up.&nbsp; Skip to the 2:30 mark if you want to get right to the step required to add TCC directly to your project.</p>
<a shape="rect" href="http://s3.amazonaws.com/SpaghettiCode/download/FindAZip-CompleteTransitions-AprilCTP.zip" shape="rect">Download source here</a>
 <img src="http://m.webtrends.com/dcs1wotjh10000w0irc493s0e_6x1g/njs.gif?dcssip=channel9.msdn.com&dcsuri=http://channel9.msdn.com/Blogs/SlickThought/feed&WT.dl=0&WT.entryid=Entry:RSSView:8f016e914ad045fdbf779deb000dcecb">]]></description>
      <comments>http://channel9.msdn.com/Blogs/SlickThought/Windows-Phone-7-April-CTP-and-TransitioningContentControl</comments>
      <itunes:summary>
In my original screencast (my blog or on

here on Channel 9), I showed you how to use the Silverlight Toolkit’s TransitioningContentControl to&amp;nbsp;add automatic transitions between pages of your Windows Phone 7 Silverlight application.&amp;nbsp; A few days after recording and posting that screencast,
 Microsoft released an updated version of the tools and the emulator.&amp;nbsp; Soon after, I started to get reports from folks watching my screencast that the
TransitioningContentControl not only didn’t work with the April CTP release, but it prevented their entire application from running. 
Bummer! &amp;nbsp; I started to dig into it, and it “appears” that the TransitioningContentControl is suffering from the bug talked about

here.&amp;nbsp; I say it “appears” to be related to that because the symptoms are the same, but unfortunately, the provided fix does not work on the System.Windows.Controls.Layout.Toolkit assembly that is created by building the Silverlight Toolkit.&amp;nbsp; I think it
 has something to do with the fact that the System.Windows.Controls.Layout.Toolkit project uses the output of several other projects, which are probably signed as well.&amp;nbsp; I am not sure how that propagates&amp;nbsp;into the final assembly, but the Powershell script does
 not fix things. 
To solve the problem, I just went “brute force” and added the necessary source files from the
TransitioningContentControl project to my own project and called it good.&amp;nbsp; A better step would have been to break that source out into its own project and create an unsigned assembly containing just the TCC that I could then reuse between Windows Phone
 projects, but I am assuming&amp;nbsp;at this point that whatever the bug is (signed assembly or other), will be fixed in a future release.&amp;nbsp; In the interim, this get the job done.&amp;nbsp;
 
Watch the short video (5 minutes) to see how to get things set up.&amp;nbsp; Skip to the 2:30 mark if you want to get right to the step required to add TCC directly to your</itunes:summary>
      <itunes:duration>341</itunes:duration>
      <link>http://channel9.msdn.com/Blogs/SlickThought/Windows-Phone-7-April-CTP-and-TransitioningContentControl</link>
      <pubDate>Thu, 20 May 2010 20:36:00 GMT</pubDate>
      <guid isPermaLink="false">http://channel9.msdn.com/Blogs/SlickThought/Windows-Phone-7-April-CTP-and-TransitioningContentControl</guid>
      <media:thumbnail url="http://ecn.channel9.msdn.com/o9/previewImages/100/551367_100x75.jpg" height="75" width="100"></media:thumbnail>
      <media:thumbnail url="http://ecn.channel9.msdn.com/o9/previewImages/220/551367_220x165.jpg" height="165" width="220"></media:thumbnail>
      <media:thumbnail url="http://ecn.channel9.msdn.com/o9/ch9/7/6/3/1/5/5/WP7TransitionsAprilCTPFix_320_ch9.png" height="240" width="320"></media:thumbnail>
      <media:thumbnail url="http://ecn.channel9.msdn.com/o9/ch9/7/6/3/1/5/5/WP7TransitionsAprilCTPFix_512_ch9.png" height="384" width="512"></media:thumbnail>
      <media:thumbnail url="http://ecn.channel9.msdn.com/o9/ch9/7/6/3/1/5/5/WP7TransitionsAprilCTPFix_85_ch9.png" height="64" width="85"></media:thumbnail>
      <media:group>
        <media:content url="http://ecn.channel9.msdn.com/o9/ch9/7/6/3/1/5/5/WP7TransitionsAprilCTPFix_2MB_ch9.wmv" expression="full" duration="341" fileSize="27791565" type="video/x-ms-wmv" medium="video"></media:content>
        <media:content url="http://ecn.channel9.msdn.com/o9/ch9/7/6/3/1/5/5/WP7TransitionsAprilCTPFix_ch9.mp3" expression="full" duration="341" fileSize="2735085" type="audio/mp3" medium="audio"></media:content>
        <media:content url="http://ecn.channel9.msdn.com/o9/ch9/7/6/3/1/5/5/WP7TransitionsAprilCTPFix_ch9.mp4" expression="full" duration="341" fileSize="16485752" type="video/mp4" medium="video"></media:content>
        <media:content url="http://ecn.channel9.msdn.com/o9/ch9/7/6/3/1/5/5/WP7TransitionsAprilCTPFix_ch9.wma" expression="full" duration="341" fileSize="2777669" type="audio/x-ms-wma" medium="audio"></media:content>
        <media:content url="http://ecn.channel9.msdn.com/o9/ch9/7/6/3/1/5/5/WP7TransitionsAprilCTPFix_ch9.wmv" expression="full" duration="341" fileSize="18778307" type="video/x-ms-wmv" medium="video"></media:content>
        <media:content url="http://ecn.channel9.msdn.com/o9/ch9/7/6/3/1/5/5/WP7TransitionsAprilCTPFix_Zune_ch9.wmv" expression="full" duration="341" fileSize="22247529" type="video/x-ms-wmv" medium="video"></media:content>
      </media:group>      
      <enclosure url="http://ecn.channel9.msdn.com/o9/ch9/7/6/3/1/5/5/WP7TransitionsAprilCTPFix_ch9.wmv" length="18778307" type="video/x-ms-wmv"></enclosure>
      <dc:creator>Jeff Brand</dc:creator>
      <itunes:author>Jeff Brand</itunes:author>
      <slash:comments>0</slash:comments>
      <wfw:commentRss>http://channel9.msdn.com/Blogs/SlickThought/Windows-Phone-7-April-CTP-and-TransitioningContentControl/RSS</wfw:commentRss>
      <category>Windows Phone</category>
    </item>
  <item>
      <title>Simplify Page Transitions in Windows Phone 7 Silverlight Applications</title>
      <description><![CDATA[
<p>Update: To see how to extend this solution for custom per-page transitions, see
<a shape="rect" href="http://channel9.msdn.com/posts/SlickThought/Custom-Per-Page-Transitions-for-Windows-Phone-7/" shape="rect">
my follow-on article</a>.<br /><br />If you have played around with Silverlight on Windows Phone 7, one thing you may have tried to figure out is how to add nice transitions between different pages of your application. By default, Windows Phone page transitions aren’t really transitions at all.
 The new <em>PhoneNavigationPage</em> is just popped into the root <em>PhoneNavigationFrame</em>. Effective, yes. Cool? Certainly not. Face it, modern mobile applications need to not only be functional, but also stylish. Simple “snap” transitions just don’t
 cut it.</p>
<p>The most common solution to this problem is to use brute force and manage the transitions yourself. You commonly see a “pattern” used in WP7 apps where events in your current page launch a Storyboard animation. When that animation is complete, the actual
 navigation to the new page is invoked and the new page then runs its own Storyboard once it is loaded. It looks something like this…</p>
<pre class="code">// CURRENT PAGE private void CurrentPage_Click(object sender, EventArgs e) <br>{ <br>&nbsp;&nbsp;&nbsp;&nbsp;SomeStoryboard.Completed &#43;= new EventHandler(SomeStoryboard_Completed); &nbsp;&nbsp;&nbsp;&nbsp;<br>&nbsp;&nbsp;&nbsp;&nbsp;SomeStoryboard.Begin(); <br>}<br> <br><br><br><br><br><br>void SomeStoryboard_Completed(object sender, EventArgs e) <br>{ <br>&nbsp;&nbsp;&nbsp;&nbsp;NavigationService.Navigate(new Uri(&quot;/Favorites&quot;, UriKind.Relative)); <br>}</pre>
<p><a shape="rect" href="http://11011.net/software/vspaste" shape="rect"></a>&nbsp;</p>
<pre class="code">// NEWPAGE <br>protected override void OnNavigatedTo(Microsoft.Phone.Navigation.PhoneNavigationEventArgs e) <br>{ <br>&nbsp;&nbsp;&nbsp;&nbsp;base.OnNavigatedTo(e); &nbsp;<br> &nbsp;&nbsp;&nbsp;SomeNewStoryboard.Begin(); <br>}</pre>
<p>It’s a straightforward solution, and it works just fine if your app has only a few pages. If you have lots of pages in your application, however, it becomes quite tedious and hard to maintain.</p>
<p>A better solution can be found by turning to the Silverlight Toolkit. The great thing about having Silverlight on WP7 is that you can leverage many existing Silverlight assets. In this case, we leverage the
<em>TransitioningContentControl</em> from the Toolkit. The <em>TransitioningContentControl</em> was created for the traditional navigation-based Silverlight application to solve the same problem we are currently facing.</p>
<p>To get started, download the <a shape="rect" href="http://silverlight.codeplex.com/" shape="rect">
Silverlight Toolkit</a> from <a shape="rect" href="http://codeplex.com" shape="rect">
CodePlex</a>. Once installed, you will need to add the <strong>System.Windows.Controls.Layout.Toolkit</strong> assembly to your WP7 project.</p>
<p>If you are not familiar with the <em>TransitioningContentControl</em>, it's a fairly simple control. The TCC is comprised of two
<em>ContentPresenters</em> – current and previous. When you update the <em>Content</em> property of the TCC, it will take the content of the
<em>CurrentContentPresenter</em> (if present) and move it to the <em>PreviousContentPresenter</em>. The new content is loaded into the
<em>CurrentContentPresenter</em>. The TCC, however, manages the visibility of the previous and current
<em>ContentPresenters</em> so that the “old” content is visible and the “new” content is hidden. It then uses a
<em>Storyboard</em>, which is defined as part of the TCC’s <em>VisualStateManager</em>, to transition from the “old” content to the “new” content. If you are not familiar with
<em>Storyboards</em>, the <em>Visual State Manager</em>, or other designer-type topics, have no fear. The TCC comes with a set of standard transitions, which you can use out of the box.</p>
<p>Getting the TCC to work with our WP7 app is a simple process. First, we need to modify the
<em>ControlTemplate</em> for our <em>PhoneNavigationFrame</em> to use the TCC. By doing so, we automatically enable transitions between any
<em>PhoneNavigationPages</em> we add to our app. To change the <em>PhoneNavigationFrame</em>, open the
<em>App.xaml</em> file. Then, add a couple of namespaces to the xaml:</p>
<pre class="code">xmlns:layout=&quot;clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Layout.Toolkit&quot;<br>xmlns:vsm=&quot;clr-namespace:System.Windows;assembly=System.Windows&quot; </pre>
<p>Now, modify the <em><strong>PhoneNavigationFrame</strong></em> as shown below:</p>
<pre class="code">&lt;phoneNavigation:PhoneApplicationFrame x:Name=&quot;RootFrame&quot; Source=&quot;/MainPage.xaml&quot;&gt; &nbsp;&nbsp;&nbsp;&nbsp;<br>&nbsp;&nbsp;&nbsp;&nbsp;&lt;phoneNavigation:PhoneApplicationFrame.Template&gt; <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;ControlTemplate&gt; &nbsp;&nbsp;&nbsp;&nbsp;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;layout:TransitioningContentControl Content=&quot;{TemplateBinding Content}&quot; Style=&quot;{StaticResource TransitioningStyle}&quot;/&gt; <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/ControlTemplate&gt; <br>&nbsp;&nbsp;&nbsp;&nbsp;&lt;/phoneNavigation:PhoneApplicationFrame.Template&gt; &lt;/phoneNavigation:PhoneApplicationFrame&gt; </pre>
<p>The TCC has its <em>Style</em> property set to a <em>StaticResource</em>. This
<em>Style</em> provides the default transitions and is also where you would add your own
<em>VisualStates</em> and <em>Storyboards</em> if you would like to add custom transitions.&nbsp; This
<em>Style</em> can be found in the Silverlight Toolkit in the TCC Sample Application, or you can get it from the sample WP7 application linked to at the end this article. The
<em>Style</em> is long, so I won’t show the entire thing here, but the first parts of the
<em>Style</em> are included below to give you an idea of what the <em>Style</em> contains and how it is used by the TCC.</p>
<pre class="code">&lt;Style x:Key=&quot;TransitioningStyle&quot; TargetType=&quot;layout:TransitioningContentControl&quot;&gt; <br>&nbsp;&nbsp;&nbsp;&nbsp;&lt;Setter Property=&quot;Transition&quot; Value=&quot;DefaultTransition&quot; /&gt; <br>&nbsp;&nbsp;&nbsp;&nbsp;&lt;Setter Property=&quot;Template&quot;&gt; <br>&nbsp;&nbsp;&nbsp;&nbsp;&lt;Setter.Value&gt; <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;ControlTemplate TargetType=&quot;layout:TransitioningContentControl&quot;&gt; <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;Border Background=&quot;{TemplateBinding Background}&quot; BorderBrush=&quot;{TemplateBinding BorderBrush}&quot; BorderThickness=&quot;{TemplateBinding BorderThickness}&quot; CornerRadius=&quot;2&quot;&gt; <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;vsm:VisualStateManager.VisualStateGroups&gt; <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;vsm:VisualStateGroup x:Name=&quot;PresentationStates&quot;&gt; <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;vsm:VisualState x:Name=&quot;DefaultTransition&quot;&gt; <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;Storyboard&gt; <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;DoubleAnimationUsingKeyFrames BeginTime=&quot;00:00:00&quot; Storyboard.TargetName=&quot;CurrentContentPresentationSite&quot; Storyboard.TargetProperty=&quot;(UIElement.Opacity)&quot;&gt; <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;SplineDoubleKeyFrame KeyTime=&quot;00:00:00&quot; Value=&quot;0&quot; /&gt; <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;SplineDoubleKeyFrame KeyTime=&quot;00:00:02.300&quot; Value=&quot;1&quot; /&gt; <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/DoubleAnimationUsingKeyFrames&gt; <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;DoubleAnimationUsingKeyFrames BeginTime=&quot;00:00:00&quot; Storyboard.TargetName=&quot;PreviousContentPresentationSite&quot; Storyboard.TargetProperty=&quot;(UIElement.Opacity)&quot;&gt; <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;SplineDoubleKeyFrame KeyTime=&quot;00:00:00&quot; Value=&quot;1&quot; /&gt; <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;SplineDoubleKeyFrame KeyTime=&quot;00:00:02.300&quot; Value=&quot;0&quot; /&gt; <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/DoubleAnimationUsingKeyFrames&gt; <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/Storyboard&gt; <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/vsm:VisualState&gt; <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;vsm:VisualState x:Name=&quot;Normal&quot;&gt; <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;Storyboard&gt; <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;ObjectAnimationUsingKeyFrames BeginTime=&quot;00:00:00&quot; Storyboard.TargetName=&quot;PreviousContentPresentationSite&quot; Storyboard.TargetProperty=&quot;(UIElement.Visibility)&quot;&gt; <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;DiscreteObjectKeyFrame KeyTime=&quot;00:00:00&quot;&gt; <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;DiscreteObjectKeyFrame.Value&gt; <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;Visibility&gt; <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Collapsed <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/Visibility&gt; <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/DiscreteObjectKeyFrame.Value&gt; <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/DiscreteObjectKeyFrame&gt; <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/ObjectAnimationUsingKeyFrames&gt; <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/Storyboard&gt; <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/vsm:VisualState&gt; </pre>
<p><a shape="rect" href="http://11011.net/software/vspaste" shape="rect"></a><br />Though I won’t break the <em>Style</em> down in detail, I’ll point a couple of highlights. First, the
<em>Transition</em> property is set to the <em>VisualState</em> that you would like to use as the transition between pages. Every transition will use this
<em>VisualState</em> storyboard. The <em>DefaultTransition</em> <em>VisualState</em> is an example of how
<em>Storyboards</em> are constructed for use in a transition. As you can see, each
<em>Storyboard</em> must target both the <em>CurrentContentPresentationSite</em> and the
<em>PreviousContentPresentationSite</em> (these are the <em>ContentPresenters</em> discussed earlier). You can target more than one property, if you like. Below is a custom transition that rotates the projection plane and the opacity of the
<em>ContentPresenters</em>.</p>
<pre class="code">&lt;vsm:VisualState x:Name=&quot;SwingTransition&quot;&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&lt;Storyboard&gt; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;DoubleAnimationUsingKeyFrames Storyboard.TargetProperty=&quot;(UIElement.Projection).(PlaneProjection.RotationY)&quot; Storyboard.TargetName=&quot;PreviousContentPresentationSite&quot;&gt; <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;EasingDoubleKeyFrame KeyTime=&quot;0&quot; Value=&quot;0&quot;/&gt; <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;EasingDoubleKeyFrame KeyTime=&quot;0:0:0.7&quot; Value=&quot;90&quot;/&gt; <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/DoubleAnimationUsingKeyFrames&gt; <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;DoubleAnimationUsingKeyFrames Storyboard.TargetProperty=&quot;(UIElement.Opacity)&quot; Storyboard.TargetName=&quot;PreviousContentPresentationSite&quot;&gt; <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;EasingDoubleKeyFrame KeyTime=&quot;0&quot; Value=&quot;1&quot;/&gt; <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;EasingDoubleKeyFrame KeyTime=&quot;0:0:0.7&quot; Value=&quot;0&quot;/&gt; <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/DoubleAnimationUsingKeyFrames&gt; <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;DoubleAnimation Duration=&quot;0&quot; To=&quot;0&quot; Storyboard.TargetProperty=&quot;(UIElement.Projection).(PlaneProjection.CenterOfRotationX)&quot; Storyboard.TargetName=&quot;PreviousContentPresentationSite&quot; /&gt; <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;DoubleAnimation Duration=&quot;0&quot; To=&quot;1&quot; Storyboard.TargetProperty=&quot;(UIElement.Projection).(PlaneProjection.CenterOfRotationX)&quot; Storyboard.TargetName=&quot;CurrentContentPresentationSite&quot; /&gt; <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;DoubleAnimationUsingKeyFrames Storyboard.TargetProperty=&quot;(UIElement.Projection).(PlaneProjection.RotationY)&quot; Storyboard.TargetName=&quot;CurrentContentPresentationSite&quot;&gt; <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;EasingDoubleKeyFrame KeyTime=&quot;0&quot; Value=&quot;90&quot;/&gt; &lt;EasingDoubleKeyFrame KeyTime=&quot;0:0:0.7&quot; Value=&quot;0&quot;/&gt; <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/DoubleAnimationUsingKeyFrames&gt; <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;DoubleAnimationUsingKeyFrames Storyboard.TargetProperty=&quot;(UIElement.Opacity)&quot; Storyboard.TargetName=&quot;CurrentContentPresentationSite&quot;&gt; <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;EasingDoubleKeyFrame KeyTime=&quot;0&quot; Value=&quot;0&quot;/&gt; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;EasingDoubleKeyFrame KeyTime=&quot;0:0:0.7&quot; Value=&quot;1&quot;/&gt; <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/DoubleAnimationUsingKeyFrames&gt; <br>&nbsp;&nbsp;&nbsp;&nbsp;&lt;/Storyboard&gt; <br>&lt;/vsm:VisualState&gt; </pre>
<p>That’s it. You now have transitions any time you Navigate to a new <em>PhoneNavigationPage</em>.&nbsp;
</p>
 <img src="http://m.webtrends.com/dcs1wotjh10000w0irc493s0e_6x1g/njs.gif?dcssip=channel9.msdn.com&dcsuri=http://channel9.msdn.com/Blogs/SlickThought/feed&WT.dl=0&WT.entryid=Entry:RSSView:b3dd765e28014f9cbbae9deb002d77ac">]]></description>
      <comments>http://channel9.msdn.com/Blogs/SlickThought/Simplify-Page-Transitions-in-Windows-Phone-7-Silverlight-Applications</comments>
      <itunes:summary>
Update: To see how to extend this solution for custom per-page transitions, see

my follow-on article.If you have played around with Silverlight on Windows Phone 7, one thing you may have tried to figure out is how to add nice transitions between different pages of your application. By default, Windows Phone page transitions aren’t really transitions at all.
 The new PhoneNavigationPage is just popped into the root PhoneNavigationFrame. Effective, yes. Cool? Certainly not. Face it, modern mobile applications need to not only be functional, but also stylish. Simple “snap” transitions just don’t
 cut it. 
The most common solution to this problem is to use brute force and manage the transitions yourself. You commonly see a “pattern” used in WP7 apps where events in your current page launch a Storyboard animation. When that animation is complete, the actual
 navigation to the new page is invoked and the new page then runs its own Storyboard once it is loaded. It looks something like this… 
// CURRENT PAGE private void CurrentPage_Click(object sender, EventArgs e) { &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;SomeStoryboard.Completed &amp;#43;= new EventHandler(SomeStoryboard_Completed); &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;SomeStoryboard.Begin(); } void SomeStoryboard_Completed(object sender, EventArgs e) { &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;NavigationService.Navigate(new Uri(&amp;quot;/Favorites&amp;quot;, UriKind.Relative)); }
&amp;nbsp; 
// NEWPAGE protected override void OnNavigatedTo(Microsoft.Phone.Navigation.PhoneNavigationEventArgs e) { &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;base.OnNavigatedTo(e); &amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;SomeNewStoryboard.Begin(); }
It’s a straightforward solution, and it works just fine if your app has only a few pages. If you have lots of pages in your application, however, it becomes quite tedious and hard to maintain. 
A better solution can be found by turning to the Silverlight Toolkit. The great thing about having Silverlight on WP7 is that you can leverage many existing Silv</itunes:summary>
      <itunes:duration>870</itunes:duration>
      <link>http://channel9.msdn.com/Blogs/SlickThought/Simplify-Page-Transitions-in-Windows-Phone-7-Silverlight-Applications</link>
      <pubDate>Fri, 30 Apr 2010 15:37:00 GMT</pubDate>
      <guid isPermaLink="false">http://channel9.msdn.com/Blogs/SlickThought/Simplify-Page-Transitions-in-Windows-Phone-7-Silverlight-Applications</guid>
      <media:thumbnail url="http://ecn.channel9.msdn.com/o9/previewImages/100/546486_100x75.jpg" height="75" width="100"></media:thumbnail>
      <media:thumbnail url="http://ecn.channel9.msdn.com/o9/previewImages/220/546486_220x165.jpg" height="165" width="220"></media:thumbnail>
      <media:thumbnail url="http://ecn.channel9.msdn.com/o9/ch9/6/8/4/6/4/5/WP7Transitions_320_ch9.png" height="240" width="320"></media:thumbnail>
      <media:thumbnail url="http://ecn.channel9.msdn.com/o9/ch9/6/8/4/6/4/5/WP7Transitions_512_ch9.png" height="384" width="512"></media:thumbnail>
      <media:thumbnail url="http://ecn.channel9.msdn.com/o9/ch9/6/8/4/6/4/5/WP7Transitions_85_ch9.png" height="64" width="85"></media:thumbnail>
      <media:group>
        <media:content url="http://ecn.channel9.msdn.com/o9/ch9/6/8/4/6/4/5/WP7Transitions_2MB_ch9.wmv" expression="full" duration="870" fileSize="59714671" type="video/x-ms-wmv" medium="video"></media:content>
        <media:content url="http://ecn.channel9.msdn.com/o9/ch9/6/8/4/6/4/5/WP7Transitions_ch9.mp3" expression="full" duration="870" fileSize="6965698" type="audio/mp3" medium="audio"></media:content>
        <media:content url="http://ecn.channel9.msdn.com/o9/ch9/6/8/4/6/4/5/WP7Transitions_ch9.mp4" expression="full" duration="870" fileSize="52141864" type="video/mp4" medium="video"></media:content>
        <media:content url="http://ecn.channel9.msdn.com/o9/ch9/6/8/4/6/4/5/WP7Transitions_ch9.wma" expression="full" duration="870" fileSize="7046355" type="audio/x-ms-wma" medium="audio"></media:content>
        <media:content url="http://ecn.channel9.msdn.com/o9/ch9/6/8/4/6/4/5/WP7Transitions_ch9.wmv" expression="full" duration="870" fileSize="54785715" type="video/x-ms-wmv" medium="video"></media:content>
        <media:content url="http://ecn.channel9.msdn.com/o9/ch9/6/8/4/6/4/5/WP7Transitions_Zune_ch9.wmv" expression="full" duration="870" fileSize="41969767" type="video/x-ms-wmv" medium="video"></media:content>
      </media:group>      
      <enclosure url="http://ecn.channel9.msdn.com/o9/ch9/6/8/4/6/4/5/WP7Transitions_Zune_ch9.wmv" length="41969767" type="video/x-ms-wmv"></enclosure>
      <dc:creator>Jeff Brand</dc:creator>
      <itunes:author>Jeff Brand</itunes:author>
      <slash:comments>24</slash:comments>
      <wfw:commentRss>http://channel9.msdn.com/Blogs/SlickThought/Simplify-Page-Transitions-in-Windows-Phone-7-Silverlight-Applications/RSS</wfw:commentRss>
      <category>Windows Phone</category>
    </item>
  <item>
      <title>Peer to Peer Series Part 7: PeerChannel Basics</title>
      <description><![CDATA[In Part 7, I introduce the basics of building a WCF PeerChannel application.&nbsp; Using a simple console application, the following steps are shown:<br /><ul>
<li>Creating the necessary interfaces </li><li>Setting up the WCF enviornment </li><li>Checking online status </li><li>Sending and receiving messages </li></ul>
<p>While basic, it demonstrates the core steps used in PeerChannel applications.&nbsp; It also sets the stage for a more detailed look at the Buzzword Bingo application shown in Part 6.</p>
 <img src="http://m.webtrends.com/dcs1wotjh10000w0irc493s0e_6x1g/njs.gif?dcssip=channel9.msdn.com&dcsuri=http://channel9.msdn.com/Blogs/SlickThought/feed&WT.dl=0&WT.entryid=Entry:RSSView:5335d90d780f4ad280079deb002d875a">]]></description>
      <comments>http://channel9.msdn.com/Blogs/SlickThought/Peer-to-Peer-Series-Part-7-PeerChannel-Basics</comments>
      <itunes:summary>In Part 7, I introduce the basics of building a WCF PeerChannel application.&amp;nbsp; Using a simple console application, the following steps are shown:
Creating the necessary interfaces Setting up the WCF enviornment Checking online status Sending and receiving messages 
While basic, it demonstrates the core steps used in PeerChannel applications.&amp;nbsp; It also sets the stage for a more detailed look at the Buzzword Bingo application shown in Part 6. 
</itunes:summary>
      <itunes:duration>756</itunes:duration>
      <link>http://channel9.msdn.com/Blogs/SlickThought/Peer-to-Peer-Series-Part-7-PeerChannel-Basics</link>
      <pubDate>Fri, 11 Dec 2009 14:39:00 GMT</pubDate>
      <guid isPermaLink="false">http://channel9.msdn.com/Blogs/SlickThought/Peer-to-Peer-Series-Part-7-PeerChannel-Basics</guid>
      <media:thumbnail url="http://ecn.channel9.msdn.com/o9/previewImages/100/512239_100x75.jpg" height="75" width="100"></media:thumbnail>
      <media:thumbnail url="http://ecn.channel9.msdn.com/o9/previewImages/220/512239_220x165.jpg" height="165" width="220"></media:thumbnail>
      <media:thumbnail url="http://ecn.channel9.msdn.com/o9/ch9/9/3/2/2/1/5/PnrpPart7_320_ch9.png" height="240" width="320"></media:thumbnail>
      <media:thumbnail url="http://ecn.channel9.msdn.com/o9/ch9/9/3/2/2/1/5/PnrpPart7_512_ch9.png" height="384" width="512"></media:thumbnail>
      <media:thumbnail url="http://ecn.channel9.msdn.com/o9/ch9/9/3/2/2/1/5/PnrpPart7_85_ch9.png" height="64" width="85"></media:thumbnail>
      <media:group>
        <media:content url="http://ecn.channel9.msdn.com/o9/ch9/9/3/2/2/1/5/PnrpPart7_2MB_ch9.wmv" expression="full" duration="756" fileSize="38913987" type="video/x-ms-wmv" medium="video"></media:content>
        <media:content url="http://ecn.channel9.msdn.com/o9/ch9/9/3/2/2/1/5/PnrpPart7_ch9.mp3" expression="full" duration="756" fileSize="6053450" type="audio/mp3" medium="audio"></media:content>
        <media:content url="http://ecn.channel9.msdn.com/o9/ch9/9/3/2/2/1/5/PnrpPart7_ch9.mp4" expression="full" duration="756" fileSize="37413951" type="video/mp4" medium="video"></media:content>
        <media:content url="http://ecn.channel9.msdn.com/o9/ch9/9/3/2/2/1/5/PnrpPart7_ch9.wma" expression="full" duration="756" fileSize="6124125" type="audio/x-ms-wma" medium="audio"></media:content>
        <media:content url="http://ecn.channel9.msdn.com/o9/ch9/9/3/2/2/1/5/PnrpPart7_Zune_ch9.wmv" expression="full" duration="756" fileSize="29504169" type="video/x-ms-wmv" medium="video"></media:content>
      </media:group>      
      <enclosure url="http://ecn.channel9.msdn.com/o9/ch9/9/3/2/2/1/5/PnrpPart7_Zune_ch9.wmv" length="29504169" type="video/x-ms-wmv"></enclosure>
      <dc:creator>Jeff Brand</dc:creator>
      <itunes:author>Jeff Brand</itunes:author>
      <slash:comments>0</slash:comments>
      <wfw:commentRss>http://channel9.msdn.com/Blogs/SlickThought/Peer-to-Peer-Series-Part-7-PeerChannel-Basics/RSS</wfw:commentRss>
      <category>Peer to Peer</category>
      <category>Peer</category>
      <category>PeerChannel</category>
      <category>WCF</category>
    </item>
  <item>
      <title>Peer to Peer Series Part 6: Introduction to PeerChannel</title>
      <description><![CDATA[In Part&nbsp;6 of the Peer to Peer Series, I set the stage for learning how to use WCF's PeerChannel.&nbsp; After a simple overview of PeerChannel, I show a sample application that uses PeerChannel to play buzzword bingo.&nbsp; The focus of this installment is to give
 an understanding of some of the key considerations one must think about&nbsp;dealing with the message broadcasts that comprise&nbsp;a PeerChannel application.<br /><br />The next few installments will focus extensively on building peer applications using PeerChannel.
<br /><br /><strong>Important Note:</strong> I errored in splicing my video together.&nbsp; The demo is actually later in the video and not immediately after the demo transition slide.&nbsp;Everything is there, just not in the right order. &nbsp;I'll try and get an edited version up
 later.  <img src="http://m.webtrends.com/dcs1wotjh10000w0irc493s0e_6x1g/njs.gif?dcssip=channel9.msdn.com&dcsuri=http://channel9.msdn.com/Blogs/SlickThought/feed&WT.dl=0&WT.entryid=Entry:RSSView:009d6140859346fcbd449deb002d8b8d">]]></description>
      <comments>http://channel9.msdn.com/Blogs/SlickThought/Peer-to-Peer-Series-Part-6-Introduction-to-PeerChannel</comments>
      <itunes:summary>In Part&amp;nbsp;6 of the Peer to Peer Series, I set the stage for learning how to use WCF&#39;s PeerChannel.&amp;nbsp; After a simple overview of PeerChannel, I show a sample application that uses PeerChannel to play buzzword bingo.&amp;nbsp; The focus of this installment is to give
 an understanding of some of the key considerations one must think about&amp;nbsp;dealing with the message broadcasts that comprise&amp;nbsp;a PeerChannel application.The next few installments will focus extensively on building peer applications using PeerChannel.
Important Note: I errored in splicing my video together.&amp;nbsp; The demo is actually later in the video and not immediately after the demo transition slide.&amp;nbsp;Everything is there, just not in the right order. &amp;nbsp;I&#39;ll try and get an edited version up
 later. </itunes:summary>
      <itunes:duration>585</itunes:duration>
      <link>http://channel9.msdn.com/Blogs/SlickThought/Peer-to-Peer-Series-Part-6-Introduction-to-PeerChannel</link>
      <pubDate>Fri, 06 Nov 2009 16:32:00 GMT</pubDate>
      <guid isPermaLink="false">http://channel9.msdn.com/Blogs/SlickThought/Peer-to-Peer-Series-Part-6-Introduction-to-PeerChannel</guid>
      <media:thumbnail url="http://ecn.channel9.msdn.com/o9/previewImages/100/504523_100x75.jpg" height="75" width="100"></media:thumbnail>
      <media:thumbnail url="http://ecn.channel9.msdn.com/o9/previewImages/220/504523_220x165.jpg" height="165" width="220"></media:thumbnail>
      <media:thumbnail url="http://ecn.channel9.msdn.com/o9/ch9/3/2/5/4/0/5/PnrpPart6_320_ch9.png" height="240" width="320"></media:thumbnail>
      <media:thumbnail url="http://ecn.channel9.msdn.com/o9/ch9/3/2/5/4/0/5/PnrpPart6_512_ch9.png" height="384" width="512"></media:thumbnail>
      <media:thumbnail url="http://ecn.channel9.msdn.com/o9/ch9/3/2/5/4/0/5/PnrpPart6_85_ch9.png" height="64" width="85"></media:thumbnail>
      <media:group>
        <media:content url="http://ecn.channel9.msdn.com/o9/ch9/3/2/5/4/0/5/PnrpPart6_2MB_ch9.wmv" expression="full" duration="585" fileSize="31736961" type="video/x-ms-wmv" medium="video"></media:content>
        <media:content url="http://ecn.channel9.msdn.com/o9/ch9/3/2/5/4/0/5/PnrpPart6_ch9.mp3" expression="full" duration="585" fileSize="4683607" type="audio/mp3" medium="audio"></media:content>
        <media:content url="http://ecn.channel9.msdn.com/o9/ch9/3/2/5/4/0/5/PnrpPart6_ch9.mp4" expression="full" duration="585" fileSize="28777172" type="video/mp4" medium="video"></media:content>
        <media:content url="http://ecn.channel9.msdn.com/o9/ch9/3/2/5/4/0/5/PnrpPart6_ch9.wma" expression="full" duration="585" fileSize="4739275" type="audio/x-ms-wma" medium="audio"></media:content>
        <media:content url="http://ecn.channel9.msdn.com/o9/ch9/3/2/5/4/0/5/PnrpPart6_ch9.wmv" expression="full" duration="585" fileSize="26829717" type="video/x-ms-wmv" medium="video"></media:content>
        <media:content url="http://ecn.channel9.msdn.com/o9/ch9/3/2/5/4/0/5/PnrpPart6_Zune_ch9.wmv" expression="full" duration="585" fileSize="22797769" type="video/x-ms-wmv" medium="video"></media:content>
      </media:group>      
      <enclosure url="http://ecn.channel9.msdn.com/o9/ch9/3/2/5/4/0/5/PnrpPart6_ch9.wmv" length="26829717" type="video/x-ms-wmv"></enclosure>
      <dc:creator>Jeff Brand</dc:creator>
      <itunes:author>Jeff Brand</itunes:author>
      <slash:comments>0</slash:comments>
      <wfw:commentRss>http://channel9.msdn.com/Blogs/SlickThought/Peer-to-Peer-Series-Part-6-Introduction-to-PeerChannel/RSS</wfw:commentRss>
      <category>Peer to Peer</category>
      <category>Peer</category>
      <category>PeerChannel</category>
      <category>PNRP</category>
      <category>WCF</category>
    </item>
  <item>
      <title>Peer to Peer Series Part 5: Direct Connect Peers via WCF</title>
      <description><![CDATA[
<p>In Part 5 of the Peer to Peer Series, I show a sample application that uses PNRP to connect a client application to a server application using WCF and PNRP Peer Host Names. The details of the actual WCF Service implementation.&nbsp; Instead, I will focus on those
 areas of leveraging PNRP to establish connections via WCF.</p>
<p>The video will show a sample application that is comprised of a client and a server application.&nbsp; You could use a more “peer-to-peer” duplex-style of communication, but the client-server arrangement makes the two key parts of establishing a WCF connection
 easier to explain.</p>
<p>When hosting a WCF service, the key code from the <i>IntelServiceHost.cs</i> file is shown below:</p>
<p>&nbsp;</p>
<div id="codeSnippetWrapper">
<div id="codeSnippet">
<pre>this.PeerRegistration.Start(peerClassifier, port);</pre>
<pre>Uri tcpUri = new Uri(string.Format(&quot;net.tcp://{0}:{1}/IntelService&quot;, this.PeerRegistration.PeerUri, port));</pre>
<pre>_serviceHost = new ServiceHost(service, tcpUri);</pre>
<pre>NetTcpBinding tcpBinding = new NetTcpBinding(SecurityMode.None);</pre>
<pre>_serviceHost.AddServiceEndpoint(typeof(IIntelService), tcpBinding, &quot;&quot;);</pre>
<pre>&nbsp;</pre>
</div>
</div>
<p>The PeerRegistration property exposes a wrapper class around the PNRP API.&nbsp; The
<i>Start</i> method registers the application with a given peer classifier and port as an unsecure peer name in the Global PNRP Cloud.&nbsp; The
<i>PeerUri</i> property passes back the <i>peerhostname.&nbsp; </i>That uri is used to setup a new Uri, along with the port, that is then used to configure the ServiceHost using a NetTcpBinding.&nbsp; Some of this could have been configured in the application’s config
 file, but I put it all here so you can see how the different parts relate.</p>
<p>The client side of the equation is even easier (found in the <i>IntelClient.cs</i> file):</p>
<div id="codeSnippetWrapper">
<div id="codeSnippetWrapper">
<div id="codeSnippet">
<pre>PeerNameResult peerRecord = PeerResolution.ResolveHostName(hostPeerName);</pre>
<pre>&nbsp;</pre>
<pre>System.ServiceModel.Channels.Binding netBinding = new NetTcpBinding(SecurityMode.None);</pre>
<pre>EndpointAddress endpointAddress = new EndpointAddress(string.Format(&quot;net.tcp://{0}:{1}/IntelService&quot;, peerRecord.Uri, peerRecord.Port));</pre>
<pre>&nbsp;</pre>
<pre>IntelServiceProxy = new IntelProxy(netBinding, endpointAddress);</pre>
</div>
</div>
</div>
<p>The <i>PeerResolution</i> class is another wrapper around the PNRP API, this time providing&nbsp;resolving a given unsecure peer name in the Global PNRP cloud.&nbsp; It returns an object containing the remote peer’s
<i>peerhostname</i> and port. The rest of the code is just setting up the client side of the WCF connection.</p>
<p>Other documentation for PNRP: </p>
<ul>
<li><a shape="rect" href="http://msdn.microsoft.com/en-us/library/system.net.peertopeer.aspx" shape="rect">System.Net.PeerToPeer Namespace</a>
</li><li><a shape="rect" href="http://www.leastprivilege.com/P2PAndWCFRegisteringAService.aspx" shape="rect">P2P Registration Article</a>
</li><li><a shape="rect" href="http://technet.microsoft.com/en-us/library/bb726971.aspx" shape="rect">Peer Name Resolution Protocol</a>
</li></ul>
<p>Find the demo code at <a shape="rect" href="http://slickthought.net" shape="rect">
http://slickthought.net</a></p>
 <img src="http://m.webtrends.com/dcs1wotjh10000w0irc493s0e_6x1g/njs.gif?dcssip=channel9.msdn.com&dcsuri=http://channel9.msdn.com/Blogs/SlickThought/feed&WT.dl=0&WT.entryid=Entry:RSSView:4536d5c7c9ab45a1ba759deb002d8fe5">]]></description>
      <comments>http://channel9.msdn.com/Blogs/SlickThought/Peer-to-Peer-Series-Part-5-Connecting-Peers-via-WCF</comments>
      <itunes:summary>
In Part 5 of the Peer to Peer Series, I show a sample application that uses PNRP to connect a client application to a server application using WCF and PNRP Peer Host Names. The details of the actual WCF Service implementation.&amp;nbsp; Instead, I will focus on those
 areas of leveraging PNRP to establish connections via WCF. 
The video will show a sample application that is comprised of a client and a server application.&amp;nbsp; You could use a more “peer-to-peer” duplex-style of communication, but the client-server arrangement makes the two key parts of establishing a WCF connection
 easier to explain. 
When hosting a WCF service, the key code from the IntelServiceHost.cs file is shown below: 
&amp;nbsp; 


this.PeerRegistration.Start(peerClassifier, port);
Uri tcpUri = new Uri(string.Format(&amp;quot;net.tcp://{0}:{1}/IntelService&amp;quot;, this.PeerRegistration.PeerUri, port));
_serviceHost = new ServiceHost(service, tcpUri);
NetTcpBinding tcpBinding = new NetTcpBinding(SecurityMode.None);
_serviceHost.AddServiceEndpoint(typeof(IIntelService), tcpBinding, &amp;quot;&amp;quot;);
&amp;nbsp;


The PeerRegistration property exposes a wrapper class around the PNRP API.&amp;nbsp; The
Start method registers the application with a given peer classifier and port as an unsecure peer name in the Global PNRP Cloud.&amp;nbsp; The
PeerUri property passes back the peerhostname.&amp;nbsp; That uri is used to setup a new Uri, along with the port, that is then used to configure the ServiceHost using a NetTcpBinding.&amp;nbsp; Some of this could have been configured in the application’s config
 file, but I put it all here so you can see how the different parts relate. 
The client side of the equation is even easier (found in the IntelClient.cs file): 



PeerNameResult peerRecord = PeerResolution.ResolveHostName(hostPeerName);
&amp;nbsp;
System.ServiceModel.Channels.Binding netBinding = new NetTcpBinding(SecurityMode.None);
EndpointAddress endpointAddress = new EndpointAddress(string.Format(&amp;quot;net</itunes:summary>
      <itunes:duration>1082</itunes:duration>
      <link>http://channel9.msdn.com/Blogs/SlickThought/Peer-to-Peer-Series-Part-5-Connecting-Peers-via-WCF</link>
      <pubDate>Thu, 08 Oct 2009 17:51:00 GMT</pubDate>
      <guid isPermaLink="false">http://channel9.msdn.com/Blogs/SlickThought/Peer-to-Peer-Series-Part-5-Connecting-Peers-via-WCF</guid>
      <media:thumbnail url="http://ecn.channel9.msdn.com/o9/previewImages/100/496993_100x75.jpg" height="75" width="100"></media:thumbnail>
      <media:thumbnail url="http://ecn.channel9.msdn.com/o9/previewImages/220/496993_220x165.jpg" height="165" width="220"></media:thumbnail>
      <media:thumbnail url="http://ecn.channel9.msdn.com/o9/ch9/3/9/9/6/9/4/PeerPart5_320_ch9.png" height="240" width="320"></media:thumbnail>
      <media:thumbnail url="http://ecn.channel9.msdn.com/o9/ch9/3/9/9/6/9/4/PeerPart5_512_ch9.png" height="384" width="512"></media:thumbnail>
      <media:thumbnail url="http://ecn.channel9.msdn.com/o9/ch9/3/9/9/6/9/4/PeerPart5_85_ch9.png" height="64" width="85"></media:thumbnail>
      <media:group>
        <media:content url="http://ecn.channel9.msdn.com/o9/ch9/3/9/9/6/9/4/PeerPart5_2MB_ch9.wmv" expression="full" duration="1082" fileSize="47931943" type="video/x-ms-wmv" medium="video"></media:content>
        <media:content url="http://ecn.channel9.msdn.com/o9/ch9/3/9/9/6/9/4/PeerPart5_ch9.mp3" expression="full" duration="1082" fileSize="8664182" type="audio/mp3" medium="audio"></media:content>
        <media:content url="http://ecn.channel9.msdn.com/o9/ch9/3/9/9/6/9/4/PeerPart5_ch9.mp4" expression="full" duration="1082" fileSize="49038982" type="video/mp4" medium="video"></media:content>
        <media:content url="http://ecn.channel9.msdn.com/o9/ch9/3/9/9/6/9/4/PeerPart5_ch9.wma" expression="full" duration="1082" fileSize="8761637" type="audio/x-ms-wma" medium="audio"></media:content>
        <media:content url="http://ecn.channel9.msdn.com/o9/ch9/3/9/9/6/9/4/PeerPart5_ch9.wmv" expression="full" duration="1082" fileSize="47044681" type="video/x-ms-wmv" medium="video"></media:content>
        <media:content url="http://ecn.channel9.msdn.com/o9/ch9/3/9/9/6/9/4/PeerPart5_Zune_ch9.wmv" expression="full" duration="1082" fileSize="35940661" type="video/x-ms-wmv" medium="video"></media:content>
        <media:content url="http://ss.channel9.msdn.com/ch9/3/9/9/6/9/4/PeerPart5.ism" expression="full" duration="1082" fileSize="1" type="video/x-ms-wmv" medium="video"></media:content>
      </media:group>      
      <enclosure url="http://ecn.channel9.msdn.com/o9/ch9/3/9/9/6/9/4/PeerPart5_ch9.wmv" length="47044681" type="video/x-ms-wmv"></enclosure>
      <dc:creator>Jeff Brand</dc:creator>
      <itunes:author>Jeff Brand</itunes:author>
      <slash:comments>0</slash:comments>
      <wfw:commentRss>http://channel9.msdn.com/Blogs/SlickThought/Peer-to-Peer-Series-Part-5-Connecting-Peers-via-WCF/RSS</wfw:commentRss>
      <category>.NET</category>
      <category>.NET Framework</category>
      <category>C#</category>
      <category>Peer</category>
      <category>WCF</category>
    </item>
  <item>
      <title>Peer to Peer Series: Sample WPF PNRP Application</title>
      <description><![CDATA[
<p>Building on the examples for the first four installments, I whipped up a little WPF app that uses PNRP.&nbsp; You can create registrations and look them up.&nbsp;&nbsp;It is a good example of using the various features of PNRP to form the foundation of a P2P application.
 I banged this app out pretty quickly so no snarking on things that may be incorrect, designed poorly, whatever.
</p>
<p><a shape="rect" href="http://slickthought.net/tracker.aspx?file=download\peertopeer.zip" shape="rect">Download PeerToPeer Code Here</a></p>
<p><a shape="rect" href="http://slickthought.net/tracker.aspx?file=download\peertopeer.zip" shape="rect"></a></p>
 <img src="http://m.webtrends.com/dcs1wotjh10000w0irc493s0e_6x1g/njs.gif?dcssip=channel9.msdn.com&dcsuri=http://channel9.msdn.com/Blogs/SlickThought/feed&WT.dl=0&WT.entryid=Entry:RSSView:303879bc553e4828a9c59deb002d9536">]]></description>
      <comments>http://channel9.msdn.com/Blogs/SlickThought/Peer-to-Peer-Series-Sample-WPF-PNRP-Application</comments>
      <itunes:summary>
Building on the examples for the first four installments, I whipped up a little WPF app that uses PNRP.&amp;nbsp; You can create registrations and look them up.&amp;nbsp;&amp;nbsp;It is a good example of using the various features of PNRP to form the foundation of a P2P application.
 I banged this app out pretty quickly so no snarking on things that may be incorrect, designed poorly, whatever.
 
Download PeerToPeer Code Here 
 
</itunes:summary>
      <link>http://channel9.msdn.com/Blogs/SlickThought/Peer-to-Peer-Series-Sample-WPF-PNRP-Application</link>
      <pubDate>Fri, 18 Sep 2009 15:56:00 GMT</pubDate>
      <guid isPermaLink="false">http://channel9.msdn.com/Blogs/SlickThought/Peer-to-Peer-Series-Sample-WPF-PNRP-Application</guid>      
      <dc:creator>Jeff Brand</dc:creator>
      <itunes:author>Jeff Brand</itunes:author>
      <slash:comments>0</slash:comments>
      <wfw:commentRss>http://channel9.msdn.com/Blogs/SlickThought/Peer-to-Peer-Series-Sample-WPF-PNRP-Application/RSS</wfw:commentRss>
      <category>C#</category>
      <category>Peer to Peer</category>
      <category>Peer</category>
      <category>PNRP</category>
    </item>
  <item>
      <title>Peer to Peer Series Part 4: Resolving Peer Names Asynchronously</title>
      <description><![CDATA[
<p>In Part 4 of the Peer to Peer Series, I modify the Resolve program to find Peer Names using the asynchronous methods.&nbsp; Below is a very simple example of using the ResolveAsync method:</p>
<div id="codeSnippetWrapper">
<div id="codeSnippet">
<pre>PeerNameResolver resolver = new PeerNameResolver();</pre>
<pre>&nbsp;</pre>
<pre>try</pre>
<pre>{</pre>
<pre> resolver.ResolveCompleted &#43;= new EventHandler&lt;ResolveCompletedEventArgs&gt;(resolver_ResolveCompleted);</pre>
<pre> resolver.ResolveAsync(new PeerName(classifier, PeerNameType.Secured), Guid.NewGuid());</pre>
<pre>}</pre>
<pre>catch (PeerToPeerException ex)</pre>
<pre>{</pre>
<pre> // There are other standard exceptions you can also catch - see docs</pre>
<pre> Console.WriteLine(&quot;PeerToPeer Excpetion: {0)&quot;, ex.Message);</pre>
<pre>}</pre>
<pre>&nbsp;</pre>
<pre>static void resolver_ResolveCompleted(object sender, ResolveCompletedEventArgs e)</pre>
<pre>{</pre>
<pre> if (!e.Cancelled &amp;&amp; e.Error == null &amp;&amp; e.PeerNameRecordCollection != null)</pre>
<pre> {</pre>
<pre> records = e.PeerNameRecordCollection;</pre>
<pre> DisplayResults();</pre>
<pre> }</pre>
<pre>}</pre>
</div>
</div>
<p>There is also a ResolveProgress event you can also wire up.&nbsp; As the name implies, it will fire periodically to indicate the progress being made in resolving the Peer Name.&nbsp; It was not overly useful when resolving a Peer Name that had a small number of results,
 but your mileage may vary.</p>
<p>The one thing that is also a “brute force” implementation in the demo code is how I pass a Guid.NewGuid() into the ResolveAsync method.&nbsp; The Guid is being used as the UserState parameter in the method, and can actually be any Object. In a real implementation
 where you may have multiple ResovleAsync requests in-flight at any one time, you would want to implement a tracking system using this UserState parameter so&nbsp; you could match up the corresponding ResolveCompleted event with the correct initiating request.&nbsp;
 The ResolveCompleteEventArgs parameter contains the UserState used to initiate the request, so the matching is pretty straightforward.&nbsp; I did not go the extra mile and implement that since the demo only fired a single ResolveAsync request.&nbsp; You cannot pass
 in a null UserState object, so I went with a simple Guid for no particularly good reason.</p>
<p>Other documentation for PNRP:</p>
<ul>
<li><a shape="rect" href="http://msdn.microsoft.com/en-us/library/system.net.peertopeer.aspx" shape="rect">System.Net.PeerToPeer Namespace</a>
</li><li><a shape="rect" href="http://www.leastprivilege.com/P2PAndWCFRegisteringAService.aspx" shape="rect">P2P Registration Article</a>
</li><li><a shape="rect" href="http://technet.microsoft.com/en-us/library/bb726971.aspx" shape="rect">Peer Name Resolution Protocol</a>
</li></ul>
<br /><a shape="rect" href="http://slickthought.net/tracker.aspx?file=download\peertopeer.zip" shape="rect">Download the Demo Code</a>
 <img src="http://m.webtrends.com/dcs1wotjh10000w0irc493s0e_6x1g/njs.gif?dcssip=channel9.msdn.com&dcsuri=http://channel9.msdn.com/Blogs/SlickThought/feed&WT.dl=0&WT.entryid=Entry:RSSView:dc2a6c0159c842fc8fdf9deb002d985d">]]></description>
      <comments>http://channel9.msdn.com/Blogs/SlickThought/Peer-to-Peer-Series-Part-4-Resolving-Peer-Names-Asynchronously</comments>
      <itunes:summary>
In Part 4 of the Peer to Peer Series, I modify the Resolve program to find Peer Names using the asynchronous methods.&amp;nbsp; Below is a very simple example of using the ResolveAsync method: 


PeerNameResolver resolver = new PeerNameResolver();
&amp;nbsp;
try
{
 resolver.ResolveCompleted &amp;#43;= new EventHandler&amp;lt;ResolveCompletedEventArgs&amp;gt;(resolver_ResolveCompleted);
 resolver.ResolveAsync(new PeerName(classifier, PeerNameType.Secured), Guid.NewGuid());
}
catch (PeerToPeerException ex)
{
 // There are other standard exceptions you can also catch - see docs
 Console.WriteLine(&amp;quot;PeerToPeer Excpetion: {0)&amp;quot;, ex.Message);
}
&amp;nbsp;
static void resolver_ResolveCompleted(object sender, ResolveCompletedEventArgs e)
{
 if (!e.Cancelled &amp;amp;&amp;amp; e.Error == null &amp;amp;&amp;amp; e.PeerNameRecordCollection != null)
 {
 records = e.PeerNameRecordCollection;
 DisplayResults();
 }
}


There is also a ResolveProgress event you can also wire up.&amp;nbsp; As the name implies, it will fire periodically to indicate the progress being made in resolving the Peer Name.&amp;nbsp; It was not overly useful when resolving a Peer Name that had a small number of results,
 but your mileage may vary. 
The one thing that is also a “brute force” implementation in the demo code is how I pass a Guid.NewGuid() into the ResolveAsync method.&amp;nbsp; The Guid is being used as the UserState parameter in the method, and can actually be any Object. In a real implementation
 where you may have multiple ResovleAsync requests in-flight at any one time, you would want to implement a tracking system using this UserState parameter so&amp;nbsp; you could match up the corresponding ResolveCompleted event with the correct initiating request.&amp;nbsp;
 The ResolveCompleteEventArgs parameter contains the UserState used to initiate the request, so the matching is pretty straightforward.&amp;nbsp; I did not go the extra mile and implement that since the demo only fired a single ResolveAsync request.&amp;nbsp;</itunes:summary>
      <itunes:duration>327</itunes:duration>
      <link>http://channel9.msdn.com/Blogs/SlickThought/Peer-to-Peer-Series-Part-4-Resolving-Peer-Names-Asynchronously</link>
      <pubDate>Fri, 18 Sep 2009 12:06:00 GMT</pubDate>
      <guid isPermaLink="false">http://channel9.msdn.com/Blogs/SlickThought/Peer-to-Peer-Series-Part-4-Resolving-Peer-Names-Asynchronously</guid>
      <media:thumbnail url="http://ecn.channel9.msdn.com/o9/previewImages/100/492477_100x75.jpg" height="75" width="100"></media:thumbnail>
      <media:thumbnail url="http://ecn.channel9.msdn.com/o9/previewImages/220/492477_220x165.jpg" height="165" width="220"></media:thumbnail>
      <media:thumbnail url="http://ecn.channel9.msdn.com/o9/ch9/7/7/4/2/9/4/PeerPart4_320_ch9.png" height="240" width="320"></media:thumbnail>
      <media:thumbnail url="http://ecn.channel9.msdn.com/o9/ch9/7/7/4/2/9/4/PeerPart4_512_ch9.png" height="384" width="512"></media:thumbnail>
      <media:thumbnail url="http://ecn.channel9.msdn.com/o9/ch9/7/7/4/2/9/4/PeerPart4_85_ch9.png" height="64" width="85"></media:thumbnail>
      <media:group>
        <media:content url="http://ecn.channel9.msdn.com/o9/ch9/7/7/4/2/9/4/PeerPart4_2MB_ch9.wmv" expression="full" duration="327" fileSize="24527413" type="video/x-ms-wmv" medium="video"></media:content>
        <media:content url="http://ecn.channel9.msdn.com/o9/ch9/7/7/4/2/9/4/PeerPart4_ch9.mp3" expression="full" duration="327" fileSize="2619522" type="audio/mp3" medium="audio"></media:content>
        <media:content url="http://ecn.channel9.msdn.com/o9/ch9/7/7/4/2/9/4/PeerPart4_ch9.mp4" expression="full" duration="327" fileSize="13584159" type="video/mp4" medium="video"></media:content>
        <media:content url="http://ecn.channel9.msdn.com/o9/ch9/7/7/4/2/9/4/PeerPart4_ch9.wma" expression="full" duration="327" fileSize="2654505" type="audio/x-ms-wma" medium="audio"></media:content>
        <media:content url="http://ecn.channel9.msdn.com/o9/ch9/7/7/4/2/9/4/PeerPart4_ch9.wmv" expression="full" duration="327" fileSize="19434163" type="video/x-ms-wmv" medium="video"></media:content>
        <media:content url="http://ecn.channel9.msdn.com/o9/ch9/7/7/4/2/9/4/PeerPart4_Zune_ch9.wmv" expression="full" duration="327" fileSize="14330091" type="video/x-ms-wmv" medium="video"></media:content>
      </media:group>      
      <enclosure url="http://ecn.channel9.msdn.com/o9/ch9/7/7/4/2/9/4/PeerPart4_ch9.wmv" length="19434163" type="video/x-ms-wmv"></enclosure>
      <dc:creator>Jeff Brand</dc:creator>
      <itunes:author>Jeff Brand</itunes:author>
      <slash:comments>2</slash:comments>
      <wfw:commentRss>http://channel9.msdn.com/Blogs/SlickThought/Peer-to-Peer-Series-Part-4-Resolving-Peer-Names-Asynchronously/RSS</wfw:commentRss>
      <category>C#</category>
      <category>Peer to Peer</category>
      <category>Peer</category>
      <category>PNRP</category>
    </item>
  <item>
      <title>Peer to Peer Series Part 3: Resolving Names Synchronously with the PNRP API</title>
      <description><![CDATA[
<p>In Part 3 of the Peer to Peer Series, I add another Command Prompt application to the demo solution and use the PNRP API to resolve a Peer Name using C#.&nbsp; As with registering a Peer Name, resolving Peer Names is straightforward:</p>
<div id="codeSnippetWrapper">
<pre id="codeSnippet"><p>PeerNameResolver resolver = new PeerNameResolver();</p><p>try<br>{<br> records = resolver.Resolve(new PeerName(classifier, PeerNameType.Unsecured));<br><br> if (records.Count &gt; 0)<br> {<br> foreach (var record in records)<br> {<br> Console.WriteLine(&quot;***Peer: {0},record.PeerName.ToString());<br> Console.Writeline(&quot;***Host Name: {0}, record.PeerName.PeerHostName);<br> Console.Writeline(&quot;***Comment: {0}&quot;, record.Comment);<br> foreach (var endpoint in record.EndPointCollection)<br> Console.WriteLine(&quot;\tEndpoint: {0}, Port: {1}&quot;, endpoint.Address.ToString(), endpoint.Port);<br> <br> Console.WriteLine();<br> }<br> }<br>}<br>catch (PeerToPeerException ex)<br>{<br> //Other standard execptions can also be caught<br> Console.WriteLine(&quot;PeerToPeer Excpetion: {0)&quot;, ex.Message);<br>}</p></pre>
<br /></div>
<p>One of the interesting things about resolving a Peer Name is that the resulting PeerNameRecords include the endpoint information for each of the Peer Names found.&nbsp; This means you can establish direct connections with those peers if necessary.&nbsp; I will show
 how to do just that in an upcoming screencast.&nbsp; Of course, that assumes we don’t have any firewalls or other types of security blockades preventing direct communication.</p>
<p>The example in this installment is done synchronously.&nbsp; In the next screencast, I will show you how you can do the same operation asynchronously.&nbsp; This is useful because the Resolve method can take quite a while to return so your program’s execution is blocked
 while waiting for the method to complete.&nbsp; This is especially bad in the case of GUI applications since the app will become non-responsive while waiting for Resolve to finish.</p>
<p>Other documentation for PNRP:</p>
<ul>
<li><a shape="rect" href="http://msdn.microsoft.com/en-us/library/system.net.peertopeer.aspx" shape="rect">System.Net.PeerToPeer Namespace</a>
</li><li><a shape="rect" href="http://www.leastprivilege.com/P2PAndWCFRegisteringAService.aspx" shape="rect">P2P Registration Article</a>
</li><li><a shape="rect" href="http://technet.microsoft.com/en-us/library/bb726971.aspx" shape="rect">Peer Name Resolution Protocol</a>
</li></ul>
<br /><a shape="rect" href="http://slickthought.net/tracker.aspx?file=download\peertopeer.zip" shape="rect">Download the Demo Code</a>
 <img src="http://m.webtrends.com/dcs1wotjh10000w0irc493s0e_6x1g/njs.gif?dcssip=channel9.msdn.com&dcsuri=http://channel9.msdn.com/Blogs/SlickThought/feed&WT.dl=0&WT.entryid=Entry:RSSView:401fc20520e245e0b6a19deb002d9e19">]]></description>
      <comments>http://channel9.msdn.com/Blogs/SlickThought/Peer-to-Peer-Series-Part-3-Resolving-Names-Synchronously-with-the-PNRP-API</comments>
      <itunes:summary>
In Part 3 of the Peer to Peer Series, I add another Command Prompt application to the demo solution and use the PNRP API to resolve a Peer Name using C#.&amp;nbsp; As with registering a Peer Name, resolving Peer Names is straightforward: 

PeerNameResolver resolver = new PeerNameResolver(); try{ records = resolver.Resolve(new PeerName(classifier, PeerNameType.Unsecured)); if (records.Count &amp;gt; 0) { foreach (var record in records) { Console.WriteLine(&amp;quot;***Peer: {0},record.PeerName.ToString()); Console.Writeline(&amp;quot;***Host Name: {0}, record.PeerName.PeerHostName); Console.Writeline(&amp;quot;***Comment: {0}&amp;quot;, record.Comment); foreach (var endpoint in record.EndPointCollection) Console.WriteLine(&amp;quot;\tEndpoint: {0}, Port: {1}&amp;quot;, endpoint.Address.ToString(), endpoint.Port);  Console.WriteLine(); } }}catch (PeerToPeerException ex){ //Other standard execptions can also be caught Console.WriteLine(&amp;quot;PeerToPeer Excpetion: {0)&amp;quot;, ex.Message);} 

One of the interesting things about resolving a Peer Name is that the resulting PeerNameRecords include the endpoint information for each of the Peer Names found.&amp;nbsp; This means you can establish direct connections with those peers if necessary.&amp;nbsp; I will show
 how to do just that in an upcoming screencast.&amp;nbsp; Of course, that assumes we don’t have any firewalls or other types of security blockades preventing direct communication. 
The example in this installment is done synchronously.&amp;nbsp; In the next screencast, I will show you how you can do the same operation asynchronously.&amp;nbsp; This is useful because the Resolve method can take quite a while to return so your program’s execution is blocked
 while waiting for the method to complete.&amp;nbsp; This is especially bad in the case of GUI applications since the app will become non-responsive while waiting for Resolve to finish. 
Other documentation for PNRP: 

System.Net.PeerToPeer Namespace
P2P Registration Article
Peer Name Resolution Protocol</itunes:summary>
      <itunes:duration>462</itunes:duration>
      <link>http://channel9.msdn.com/Blogs/SlickThought/Peer-to-Peer-Series-Part-3-Resolving-Names-Synchronously-with-the-PNRP-API</link>
      <pubDate>Fri, 18 Sep 2009 01:41:00 GMT</pubDate>
      <guid isPermaLink="false">http://channel9.msdn.com/Blogs/SlickThought/Peer-to-Peer-Series-Part-3-Resolving-Names-Synchronously-with-the-PNRP-API</guid>
      <media:thumbnail url="http://ecn.channel9.msdn.com/o9/previewImages/100/492476_100x75.jpg" height="75" width="100"></media:thumbnail>
      <media:thumbnail url="http://ecn.channel9.msdn.com/o9/previewImages/220/492476_220x165.jpg" height="165" width="220"></media:thumbnail>
      <media:thumbnail url="http://ecn.channel9.msdn.com/o9/ch9/6/7/4/2/9/4/PeerPart3_320_ch9.png" height="240" width="320"></media:thumbnail>
      <media:thumbnail url="http://ecn.channel9.msdn.com/o9/ch9/6/7/4/2/9/4/PeerPart3_512_ch9.png" height="384" width="512"></media:thumbnail>
      <media:thumbnail url="http://ecn.channel9.msdn.com/o9/ch9/6/7/4/2/9/4/PeerPart3_85_ch9.png" height="64" width="85"></media:thumbnail>
      <media:group>
        <media:content url="http://ecn.channel9.msdn.com/o9/ch9/6/7/4/2/9/4/PeerPart3_2MB_ch9.wmv" expression="full" duration="462" fileSize="28416223" type="video/x-ms-wmv" medium="video"></media:content>
        <media:content url="http://ecn.channel9.msdn.com/o9/ch9/6/7/4/2/9/4/PeerPart3_ch9.mp3" expression="full" duration="462" fileSize="3704359" type="audio/mp3" medium="audio"></media:content>
        <media:content url="http://ecn.channel9.msdn.com/o9/ch9/6/7/4/2/9/4/PeerPart3_ch9.mp4" expression="full" duration="462" fileSize="18014712" type="video/mp4" medium="video"></media:content>
        <media:content url="http://ecn.channel9.msdn.com/o9/ch9/6/7/4/2/9/4/PeerPart3_ch9.wma" expression="full" duration="462" fileSize="3750959" type="audio/x-ms-wma" medium="audio"></media:content>
        <media:content url="http://ecn.channel9.msdn.com/o9/ch9/6/7/4/2/9/4/PeerPart3_ch9.wmv" expression="full" duration="462" fileSize="24156047" type="video/x-ms-wmv" medium="video"></media:content>
        <media:content url="http://ecn.channel9.msdn.com/o9/ch9/6/7/4/2/9/4/PeerPart3_Zune_ch9.wmv" expression="full" duration="462" fileSize="17995975" type="video/x-ms-wmv" medium="video"></media:content>
      </media:group>      
      <enclosure url="http://ecn.channel9.msdn.com/o9/ch9/6/7/4/2/9/4/PeerPart3_ch9.wmv" length="24156047" type="video/x-ms-wmv"></enclosure>
      <dc:creator>Jeff Brand</dc:creator>
      <itunes:author>Jeff Brand</itunes:author>
      <slash:comments>0</slash:comments>
      <wfw:commentRss>http://channel9.msdn.com/Blogs/SlickThought/Peer-to-Peer-Series-Part-3-Resolving-Names-Synchronously-with-the-PNRP-API/RSS</wfw:commentRss>
      <category>C#</category>
      <category>Peer to Peer</category>
      <category>Peer</category>
      <category>PNRP</category>
    </item>
  <item>
      <title>Peer to Peer Series Part 2: Registering Names with PNRP API</title>
      <description><![CDATA[ <p>In Part Two of the Peer to Peer Screencast series by SlickThought Productions, we look at using C# and the PNRP API to register a peer name.&nbsp; This example uses a simple Command Prompt application to register the Peer Name, but the same techniques can be used to register a Peer Name from a WinForm or WPF application.&nbsp; It could even be used inside a Windows Service which opens up some interesting scenarios as well.</p><p>Using the API is very simple.&nbsp; Here is the main code section from the demo:</p><div id="codeSnippetWrapper"><div id="codeSnippet"><pre>PeerName peerName = new PeerName(classifier, PeerNameType.Secured);</pre><pre>&nbsp;</pre><pre>using (PeerNameRegistration registration = new PeerNameRegistration(peerName, 8080))</pre><pre>{</pre><pre> try</pre><pre> {</pre><pre> registration.Start();</pre><pre> // Do stuff</pre><pre> registration.Stop();</pre><pre>&nbsp;</pre><pre> }</pre><pre> catch (PeerToPeerException ex)</pre><pre> {</pre><pre> // There are other possible statndard exceptions to catch </pre><pre> // See documentation on for details</pre><pre> }</pre></div></div><p>&nbsp;</p><p>Pretty straightforward.&nbsp; One of the interesting things you can do with a Peer Name is add a Comment and Data to the registration.&nbsp; Doing so is straightforward:</p><div id="codeSnippetWrapper"><pre id="codeSnippet">registration.Comment = &quot;My Comment&quot;;<br><br>UnicodeEncoding encoder = new UnicodeEncoding();<br>byte[] data = encoder.GetBytes(&quot;Some Data&quot;);<br>registration.Data = data;</pre></div><p>In the snippet above, I am adding a simple string to the Comment property.&nbsp; For the Data property, I am converting a simple string to an array of bytes and passing that to the property.&nbsp; In the case of the Data property, you can pass in any byte array you want, so instead of a string I could have passed in an image, a data blob, whatever.&nbsp; In the case of the Comment property, you are limited to 39 Unicode characters, and the Data property is limited to 4,096 bytes.</p><p>The important thing to remember when working with PNRP and registering a Peer Name is that the process that called the Start method must remain open.&nbsp; As soon as that process shuts down, the Peer Name registration is lost.</p><p>Other documentation for PNRP:</p><ul><li><a href="http://msdn.microsoft.com/en-us/library/system.net.peertopeer.aspx" shape="rect">System.Net.PeerToPeer Namespace</a></li><li><a href="http://www.leastprivilege.com/P2PAndWCFRegisteringAService.aspx" shape="rect">P2P Registration Article</a></li><li><a href="http://technet.microsoft.com/en-us/library/bb726971.aspx" shape="rect">Peer Name Resolution Protocol</a></li></ul><p><br><a href="http://slickthought.net/tracker.aspx?file=download\peertopeer.zip" shape="rect">Download the Demo Code</a></p> <img src="http://m.webtrends.com/dcs1wotjh10000w0irc493s0e_6x1g/njs.gif?dcssip=channel9.msdn.com&dcsuri=http://channel9.msdn.com/Blogs/SlickThought/feed&WT.dl=0&WT.entryid=Entry:RSSView:2e11149d919c484cb1199deb002da25e">]]></description>
      <comments>http://channel9.msdn.com/Blogs/SlickThought/Peer-to-Peer-Series-Part-2-Registering-Names-with-PNRP-API</comments>
      <itunes:summary> In Part Two of the Peer to Peer Screencast series by SlickThought Productions, we look at using C# and the PNRP API to register a peer name.&amp;nbsp; This example uses a simple Command Prompt application to register the Peer Name, but the same techniques can be used to register a Peer Name from a WinForm or WPF application.&amp;nbsp; It could even be used inside a Windows Service which opens up some interesting scenarios as well. Using the API is very simple.&amp;nbsp; Here is the main code section from the demo: PeerName peerName = new PeerName(classifier, PeerNameType.Secured);&amp;nbsp;using (PeerNameRegistration registration = new PeerNameRegistration(peerName, 8080)){ try { registration.Start(); // Do stuff registration.Stop();&amp;nbsp; } catch (PeerToPeerException ex) { // There are other possible statndard exceptions to catch  // See documentation on for details }&amp;nbsp; Pretty straightforward.&amp;nbsp; One of the interesting things you can do with a Peer Name is add a Comment and Data to the registration.&amp;nbsp; Doing so is straightforward: registration.Comment = &amp;quot;My Comment&amp;quot;;UnicodeEncoding encoder = new UnicodeEncoding();byte[] data = encoder.GetBytes(&amp;quot;Some Data&amp;quot;);registration.Data = data;In the snippet above, I am adding a simple string to the Comment property.&amp;nbsp; For the Data property, I am converting a simple string to an array of bytes and passing that to the property.&amp;nbsp; In the case of the Data property, you can pass in any byte array you want, so instead of a string I could have passed in an image, a data blob, whatever.&amp;nbsp; In the case of the Comment property, you are limited to 39 Unicode characters, and the Data property is limited to 4,096 bytes. The important thing to remember when working with PNRP and registering a Peer Name is that the process that called the Start method must remain open.&amp;nbsp; As soon as that process shuts down, the Peer Name registration is lost. Other documentation for PNRP: System.Net.PeerToPeer NamespaceP2P Regist</itunes:summary>
      <itunes:duration>532</itunes:duration>
      <link>http://channel9.msdn.com/Blogs/SlickThought/Peer-to-Peer-Series-Part-2-Registering-Names-with-PNRP-API</link>
      <pubDate>Thu, 17 Sep 2009 23:55:00 GMT</pubDate>
      <guid isPermaLink="false">http://channel9.msdn.com/Blogs/SlickThought/Peer-to-Peer-Series-Part-2-Registering-Names-with-PNRP-API</guid>
      <media:thumbnail url="http://ecn.channel9.msdn.com/o9/ch9/5/7/4/2/9/4/PeerPart2_512_ch9.png" height="384" width="512"></media:thumbnail>
      <media:group>
        <media:content url="http://ecn.channel9.msdn.com/o9/ch9/5/7/4/2/9/4/PeerPart2_ch9.mp3" expression="full" duration="532" fileSize="4261675" type="audio/mp3" medium="audio"></media:content>
        <media:content url="http://ecn.channel9.msdn.com/o9/ch9/5/7/4/2/9/4/PeerPart2_ch9.mp4" expression="full" duration="532" fileSize="20379457" type="video/mp4" medium="video"></media:content>
        <media:content url="http://ecn.channel9.msdn.com/o9/ch9/5/7/4/2/9/4/PeerPart2_ch9.wma" expression="full" duration="532" fileSize="4312713" type="audio/x-ms-wma" medium="audio"></media:content>
        <media:content url="http://ecn.channel9.msdn.com/o9/ch9/5/7/4/2/9/4/PeerPart2_ch9.wmv" expression="full" duration="532" fileSize="25709033" type="video/x-ms-wmv" medium="video"></media:content>
      </media:group>      
      <enclosure url="http://ecn.channel9.msdn.com/o9/ch9/5/7/4/2/9/4/PeerPart2_ch9.wmv" length="25709033" type="video/x-ms-wmv"></enclosure>
      <dc:creator>Jeff Brand</dc:creator>
      <itunes:author>Jeff Brand</itunes:author>
      <slash:comments>0</slash:comments>
      <wfw:commentRss>http://channel9.msdn.com/Blogs/SlickThought/Peer-to-Peer-Series-Part-2-Registering-Names-with-PNRP-API/RSS</wfw:commentRss>
      <category>C#</category>
      <category>Peer to Peer</category>
      <category>Peer</category>
      <category>PNRP</category>
    </item>
  <item>
      <title>Peer to Peer Series Part 1: Intro to PNRP</title>
      <description><![CDATA[This kick-off screencast introduces you to the foundation of Peer-to-Peer applications, PNRP.&nbsp; Peer Name Resolution Protocol is the the underlying mechanism used by applications to discover peers on a network.&nbsp; This can either be a local subnet or the
 Internet at large.&nbsp; One of the great things about PRNP is that is even works across NAT devices.
<p>In this screencast, I introduce you some fundamental PNRP concepts and show how you can use the command line to test out the basics.&nbsp; This screencast is not intended to be a deep dive technical exploration.&nbsp; Rather, it lays a sufficient foundation for you
 to understand what is going on in future screencasts and lets you get started building P2P applications as soon as possible.</p>
<p>If you are interested in more technical information on PRNP, check out the following links:</p>
<ul>
<li><a shape="rect" href="http://blogs.msdn.com/p2p/default.aspx" shape="rect">Peer-to-Peer Team Blog</a>
</li><li><a shape="rect" href="http://technet.microsoft.com/en-us/library/bb726971.aspx" shape="rect">Peer Name Resolution Protocol Technical Overview</a>
</li><li><a shape="rect" href="http://technet.microsoft.com/en-us/network/bb545868.aspx" shape="rect">TechNet Windows Peer Networking Home Page</a>
</li><li><a shape="rect" href="http://technet.microsoft.com/en-us/library/bb457079.aspx" shape="rect">Introduction to Windows Peer-To-Peer Networking</a>
</li><li><a shape="rect" href="http://technet.microsoft.com/en-us/library/bb457011.aspx" shape="rect">Teredo Overview</a>
</li><li><a shape="rect" href="http://support.microsoft.com/kb/968510" shape="rect">Firewall Requirements for Coexisting with Teredo</a>
</li><li><a shape="rect" href="http://technet.microsoft.com/en-us/library/cc772249(WS.10).aspx" shape="rect">Netsh Commands for P2P Networking</a>
</li><li><a shape="rect" href="http://social.msdn.microsoft.com/forums/en-US/peertopeer/threads/" shape="rect">Peer-to-Peer Networking Forum</a>
</li></ul>
 <img src="http://m.webtrends.com/dcs1wotjh10000w0irc493s0e_6x1g/njs.gif?dcssip=channel9.msdn.com&dcsuri=http://channel9.msdn.com/Blogs/SlickThought/feed&WT.dl=0&WT.entryid=Entry:RSSView:17b05305a39d4be897b79deb002da6f3">]]></description>
      <comments>http://channel9.msdn.com/Blogs/SlickThought/Peer-to-Peer-Series-Part-1-Intro-to-PNRP</comments>
      <itunes:summary>This kick-off screencast introduces you to the foundation of Peer-to-Peer applications, PNRP.&amp;nbsp; Peer Name Resolution Protocol is the the underlying mechanism used by applications to discover peers on a network.&amp;nbsp; This can either be a local subnet or the
 Internet at large.&amp;nbsp; One of the great things about PRNP is that is even works across NAT devices.
In this screencast, I introduce you some fundamental PNRP concepts and show how you can use the command line to test out the basics.&amp;nbsp; This screencast is not intended to be a deep dive technical exploration.&amp;nbsp; Rather, it lays a sufficient foundation for you
 to understand what is going on in future screencasts and lets you get started building P2P applications as soon as possible. 
If you are interested in more technical information on PRNP, check out the following links: 

Peer-to-Peer Team Blog
Peer Name Resolution Protocol Technical Overview
TechNet Windows Peer Networking Home Page
Introduction to Windows Peer-To-Peer Networking
Teredo Overview
Firewall Requirements for Coexisting with Teredo
Netsh Commands for P2P Networking
Peer-to-Peer Networking Forum

</itunes:summary>
      <itunes:duration>1032</itunes:duration>
      <link>http://channel9.msdn.com/Blogs/SlickThought/Peer-to-Peer-Series-Part-1-Intro-to-PNRP</link>
      <pubDate>Thu, 17 Sep 2009 23:22:00 GMT</pubDate>
      <guid isPermaLink="false">http://channel9.msdn.com/Blogs/SlickThought/Peer-to-Peer-Series-Part-1-Intro-to-PNRP</guid>
      <media:thumbnail url="http://ecn.channel9.msdn.com/o9/previewImages/100/492468_100x75.jpg" height="75" width="100"></media:thumbnail>
      <media:thumbnail url="http://ecn.channel9.msdn.com/o9/previewImages/220/492468_220x165.jpg" height="165" width="220"></media:thumbnail>
      <media:thumbnail url="http://ecn.channel9.msdn.com/o9/ch9/8/6/4/2/9/4/PeerPart1_320_ch9.png" height="240" width="320"></media:thumbnail>
      <media:thumbnail url="http://ecn.channel9.msdn.com/o9/ch9/8/6/4/2/9/4/PeerPart1_512_ch9.png" height="384" width="512"></media:thumbnail>
      <media:thumbnail url="http://ecn.channel9.msdn.com/o9/ch9/8/6/4/2/9/4/PeerPart1_85_ch9.png" height="64" width="85"></media:thumbnail>
      <media:group>
        <media:content url="http://ecn.channel9.msdn.com/o9/ch9/8/6/4/2/9/4/PeerPart1_2MB_ch9.wmv" expression="full" duration="1032" fileSize="1" type="video/x-ms-wmv" medium="video"></media:content>
        <media:content url="http://ecn.channel9.msdn.com/o9/ch9/8/6/4/2/9/4/PeerPart1_ch9.mp3" expression="full" duration="1032" fileSize="1" type="audio/mp3" medium="audio"></media:content>
        <media:content url="http://ecn.channel9.msdn.com/o9/ch9/8/6/4/2/9/4/PeerPart1_ch9.mp4" expression="full" duration="1032" fileSize="1" type="video/mp4" medium="video"></media:content>
        <media:content url="http://ecn.channel9.msdn.com/o9/ch9/8/6/4/2/9/4/PeerPart1_ch9.wma" expression="full" duration="1032" fileSize="1" type="audio/x-ms-wma" medium="audio"></media:content>
        <media:content url="http://ecn.channel9.msdn.com/o9/ch9/8/6/4/2/9/4/PeerPart1_ch9.wmv" expression="full" duration="1032" fileSize="1" type="video/x-ms-wmv" medium="video"></media:content>
        <media:content url="http://ecn.channel9.msdn.com/o9/ch9/8/6/4/2/9/4/PeerPart1_Zune_ch9.wmv" expression="full" duration="1032" fileSize="1" type="video/x-ms-wmv" medium="video"></media:content>
      </media:group>      
      <enclosure url="http://ecn.channel9.msdn.com/o9/ch9/8/6/4/2/9/4/PeerPart1_ch9.wmv" length="0" type="video/x-ms-wmv"></enclosure>
      <dc:creator>Jeff Brand</dc:creator>
      <itunes:author>Jeff Brand</itunes:author>
      <slash:comments>4</slash:comments>
      <wfw:commentRss>http://channel9.msdn.com/Blogs/SlickThought/Peer-to-Peer-Series-Part-1-Intro-to-PNRP/RSS</wfw:commentRss>
      <category>C#</category>
      <category>Peer to Peer</category>
      <category>Peer</category>
      <category>PNRP</category>
    </item>    
</channel>
</rss>