<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:atom="https://www.w3.org/2005/Atom" xmlns:sy="https://purl.org/rss/1.0/modules/syndication/" xmlns:dc="https://purl.org/dc/elements/1.1/" xmlns:content="https://purl.org/rss/1.0/modules/content/" xmlns:wfw="https://wellformedweb.org/CommentAPI/" xmlns:slash="https://purl.org/rss/1.0/modules/slash/"
  version="2.0">
  <channel>
    <title>Windows Presentation Foundation User Education</title>
    <atom:link
      href="https://docs.microsoft.com/archive/blogs/wpfsdk/feed.xml"
      rel="self"
      type="application/rss+xml" />
    <link>https://docs.microsoft.com/archive/blogs/wpfsdk/feed.xml</link>
    <description />
    <lastBuildDate>Sat, 04 Apr 2015 05:47:53 GMT</lastBuildDate>
    <language>en-US</language>
    <sy:updatePeriod>hourly</sy:updatePeriod>
    <sy:updateFrequency>1</sy:updateFrequency>
    <item>
      <title>Write Your Own Surface App with WPF!</title>
      <link>https://docs.microsoft.com/archive/blogs/wpfsdk/write-your-own-surface-app-with-wpf</link>
      <pubDate>Tue, 12 Jul 2011 15:15:00 GMT</pubDate>
      <dc:creator><![CDATA[Margaret Parsons [MSFT]]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/wpfsdk/2011/07/12/write-your-own-surface-app-with-wpf/</guid>
      <description><![CDATA[Hey WPF devs - as of today you can get the Microsoft&nbsp;Surface 2.0 SDK and write your own surface...]]></description>
      <content:encoded><![CDATA[<p>Hey WPF devs - as of today you can get the Microsoft&nbsp;Surface 2.0 SDK and write your own surface app.&nbsp; You can even use a Windows 7 touch computer to create and test your app!&nbsp; To start playing and get more info, go to the <a href="https://www.surface.com">www.surface.com</a>!</p>
<p>&nbsp;</p>]]></content:encoded>
    </item>
    <item>
      <title>Inspire Improvements to Windows Phone Documentation</title>
      <link>https://docs.microsoft.com/archive/blogs/wpfsdk/inspire-improvements-to-windows-phone-documentation</link>
      <pubDate>Fri, 03 Dec 2010 11:47:00 GMT</pubDate>
      <dc:creator><![CDATA[snoutholder]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/wpfsdk/2010/12/03/inspire-improvements-to-windows-phone-documentation/</guid>
      <description><![CDATA[We are doing a study to see how we are doing with our documentation.&nbsp; Your input will inform...]]></description>
      <content:encoded><![CDATA[<p><span style="color: #1f497d;">
<p>We are doing a study to see how we are doing with our documentation.&nbsp; Your input will inform and inspire improvements and new features for developers.<br />We&rsquo;re looking for developers who</p>
<ul>
<li>Code at least 20 hours per week</li>
<li>Are employed as software developers</li>
<li>Do not have a degree in user experience or usability</li>
<li>Have NOT worked for Microsoft in the past 5 years (including CSG and v-)</li>
<li>Do not have development experience with the Windows Phone 7</li>
</ul>
<p>To participate, contact <a href="mailto:yannr@microsoft.com">yannr@microsoft.com</a><br />We also encourage interested participants to fill out the survey at <a href="https://illumeweb.smdisp.net/Collector/Survey.ashx?Name=FY2011">https://illumeweb.smdisp.net/Collector/Survey.ashx?Name=FY2011</a></p>
</span></p>]]></content:encoded>
    </item>
    <item>
      <title>A WPF Lab right in Visual Studio!</title>
      <link>https://docs.microsoft.com/archive/blogs/wpfsdk/a-wpf-lab-right-in-visual-studio</link>
      <pubDate>Tue, 09 Nov 2010 16:27:48 GMT</pubDate>
      <dc:creator><![CDATA[Carole Snyder - MSFT]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/wpfsdk/2010/11/09/a-wpf-lab-right-in-visual-studio/</guid>
      <description><![CDATA[I recently learned about Ron Jacob's Hand on Lab for Windows Workflow Foundation 4 and I liked it so...]]></description>
      <content:encoded><![CDATA[<p><span style="font-family: arial,helvetica,sans-serif;"><span style="font-size: small;">I recently learned about </span></span><a href="https://visualstudiogallery.msdn.microsoft.com/en-us/7fe6f504-a58d-456e-8f55-e64bddc81a41"><span style="font-family: arial,helvetica,sans-serif;"><span style="font-size: small;">Ron Jacob's Hand on Lab</span></span></a><span style="font-family: arial,helvetica,sans-serif;"><span style="font-size: small;"> for Windows Workflow Foundation 4 and I liked it so much that I decided to create one for WPF. Check out the </span></span><a href="https://visualstudiogallery.msdn.microsoft.com/en-us/20dfcfd5-d763-4e9a-a8d7-f421e435622c?SRC=Home"><span style="font-family: arial,helvetica,sans-serif;"><span style="font-size: small;">WPF Simple Application Walkthough</span></span></a><span style="font-family: arial,helvetica,sans-serif;"><span style="font-size: small;"> on Visual Studio Gallery!<span style="mso-spacerun: yes;">&nbsp; </span>I adapted an </span></span><a href="https://msdn.microsoft.com/en-us/library/bb546972.aspx"><span style="font-family: arial,helvetica,sans-serif;"><span style="font-size: small;">existing topic on MSDN</span></span></a><span style="font-family: arial,helvetica,sans-serif;"><span style="font-size: small;"> to integrate directly with Visual Studio.<span style="mso-spacerun: yes;">&nbsp; </span>The lab demonstrates creating a WPF application and doing some simple data binding.<span style="mso-spacerun: yes;">&nbsp; </span>Those of you who are familiar with WPF won't learn anything new, but I'm hoping you will check it out anyway, to let us know if you like this method of learning.<span style="mso-spacerun: yes;">&nbsp; </span></span></span></p>
<p><span style="mso-spacerun: yes"></span><span style="font-family: arial,helvetica,sans-serif;"><span style="font-size: small;">A few things to keep in mind: You need Visual Studio Pro, Premium, or Ultimate to install the lab.<span style="mso-spacerun: yes;">&nbsp; </span>The lab is presently in C# only.<span style="mso-spacerun: yes;">&nbsp; </span>No Visual<span style="mso-spacerun: yes;">&nbsp; </span>Basic.<span style="mso-spacerun: yes;">&nbsp; </span>I know that overcoming those limitations are important to many of you and I hope we can do so in the future, but I wanted to get something to the community so we can get your feedback!</span></span></p>]]></content:encoded>
    </item>
    <item>
      <title>MSDN Magazine - A Coder’s Guide to Writing API Documentation</title>
      <link>https://docs.microsoft.com/archive/blogs/wpfsdk/msdn-magazine-a-coders-guide-to-writing-api-documentation</link>
      <pubDate>Fri, 05 Nov 2010 15:19:20 GMT</pubDate>
      <dc:creator><![CDATA[Jim Walker - MSFT]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/wpfsdk/2010/11/05/msdn-magazine-a-coders-guide-to-writing-api-documentation/</guid>
      <description><![CDATA[Peter Gruenbaum has written a great article in the November 2010 issue of MSDN Magazine about the...]]></description>
      <content:encoded><![CDATA[<p>Peter Gruenbaum has written a great article in the November 2010 issue of MSDN Magazine about the why and how of&nbsp;documenting APIs . You can read it online here: <a href="https://msdn.microsoft.com/en-us/magazine/gg309172.aspx">Hello World! A Coder's Guide to Writing API Documentation</a>.</p>]]></content:encoded>
    </item>
    <item>
      <title>My favorite feature of the WPF and Silverlight Tools update</title>
      <link>https://docs.microsoft.com/archive/blogs/wpfsdk/my-favorite-feature-of-the-wpf-and-silverlight-tools-update</link>
      <pubDate>Thu, 26 Aug 2010 13:33:00 GMT</pubDate>
      <dc:creator><![CDATA[Carole Snyder - MSFT]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/wpfsdk/2010/08/26/my-favorite-feature-of-the-wpf-and-silverlight-tools-update/</guid>
      <description><![CDATA[&nbsp;Update:&nbsp; I guess I didn't check the link I originally posted well enough.&nbsp; It's...]]></description>
      <content:encoded><![CDATA[<p>&nbsp;Update:&nbsp; I guess I didn't check the link I originally posted well enough.&nbsp; It's fixed, now.&nbsp; Thanks to <span style="font-family: 'Arial','sans-serif'; font-size: 10pt; mso-fareast-font-family: Calibri; mso-fareast-theme-font: minor-latin; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-bidi-language: AR-SA;">Thomas Freudenberg for providing the correct link.</span></p>
<p style="margin: 0in; font-family: Calibri; font-size: 11pt;">OK, I know this update is several months old, but I was so excited to see this feature that I wanted to share.<span style="mso-spacerun: yes;">&nbsp; </span>If you're like me, you spend a fair amount of time in XAML files.<span style="mso-spacerun: yes;">&nbsp; </span>These files, of course, get long and unwieldy.<span style="mso-spacerun: yes;">&nbsp; </span>I've long appreciated the ability to collapse sections in Visual Studio to make navigating the files quicker,<span style="mso-spacerun: yes;">&nbsp; </span>but I've been less that happy with the amount of information you see when elements are collapsed.<span style="mso-spacerun: yes;">&nbsp; </span>For example, if you collapse the following style elements:</p>
<p style="margin: 0in; font-family: Calibri; font-size: 11pt;">&nbsp;</p>
<p style="margin: 0in;"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/64/10/0363.collapsedxaml1.png" original-url="https://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-64-10/0363.collapsedxaml1.png" border="0" /></p>
<p style="margin: 0in; font-family: Calibri; font-size: 11pt;">&nbsp;</p>
<p style="margin: 0in; font-family: Calibri; font-size: 11pt;">You only see &lt;Style&hellip;/&gt;, which doesn't give you enough information to know what each element really is.</p>
<p style="margin: 0in; font-family: Calibri; font-size: 11pt;">&nbsp;</p>
<p style="margin: 0in;"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/64/10/5040.collapsedxaml2.png" original-url="https://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-64-10/5040.collapsedxaml2.png" border="0" /></p>
<p style="margin: 0in; font-family: Calibri; font-size: 11pt;">&nbsp;</p>
<p style="margin: 0in; font-family: Calibri; font-size: 11pt;">&nbsp;</p>
<p style="margin: 0in; font-family: Calibri; font-size: 11pt;">The <a href="https://www.microsoft.com/downloads/details.aspx?displaylang=en&amp;FamilyID=40ef0f31-cb95-426d-9ce0-00dcfabf3df5">update for WPF and Silverlight tools in Visual Studio 2010</a> changes this feature so that the first line is shown.<span style="mso-spacerun: yes;">&nbsp; </span>This is a great addition because now you have control over what you see when an element is collapsed.</p>
<p style="margin: 0in; font-family: Calibri; font-size: 11pt;">&nbsp;</p>
<p style="margin: 0in;"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/64/10/4405.collapsedxaml3.png" original-url="https://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-64-10/4405.collapsedxaml3.png" border="0" /></p>
<p style="margin: 0in; font-family: Calibri; font-size: 11pt;">&nbsp;</p>
<p style="margin: 0in; font-family: Calibri; font-size: 11pt;">The entire first line is shown, so you can decide how much information is shown.<span style="mso-spacerun: yes;">&nbsp; </span>In the following illustration, I moved the TargetType property of each style to the first line of the element.<span style="mso-spacerun: yes;">&nbsp; </span>Now you see the key and target type for the styles.</p>
<p style="margin: 0in; font-family: Calibri; font-size: 11pt;">&nbsp;</p>
<p style="margin: 0in;"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/64/10/3438.collapsedxaml4.png" original-url="https://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-64-10/3438.collapsedxaml4.png" border="0" /></p>
<p style="margin: 0in; font-family: Calibri; font-size: 11pt;">&nbsp;</p>
<p style="margin: 0in; font-family: Calibri; font-size: 11pt;">Thanks, Visual Studio, for this great addition!</p>]]></content:encoded>
    </item>
    <item>
      <title>Experiments with WindowChrome</title>
      <link>https://docs.microsoft.com/archive/blogs/wpfsdk/experiments-with-windowchrome</link>
      <pubDate>Wed, 25 Aug 2010 11:25:00 GMT</pubDate>
      <dc:creator><![CDATA[Jim Walker - MSFT]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/wpfsdk/2010/08/25/experiments-with-windowchrome/</guid>
      <description><![CDATA[In July, the Microsoft Ribbon for WPF was released. Hopefully you saw the announcements from the WPF...]]></description>
      <content:encoded><![CDATA[<p>In July, the <a target="_blank" href="https://www.microsoft.com/downloads/details.aspx?FamilyID=2BFC3187-74AA-4154-A670-76EF8BC2A0B4">Microsoft Ribbon for WPF</a> was released. Hopefully you saw the announcements from the <a target="_blank" href="https://blogs.msdn.com/b/wpf/archive/2010/08/03/introducing-microsoft-ribbon-for-wpf.aspx">WPF Team</a> and on <a target="_blank" href="https://10rem.net/blog/2010/08/02/announcing-microsoft-ribbon-for-wpf-rtw">Pete Brown&rsquo;s blog</a>, and have already downloaded the Ribbon. A little bonus that you get with the Ribbon is the <a target="_blank" href="https://code.msdn.microsoft.com/WPFShell">WPF Shell Integration Library</a> and <a target="_blank" href="https://msdn.microsoft.com/en-us/library/microsoft.windows.shell.aspx">documentation</a> for it on MSDN. This library includes the <a target="_blank" href="https://msdn.microsoft.com/en-us/library/microsoft.windows.shell.windowchrome.aspx">WindowChrome</a> class, which the RibbonWindow uses to draw things like the QuickAccessToolbar and contextual tab headers in the non-client area of the window. You can use the shell integration features without using the Ribbon, or you can download and use it on its own from <a target="_blank" href="https://code.msdn.microsoft.com/WPFShell">MSDN Code Gallery</a>.</p>
<p>Since the <a target="_blank" href="https://msdn.microsoft.com/en-us/library/microsoft.windows.shell.windowchrome.aspx">WindowChrome</a> documentation only shows an example of creating a standard looking window, I wanted to share some other experiments that look a little more interesting. I built a simple calculator application, and gave it some different looks using WindowChrome. Double-clicking the system button switches to the next style. In these screen shots, only the window style is changing; the calculator control is the same.</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/64/10/metablogapi/6886.4Calc_2.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-64-10-metablogapi/6886.4Calc_5F00_2.png"><img height="387" width="420" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/64/10/metablogapi/1106.4Calc_thumb.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-64-10-metablogapi/1106.4Calc_5F00_thumb.png" alt="4Calc" border="0" title="4Calc" style="background-image: none; border-right-width: 0px; margin: 5px 5px 5px 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" /></a></p>
<p>In this post, I&rsquo;ll quickly walk through creating the last style shown, which is modeled after the Gadgets window in Windows 7.</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/64/10/metablogapi/0844.GadgetWindow_2.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-64-10-metablogapi/0844.GadgetWindow_5F00_2.png"><img height="166" width="277" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/64/10/metablogapi/2570.GadgetWindow_thumb.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-64-10-metablogapi/2570.GadgetWindow_5F00_thumb.png" alt="GadgetWindow" border="0" title="GadgetWindow" style="background-image: none; border-right-width: 0px; margin: 5px 5px 5px 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" /></a></p>
<h3>Using the WindowChrome class</h3>
<p>The first thing to do to use the WindowChrome class is to <a href="https://msdn.microsoft.com/en-us/library/wkze6zky.aspx">add a reference</a> to the Microsoft.Windows.Shell assembly. If you have the WPF Ribbon installed, you&rsquo;ll find it listed under Assemblies &gt; Extensions &gt; Microsoft.Windows.Shell. If you are using the stand-alone library from Code Gallery, you&rsquo;ll need to browse to where you put the .dll file.</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/64/10/metablogapi/0116.AddRef_2.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-64-10-metablogapi/0116.AddRef_5F00_2.png"><img height="357" width="596" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/64/10/metablogapi/5238.AddRef_thumb.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-64-10-metablogapi/5238.AddRef_5F00_thumb.png" alt="AddRef" border="0" title="AddRef" style="background-image: none; border-right-width: 0px; margin: 5px 5px 5px 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" /></a></p>
<p>Next, we&rsquo;ll do some basic set up of the project and application window. </p>
<ul>
<li>Add an Images folder to the project for icons and backgrounds. </li>
<li>Add XML namespace references for the Shell library and the local application. </li>
<li>Set the name, title, size, and icon properties.
<p>(You&rsquo;ll also need to add the icon to the project. Calculator.ico is from the <a href="https://msdn.microsoft.com/en-us/library/ms247035.aspx">Visual Studio Image Library</a> (&gt; Objects &gt;ico_format &gt; WinVista). The other images in this example were created using Paint.NET.)</p>
</li>
</ul>
<p>When you're done, the XAML will look like this:</p>
<pre style="line-height: normal; font-family: "><span style="font-size: small;"><span style="font-family: Consolas;"><span style="color: #0000ff;">&lt;</span><span style="color: #a31515;">Window</span><span style="color: #ff0000;"> x</span><span style="color: #0000ff;">:</span><span style="color: #ff0000;">Class</span><span style="color: #0000ff;">=</span><span style="color: #0000ff;">"WpfChromeCalculator.MainWindow"</span></span><br /><span style="font-family: Consolas;"><span style="color: #000000;">&nbsp; </span><span style="color: #ff0000;">xmlns</span><span style="color: #0000ff;">=</span><span style="color: #0000ff;">"https://schemas.microsoft.com/winfx/2006/xaml/presentation"</span></span><br /><span style="font-family: Consolas;"><span style="color: #000000;">&nbsp;&nbsp;</span><span style="color: #ff0000;">xmlns</span><span style="color: #0000ff;">:</span><span style="color: #ff0000;">x</span><span style="color: #0000ff;">=</span><span style="color: #0000ff;">"https://schemas.microsoft.com/winfx/2006/xaml"</span></span><br /><span style="font-family: Consolas;"><span style="color: #000000;">&nbsp;&nbsp;</span><span style="color: #ff0000;">xmlns</span><span style="color: #0000ff;">:</span><span style="color: #ff0000;">shell</span><span style="color: #0000ff;">=</span><span style="color: #0000ff;">"clr-namespace:Microsoft.Windows.Shell;assembly=Microsoft.Windows.Shell"</span></span><br /><span style="font-family: Consolas;"><span style="color: #000000;">&nbsp;&nbsp;</span><span style="color: #ff0000;">xmlns</span><span style="color: #0000ff;">:</span><span style="color: #ff0000;">local</span><span style="color: #0000ff;">=</span><span style="color: #0000ff;">"clr-namespace:WpfChromeCalculator"</span></span><br /><span style="font-family: Consolas;"><span style="color: #000000;">&nbsp;&nbsp;</span><span style="color: #ff0000;">Title</span><span style="color: #0000ff;">=</span><span style="color: #0000ff;">"Chrome Calculator"</span><span style="color: #ff0000;"> Height</span><span style="color: #0000ff;">=</span><span style="color: #0000ff;">"260"</span><span style="color: #ff0000;"> Width</span><span style="color: #0000ff;">=</span><span style="color: #0000ff;">"300"</span></span><br /><span style="font-family: Consolas;"><span style="color: #000000;">&nbsp;&nbsp;</span><span style="color: #ff0000;">Icon</span><span style="color: #0000ff;">=</span><span style="color: #0000ff;">"Images/calculator.ico"</span><span style="color: #ff0000;"> x</span><span style="color: #0000ff;">:</span><span style="color: #ff0000;">Name</span><span style="color: #0000ff;">=</span><span style="color: #0000ff;">"CalcWindow"</span><span style="color: #0000ff;">&gt;</span></span></span></pre>
<pre style="line-height: normal; font-family: "><span style="FONT-FAMILY: Consolas"></span><span style="font-size: small;"><span style="font-family: Consolas;"><span style="color: #0000ff;">    &lt;</span><span style="color: #a31515;">Grid</span><span style="color: #0000ff;">&gt;</span></span><br /><span style="font-family: Consolas;"><span style="color: #a31515;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span><br /><span style="font-family: Consolas;"><span style="color: #a31515;">&nbsp;&nbsp;&nbsp; </span><span style="color: #0000ff;">&lt;/</span><span style="color: #a31515;">Grid</span><span style="color: #0000ff;">&gt;</span></span><br /><span style="font-family: Consolas;"><span style="color: #0000ff;">&lt;/</span><span style="color: #a31515;">Window</span><span style="color: #0000ff;">&gt;</span></span></span></pre>
<p>Now we can use WindowChrome to add some styles to the application. The WindowChrome documentation gives an overview of how to style the window using WindowChrome, so I won't cover everything in detail here. <a target="_blank" href="https://msdn.microsoft.com/en-us/library/microsoft.windows.shell.windowchrome.aspx">Check out the overview</a>, and then we&rsquo;ll get to customizing a style...</p>
<h3>Styling WindowChrome</h3>
<p>First, we&rsquo;ll add a style to our window resources with a target type of local:MainWindow. We attach the WindowChrome object to the MainWindow using the WindowChrome attached property.</p>
<p>To get the transparent look of the gadget window, we&rsquo;ll set the <a target="_blank" href="https://msdn.microsoft.com/en-us/library/microsoft.windows.shell.windowchrome.glassframethickness.aspx">WindowChrome.GlassFrameThickness</a> property to -1. This makes the glass effect cover the entire window. We&rsquo;ll also set the <a target="_blank" href="https://msdn.microsoft.com/en-us/library/microsoft.windows.shell.windowchrome.resizeborderthickness.aspx">ResizeBorderThickness</a> and <a target="_blank" href="https://msdn.microsoft.com/en-us/library/microsoft.windows.shell.windowchrome.captionheight.aspx">CaptionHeight</a> properties. These areas are not visible, but respond to the mouse to provide window resizing and dragging.</p>
<pre style="line-height: normal; font-family: "><span style="font-size: small;"><span style="font-family: Consolas;"><span style="color: #0000ff;">&lt;</span><span style="color: #a31515;">Window.Resources</span><span style="color: #0000ff;">&gt;</span></span><br /><span style="font-family: Consolas;"><span style="color: #a31515;">&nbsp; </span><span style="color: #0000ff;">&lt;</span><span style="color: #a31515;">Style</span><span style="color: #ff0000;"> x</span><span style="color: #0000ff;">:</span><span style="color: #ff0000;">Key</span><span style="color: #0000ff;">=</span><span style="color: #0000ff;">"GadgetStyle"</span><span style="color: #ff0000;"> TargetType</span><span style="color: #0000ff;">="{</span><span style="color: #a31515;">x</span><span style="color: #0000ff;">:</span><span style="color: #a31515;">Type</span><span style="color: #ff0000;"> local</span><span style="color: #0000ff;">:</span><span style="color: #ff0000;">MainWindow</span><span style="color: #0000ff;">}</span><span style="color: #0000ff;">"</span><span style="color: #0000ff;">&gt;</span></span><br /><span style="font-family: Consolas;"><span style="color: #a31515;">&nbsp;&nbsp;&nbsp; </span><span style="color: #0000ff;">&lt;</span><span style="color: #a31515;">Setter</span><span style="color: #ff0000;"> Property</span><span style="color: #0000ff;">=</span><span style="color: #0000ff;">"shell:WindowChrome.WindowChrome"</span><span style="color: #0000ff;">&gt;</span></span><br /><span style="font-family: Consolas;"><span style="color: #a31515;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="color: #0000ff;">&lt;</span><span style="color: #a31515;">Setter.Value</span><span style="color: #0000ff;">&gt;</span></span><br /><span style="font-family: Consolas;"><span style="color: #a31515;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="color: #0000ff;">&lt;</span><span style="color: #a31515;">shell</span><span style="color: #0000ff;">:</span><span style="color: #a31515;">WindowChrome</span><span style="color: #ff0000;"> GlassFrameThickness</span><span style="color: #0000ff;">=</span><span style="color: #0000ff;">"-1"</span><span style="color: #000000;">&nbsp;</span></span><br /><span style="font-family: Consolas;"><span style="color: #000000;">&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; </span><span style="color: #ff0000;"> ResizeBorderThickness</span><span style="color: #0000ff;">=</span><span style="color: #0000ff;">"4"</span></span><br /><span style="font-family: Consolas;"><span style="color: #000000;">&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; </span><span style="color: #ff0000;"> CaptionHeight</span><span style="color: #0000ff;">=</span><span style="color: #0000ff;">"36"</span><span style="color: #0000ff;">/&gt;</span></span><br /><span style="font-family: Consolas;"><span style="color: #0000ff;">      &lt;/</span><span style="color: #a31515;">Setter.Value</span><span style="color: #0000ff;">&gt;</span></span><br /><span style="font-family: Consolas;"><span style="color: #a31515;"> &nbsp;&nbsp; </span><span style="color: #0000ff;">&lt;/</span><span style="color: #a31515;">Setter</span><span style="color: #0000ff;">&gt; &hellip;</span></span></span></pre>
<p>Next, we&rsquo;ll add a control template that specifies the elements of the application window. The first thing to do here is to provide a ContentPresenter that displays the contents of the window. To make the content fit within the window border, we&rsquo;ll put it inside an invisible Border and set the margins to match the widths of the window border (0 on the sides, 25 on the bottom, and 40 (RisizeBorderThickness + CaptionHeight) on the top).</p>
<p>Finally, we can specify any controls or other content that will appear in the border. This is the main point of using WindowChrome - the ability to put your own interactive WPF content in the window border. For the sake of this demonstration, the content will be a simple button to represent the System button, and a TextBlock to display the window title.</p>
<pre style="line-height: normal; font-family: "><span style="FONT-FAMILY: ; FONT-SIZE: x-small"><span style="font-size: small;"><span style="font-family: Consolas;"><span style="color: #a31515;">&hellip; </span><span style="color: #0000ff;">&lt;</span><span style="color: #a31515;">Setter</span><span style="color: #ff0000;"> Property</span><span style="color: #0000ff;">=</span><span style="color: #0000ff;">"Template"</span><span style="color: #0000ff;">&gt;</span></span><br /><span style="font-family: Consolas;"><span style="color: #a31515;"> &nbsp;&nbsp; </span><span style="color: #0000ff;">&lt;</span><span style="color: #a31515;">Setter.Value</span><span style="color: #0000ff;">&gt;</span></span><br /><span style="font-family: Consolas;"><span style="color: #a31515;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="color: #0000ff;">&lt;</span><span style="color: #a31515;">ControlTemplate</span><span style="color: #ff0000;"> TargetType</span><span style="color: #0000ff;">="{</span><span style="color: #a31515;">x</span><span style="color: #0000ff;">:</span><span style="color: #a31515;">Type</span><span style="color: #ff0000;"> local</span><span style="color: #0000ff;">:</span><span style="color: #ff0000;">MainWindow</span><span style="color: #0000ff;">}</span><span style="color: #0000ff;">"</span><span style="color: #0000ff;">&gt;</span></span><br /><span style="font-family: Consolas;"><span style="color: #a31515;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="color: #0000ff;">&lt;</span><span style="color: #a31515;">Grid</span><span style="color: #0000ff;">&gt;</span></span><br /><span style="font-family: Consolas;"><span style="color: #a31515;">&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="color: #008000;">&lt;!-- This is the ContentPresenter that displays the window content. --&gt;</span></span><br /><span style="font-family: Consolas;"><span style="color: #a31515;">&nbsp;&nbsp;&nbsp;  &nbsp;&nbsp;&nbsp;&nbsp; </span><span style="color: #0000ff;">&lt;</span><span style="color: #a31515;">Border</span><span style="color: #ff0000;"> Margin</span><span style="color: #0000ff;">=</span><span style="color: #0000ff;">"0,40,0,25"</span><span style="color: #0000ff;"> &gt;</span></span><br /><span style="font-family: Consolas;"><span style="color: #a31515;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="color: #0000ff;">&lt;</span><span style="color: #a31515;">ContentPresenter</span><span style="color: #ff0000;"> Content</span><span style="color: #0000ff;">="{</span><span style="color: #a31515;">TemplateBinding</span><span style="color: #ff0000;"> Content</span><span style="color: #0000ff;">}</span><span style="color: #0000ff;">"</span><span style="color: #0000ff;">/&gt;</span></span><br /><span style="font-family: Consolas;"><span style="color: #a31515;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="color: #0000ff;">&lt;/</span><span style="color: #a31515;">Border</span><span style="color: #0000ff;">&gt;</span></span><br /><span style="font-family: Consolas;"><span style="color: #008000;">&lt;!--This is the transparent white rectangle that goes behind the window content.--&gt;</span></span><br /><span style="font-family: Consolas;"><span style="color: #a31515;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="color: #0000ff;">&lt;</span><span style="color: #a31515;">Border</span><span style="color: #ff0000;"> Margin</span><span style="color: #0000ff;">=</span><span style="color: #0000ff;">"1,40,1,25"</span><span style="color: #ff0000;"> BorderBrush</span><span style="color: #0000ff;">=</span><span style="color: #0000ff;">"Gray"</span><span style="color: #ff0000;"> BorderThickness</span><span style="color: #0000ff;">=</span><span style="color: #0000ff;">"0,1,0,1"</span><span style="color: #ff0000;"> <br />                  Grid.ZIndex</span><span style="color: #0000ff;">=</span><span style="color: #0000ff;">"-1"</span><span style="color: #0000ff;">&gt;</span></span><br /><span style="font-family: Consolas;"><span style="color: #a31515;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="color: #0000ff;">&lt;</span><span style="color: #a31515;">Rectangle</span><span style="color: #ff0000;"> Fill</span><span style="color: #0000ff;">=</span><span style="color: #0000ff;">"White"</span><span style="color: #ff0000;"> Opacity</span><span style="color: #0000ff;">=</span><span style="color: #0000ff;">"0.5"</span><span style="color: #0000ff;"> /&gt;</span><span style="color: #a31515;">&nbsp;</span></span><br /><span style="font-family: Consolas;"><span style="color: #a31515;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="color: #0000ff;">&lt;/</span><span style="color: #a31515;">Border</span><span style="color: #0000ff;">&gt;</span></span><br /><span style="font-family: Consolas;"><span style="color: #000000;"> </span></span><span style="font-family: Consolas;"><span style="color: #a31515;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="color: #008000;">&lt;!-- Window Border Content --&gt;</span></span><br /><span style="font-family: Consolas;"><span style="color: #a31515;">&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;   </span><span style="color: #008000;">&lt;!-- System Button --&gt;</span></span><br /><span style="font-family: Consolas;"><span style="color: #a31515;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;       </span><span style="color: #0000ff;">&lt;</span><span style="color: #a31515;">Button</span><span style="color: #ff0000;"> VerticalAlignment</span><span style="color: #0000ff;">=</span><span style="color: #0000ff;">"Top"</span><span style="color: #ff0000;"> HorizontalAlignment</span><span style="color: #0000ff;">=</span><span style="color: #0000ff;">"Left"</span><span style="color: #ff0000;"> Padding</span><span style="color: #0000ff;">=</span><span style="color: #0000ff;">"1"</span></span><br /></span><span style="FONT-FAMILY: Consolas"><span style="font-size: small;"><span style="color: #000000;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="color: #ff0000;"> Margin</span><span style="color: #0000ff;">="{</span><span style="color: #a31515;">Binding</span><span style="color: #ff0000;"> RelativeSource</span><span style="color: #0000ff;">={</span><span style="color: #a31515;">RelativeSource</span><span style="color: #ff0000;"> TemplatedParent</span><span style="color: #0000ff;">},</span></span><span style="font-size: small;"><span style="color: #ff0000;">&nbsp;<br />                    Path</span><span style="color: #0000ff;">=(</span><span style="color: #0000ff;">shell</span><span style="color: #0000ff;">:</span><span style="color: #0000ff;">WindowChrome</span><span style="color: #0000ff;">.</span><span style="color: #0000ff;">WindowChrome</span><span style="color: #0000ff;">).</span><span style="color: #0000ff;">ResizeBorderThickness</span><span style="color: #0000ff;">}</span><span style="color: #0000ff;">"</span><span style="color: #000000;">&nbsp;</span></span></span><br /><span style="font-size: small;"><span style="font-family: Consolas;"><span style="color: #000000;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="color: #ff0000;"> shell</span><span style="color: #0000ff;">:</span><span style="color: #ff0000;">WindowChrome.IsHitTestVisibleInChrome</span><span style="color: #0000ff;">=</span><span style="color: #0000ff;">"True"</span></span><br /><span style="font-family: Consolas;"><span style="color: #000000;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="color: #ff0000;"> Command</span><span style="color: #0000ff;">="{</span><span style="color: #a31515;">x</span><span style="color: #0000ff;">:</span><span style="color: #a31515;">Static</span><span style="color: #ff0000;"> shell</span><span style="color: #0000ff;">:</span><span style="color: #ff0000;">SystemCommands</span><span style="color: #0000ff;">.</span><span style="color: #0000ff;">ShowSystemMenuCommand</span><span style="color: #0000ff;">}</span><span style="color: #0000ff;">"</span></span><br /><span style="font-family: Consolas;"><span style="color: #000000;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="color: #ff0000;"> CommandParameter</span><span style="color: #0000ff;">="{</span><span style="color: #a31515;">Binding</span><span style="color: #ff0000;"> ElementName</span><span style="color: #0000ff;">=</span><span style="color: #0000ff;">CalcWindow</span><span style="color: #0000ff;">}</span><span style="color: #0000ff;">"</span><span style="color: #0000ff;">&gt;</span></span><br /><span style="font-family: Consolas;"><span style="color: #a31515;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="color: #0000ff;">&lt;</span><span style="color: #a31515;">Image</span><span style="color: #ff0000;"> Source</span><span style="color: #0000ff;">="{</span><span style="color: #a31515;">Binding</span><span style="color: #ff0000;"> RelativeSource</span><span style="color: #0000ff;">=<br />                                      {</span><span style="color: #a31515;">RelativeSource</span><span style="color: #ff0000;"> TemplatedParent</span><span style="color: #0000ff;">},</span><span style="color: #ff0000;"> Path</span><span style="color: #0000ff;">=</span><span style="color: #0000ff;">Icon</span><span style="color: #0000ff;">}</span><span style="color: #0000ff;">"</span><span style="color: #000000;">&nbsp;</span></span><br /><span style="font-family: Consolas;"><span style="color: #000000;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="color: #ff0000;"> Width</span><span style="color: #0000ff;">=</span><span style="color: #0000ff;">"16"</span><span style="color: #ff0000;"> Height</span><span style="color: #0000ff;">=</span><span style="color: #0000ff;">"16"</span></span><br /><span style="font-family: Consolas;"><span style="color: #000000;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="color: #ff0000;"> shell</span><span style="color: #0000ff;">:</span><span style="color: #ff0000;">WindowChrome.IsHitTestVisibleInChrome</span><span style="color: #0000ff;">=</span><span style="color: #0000ff;">"True"</span><span style="color: #0000ff;">/&gt;</span></span><br /><span style="font-family: Consolas;"><span style="color: #a31515;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff;">&lt;/</span><span style="color: #a31515;">Button</span><span style="color: #0000ff;">&gt;</span></span><br /><span style="font-family: Consolas;"><span style="color: #a31515;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #008000;">&lt;!-- Window Title --&gt;</span></span><br /><span style="font-family: Consolas;"><span style="color: #a31515;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff;">&lt;</span><span style="color: #a31515;">TextBlock</span><span style="color: #ff0000;"> VerticalAlignment</span><span style="color: #0000ff;">=</span><span style="color: #0000ff;">"Bottom"</span><span style="color: #ff0000;"> TextAlignment</span><span style="color: #0000ff;">=</span><span style="color: #0000ff;">"Center"</span><span style="color: #ff0000;"> <br />                       Padding</span><span style="color: #0000ff;">=</span><span style="color: #0000ff;">"0,0,0,8"</span><span style="color: #000000;">&nbsp;</span></span><br /><span style="font-family: Consolas;"><span style="color: #000000;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="color: #ff0000;"> Text</span><span style="color: #0000ff;">="{</span><span style="color: #a31515;">Binding</span><span style="color: #ff0000;"> RelativeSource</span><span style="color: #0000ff;">=<br />                                     {</span><span style="color: #a31515;">RelativeSource</span><span style="color: #ff0000;"> TemplatedParent</span><span style="color: #0000ff;">},</span><span style="color: #ff0000;"> Path</span><span style="color: #0000ff;">=</span><span style="color: #0000ff;">Title</span><span style="color: #0000ff;">}</span><span style="color: #0000ff;">"</span><span style="color: #0000ff;"> /&gt;</span></span><br /><span style="font-family: Consolas;"><span style="color: #a31515;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff;">&lt;/</span><span style="color: #a31515;">Grid</span><span style="color: #0000ff;">&gt;</span></span><br /><span style="font-family: Consolas;"><span style="color: #a31515;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff;">&lt;/</span><span style="color: #a31515;">ControlTemplate</span><span style="color: #0000ff;">&gt;</span></span><br /><span style="font-family: Consolas;"><span style="color: #a31515;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="color: #0000ff;">&lt;/</span><span style="color: #a31515;">Setter.Value</span><span style="color: #0000ff;">&gt;</span></span><br /><span style="font-family: Consolas;"><span style="color: #a31515;">&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff;">&lt;/</span><span style="color: #a31515;">Setter</span><span style="color: #0000ff;">&gt;</span></span><br /></span><span style="FONT-FAMILY: Consolas"><span style="font-size: small;"><span style="color: #a31515;">&nbsp;&nbsp;</span><span style="color: #0000ff;">&lt;/</span><span style="color: #a31515;">Style</span></span><span style="color: #0000ff;"><span style="font-size: small;">&gt;<br /></span></span></span><span style="font-family: Consolas;"><span style="font-size: small;"><span style="color: #0000ff;">&lt;/</span><span style="color: #a31515;">Window.Resources</span><span style="color: #0000ff;">&gt;</span></span></span></span></pre>
<p>There are a few interesting things to note in this XAML. </p>
<ul>
<li>The button margin is bound to the <a target="_blank" href="https://msdn.microsoft.com/en-us/library/microsoft.windows.shell.windowchrome.resizeborderthickness.aspx">ResizeBorderThickness</a> property. This keeps the button from covering the resize border, so you can resize the window from the upper left corner. </li>
<li>The button command is set to <a target="_blank" href="https://msdn.microsoft.com/en-us/library/microsoft.windows.shell.systemcommands.showsystemmenucommand.aspx">SystemCommands.ShowSystemMenuCommand</a>. This shows the system menu when the button is clicked, just like the real system button. Download the project to see the full implementation.&nbsp; </li>
<li>On both the button and the image, we set the <a target="_blank" href="https://msdn.microsoft.com/en-us/library/microsoft.windows.shell.windowchrome.ishittestvisibleinchrome.aspx">IsHitTestVisibleInChrome</a> attached property to true. This allows the button to receive mouse input. By default, elements that are placed in the window border are not interactive. </li>
<li>The image that is in the button is bound to the Window.Icon property, so the replacement &ldquo;system&rdquo; button displays the application icon. Similarly, the TextBlock is bound to the Window.Title property. </li>
</ul>
<h3>Applying the Style to the Window</h3>
<p>Now that the window style is defined, we need to apply it to the window. To do this, we&rsquo;ll handle the Window.Loaded event and set the Window.Style property. Since this style uses Aero glass effects, it won&rsquo;t render correctly on systems that aren&rsquo;t using Aero glass (Windows XP, or Vista/ Window 7 with Aero disabled). Before we apply the style, we&rsquo;ll want to check if glass effects are enabled, and only apply the style if they are. Fortunately, the Microsoft.Windows.Shell namespace also includes the <a target="_blank" href="https://msdn.microsoft.com/en-us/library/microsoft.windows.shell.systemparameters2.aspx">SystemParameters2</a> class, which provides an easy way to access system settings that are useful with WindowChrome. We can simply check the IsGlassEnabled property before setting the style.</p>
<pre style="line-height: normal; font-family: "><span style="font-size: small;"><span style="font-family: Consolas;"><span style="color: #000000;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="color: #0000ff;">public</span><span style="color: #000000;"> MainWindow()</span></span><br /><span style="font-family: Consolas;"><span style="color: #000000;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</span></span><br /><span style="font-family: Consolas;"><span style="color: #000000;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; InitializeComponent();</span></span><br /><span style="font-family: Consolas;"><span style="color: #000000;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Loaded += </span><span style="color: #0000ff;">new</span><span style="color: #000000;">&nbsp;</span><span style="color: #2b91af;">RoutedEventHandler</span><span style="color: #000000;">(MainWindow_Loaded);</span></span><br /><span style="font-family: Consolas;"><span style="color: #000000;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</span></span><br /><span style="font-family: Consolas;"><span style="color: #000000;"> </span></span><br /><span style="font-family: Consolas;"><span style="color: #000000;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="color: #0000ff;">void</span><span style="color: #000000;"> MainWindow_Loaded(</span><span style="color: #0000ff;">object</span><span style="color: #000000;"> sender, </span><span style="color: #2b91af;">RoutedEventArgs</span><span style="color: #000000;"> e)</span></span><br /><span style="font-family: Consolas;"><span style="color: #000000;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</span></span><br /><span style="font-family: Consolas;"><span style="color: #000000;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="color: #2b91af;">Style</span><span style="color: #000000;"> _style = </span><span style="color: #0000ff;">null</span><span style="color: #000000;">;</span></span><br /><span style="font-family: Consolas;"><span style="color: #000000;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="color: #0000ff;">if</span><span style="color: #000000;"> (Microsoft.Windows.Shell.</span><span style="color: #2b91af;">SystemParameters2</span><span style="color: #000000;">.Current.IsGlassEnabled == </span><span style="color: #0000ff;">true</span><span style="color: #000000;">)</span></span><br /><span style="font-family: Consolas;"><span style="color: #000000;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</span></span><br /><span style="font-family: Consolas;"><span style="color: #000000;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; _style = (</span><span style="color: #2b91af;">Style</span><span style="color: #000000;">)Resources[</span><span style="color: #a31515;">"GadgetStyle"</span><span style="color: #000000;">];</span></span><br /><span style="font-family: Consolas;"><span style="color: #000000;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</span></span><br /><span style="font-family: Consolas;"><span style="color: #000000;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="color: #0000ff;">this</span><span style="color: #000000;">.Style = _style;</span></span><br /><span style="font-family: Consolas;"><span style="color: #000000;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</span></span></span></pre>
<p>With just this XAML and code, we&rsquo;ve got a window that resembles the Windows 7 gadget window. Now we just need to add some content.</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/64/10/metablogapi/8484.GadgetWindowEmpty_2.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-64-10-metablogapi/8484.GadgetWindowEmpty_5F00_2.png"><img height="329" width="322" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/64/10/metablogapi/8484.GadgetWindowEmpty_thumb.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-00-64-10-metablogapi/8484.GadgetWindowEmpty_5F00_thumb.png" alt="GadgetWindowEmpty" border="0" title="GadgetWindowEmpty" style="background-image: none; border-right-width: 0px; margin: 5px 5px 5px 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" /></a></p>
<p>You can download the complete sample from <a target="_blank" href="https://code.msdn.microsoft.com/wpfsdkblog/Release/ProjectReleases.aspx?ReleaseId=4878">MSDN Code Gallery</a>.</p>]]></content:encoded>
    </item>
    <item>
      <title>Getting Started with WPF</title>
      <link>https://docs.microsoft.com/archive/blogs/wpfsdk/getting-started-with-wpf</link>
      <pubDate>Tue, 17 Aug 2010 13:29:00 GMT</pubDate>
      <dc:creator><![CDATA[Margaret Parsons [MSFT]]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/wpfsdk/2010/08/17/getting-started-with-wpf/</guid>
      <description><![CDATA[The writers on the WPF Developer Content team own over 30K topics in the MSDN library.&nbsp; But one...]]></description>
      <content:encoded><![CDATA[<p>The writers on the WPF Developer Content team own over 30K topics in the MSDN library.&nbsp; But one of the most&nbsp;viewed topics is Getting Started (WPF).&nbsp; I'm trying to make the topic more helpful, relevant, to the point, etc.&nbsp; I updated the page a few months ago and was hoping I'd get some feedback from customers who either loved it or hated it.&nbsp;So far, I've heard crickets.&nbsp;Basically, I took the old page, which was just a list of links to all the topics down one level in the tree and replaced that with a list of what I thought people might be looking for when they click on a topic called "Getting Started." I was trying not to make it a long topic that you'd have to read though but more of a jumping off point.&nbsp; If you are interested, here is the link to the <a href="https://msdn.microsoft.com/en-us/library/ms742119(VS.90).aspx">3.5 version</a> and the <a href="https://msdn.microsoft.com/en-us/library/ms742119.aspx">4 version</a>. What do you think? Is it more useful? Not? If not, why not?&nbsp; Send me feedback via the feedback on MSDN or just leave a comment here.</p>
<p>Thanks,<br />Margaret</p>]]></content:encoded>
    </item>
    <item>
      <title>Have you started developing for Windows Phone 7 yet?</title>
      <link>https://docs.microsoft.com/archive/blogs/wpfsdk/have-you-started-developing-for-windows-phone-7-yet</link>
      <pubDate>Fri, 30 Jul 2010 10:07:00 GMT</pubDate>
      <dc:creator><![CDATA[Carole Snyder - MSFT]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/wpfsdk/2010/07/30/have-you-started-developing-for-windows-phone-7-yet/</guid>
      <description><![CDATA[&nbsp;If you haven't heard the latest buzz about the Windows Phone 7, you must be living under a...]]></description>
      <content:encoded><![CDATA[<p>&nbsp;If you haven't heard the latest buzz about the Windows Phone 7, you must be living under a rock.<span style="mso-spacerun: yes;">&nbsp; </span>Or at least away from the Internet!<span style="mso-spacerun: yes;">&nbsp; </span>Now you can develop applications for Windows Phone before it even debuts!<span style="mso-spacerun: yes;">&nbsp;&nbsp; </span>The&nbsp;<a href="https://www.microsoft.com/downloads/info.aspx?na=40&amp;p=4&amp;SrcDisplayLang=en&amp;SrcCategoryId=&amp;SrcFamilyId=ca23285f-bab8-47fa-b364-11553e076a9a&amp;u=http%3a%2f%2fgo.microsoft.com%2ffwlink%2f%3fLinkID%3d189554" title="https://www.microsoft.com/downloads/info.aspx?na=40&amp;p=3&amp;SrcDisplayLang=en&amp;SrcCategoryId=&amp;SrcFamilyId=ca23285f-bab8-47fa-b364-11553e076a9a&amp;u=http%3a%2f%2fgo.microsoft.com%2ffwlink%2f%3fLinkID%3d189554">Windows Phone 7 Developer Toolkit</a><span style="mso-spacerun: yes;">&nbsp; </span>is available for download.<span style="mso-spacerun: yes;">&nbsp;&nbsp; </span>Also, be sure to check out the <a href="https://www.microsoft.com/downloads/details.aspx?displaylang=en&amp;FamilyID=ca23285f-bab8-47fa-b364-11553e076a9a">Windows Phone 7 Training Kit for Developers</a>.<span style="mso-spacerun: yes;">&nbsp; </span>This neat little package comes with walkthroughs to help you get started developing for the Windows Phone with Visual Studio 2010 and Expression Blend.<span style="mso-spacerun: yes;">&nbsp; </span>Enjoy!</p>]]></content:encoded>
    </item>
    <item>
      <title>Principles of software development from an alumnus of the WPF team</title>
      <link>https://docs.microsoft.com/archive/blogs/wpfsdk/principles-of-software-development-from-an-alumnus-of-the-wpf-team</link>
      <pubDate>Wed, 28 Jul 2010 16:54:52 GMT</pubDate>
      <dc:creator><![CDATA[Margaret Parsons [MSFT]]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/wpfsdk/2010/07/28/principles-of-software-development-from-an-alumnus-of-the-wpf-team/</guid>
      <description><![CDATA[I got an email the other day from Ivo Manolov who worked for several years as the test lead for WPF...]]></description>
      <content:encoded><![CDATA[<p>I got an email the other day from <a href="https://blogs.msdn.com/b/ivo_manolov/">Ivo Manolov</a> who worked for several years as the test lead for WPF and then for a bit as the PM lead. He's recently moved to a new group, but he summarized what he's learned from his experience leading the WPF team into two blog posts. One on driving projects (<a href="https://blogs.msdn.com/b/ivo_manolov/archive/2010/07/18/10039624.aspx"><span style="color: #000000;">Principles 1: The Essence of Driving &ndash; A Crash Course in Project Management</span></a>) and one on testing (<a href="https://blogs.msdn.com/b/ivo_manolov/archive/2010/07/23/10042059.aspx"><span style="color: #000000;">Principles 2: Principles of Software Testing</span></a>).</p>
<p>Enjoy!</p>
<p>Margaret</p>]]></content:encoded>
    </item>
    <item>
      <title>The new WPF Team Blog - one place to get it all!</title>
      <link>https://docs.microsoft.com/archive/blogs/wpfsdk/the-new-wpf-team-blog-one-place-to-get-it-all</link>
      <pubDate>Wed, 21 Jul 2010 07:22:53 GMT</pubDate>
      <dc:creator><![CDATA[Margaret Parsons [MSFT]]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/wpfsdk/2010/07/21/the-new-wpf-team-blog-one-place-to-get-it-all/</guid>
      <description><![CDATA[The WPF team has put together a new blog where you can go and find out what the people who create...]]></description>
      <content:encoded><![CDATA[<p>The WPF team has put together a new blog where you can go and find out what the people who create WPF are up to. We'll still be here writing the developer content and blogging about that, but if you want to find out what your favorite WPF developer (or tester, PM, architect, etc.) &nbsp;is thinking about, check out the new <a href="https://blogs.msdn.com/b/wpf/">WPF Team Blog</a>.&nbsp; They've even got a WPF Twitter Feed!</p>
<p>Margaret</p>]]></content:encoded>
    </item>
  </channel>
</rss>