<?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>Silverlight For Windows Embedded Team Blog</title>
    <atom:link
      href="https://docs.microsoft.com/archive/blogs/silverlightforwindowsembedded/feed.xml"
      rel="self"
      type="application/rss+xml" />
    <link>https://docs.microsoft.com/archive/blogs/silverlightforwindowsembedded/feed.xml</link>
    <description>Blog used to discuss &amp;amp; disseminate knowledge on design guidelines, future releases and development practices for SWE.</description>
    <lastBuildDate>Wed, 17 Apr 2019 04:22:38 GMT</lastBuildDate>
    <language>en-US</language>
    <sy:updatePeriod>hourly</sy:updatePeriod>
    <sy:updateFrequency>1</sy:updateFrequency>
    <item>
      <title>UserControls in Silverlight for Windows Embedded (Part-1)</title>
      <link>https://docs.microsoft.com/archive/blogs/silverlightforwindowsembedded/usercontrols-in-silverlight-for-windows-embedded-part-1</link>
      <pubDate>Mon, 02 Aug 2010 16:55:59 GMT</pubDate>
      <dc:creator><![CDATA[IndiaTechie]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/silverlightforwindowsembedded/2010/08/02/usercontrols-in-silverlight-for-windows-embedded-part-1/</guid>
      <description><![CDATA[Hello, I am Ajay Suri a developer in Silverlight for Windows Embedded (SWE) team at Microsoft. In...]]></description>
      <content:encoded><![CDATA[<p><font size="3"></font></p>  <p><font size="2">Hello, I am Ajay Suri a developer in Silverlight for Windows Embedded (SWE) team at Microsoft. In this series of articles, I am going to cover the workings of UserControls in SWE.</font></p>  <p><font size="2">This post is Part-1 of the series and in this I will cover the following.</font></p>  <p><font size="2">1) Creating a simple UserControl in Blend and using WEST to generate SWE application.</font></p>  <p><font size="2">2) Understand the WEST generated code</font></p>  <p><font size="2">Creating a simple UserControl and using WEST to generate SWE application</font></p>  <p><font size="2">UserControls in <b><i>Silverlight for Windows Embedded (SWE)</i></b> are similar to the UserControls in the desktop Silverlight.&#160; They are the basic re-usable pieces of xaml. In the SWE development model, first the Silverlight C# application containing the UserControl is created in Expression Blend. Then SWE application is created using WEST. </font></p>  <p><u><font size="2">Step 1 - Create a new SWE application C# project in Expression Blend </font></u></p>  <p><font size="2">In a previous post, Paul Monson explained </font><a href="https://blogs.msdn.com/b/silverlightforwindowsembedded/archive/2010/07/19/first-silverlight-for-windows-embedded-application.aspx"><font size="2">how to create a SWE application using Expression Blend and then importing into Visual Studio</font></a><font size="2">.&#160; Using those steps, I created a simple SWE application using Expression Blend. Let us name the project UserControlSampleCSharp.</font></p>  <p><font size="2">The project will look like the following in Blend Project tab.</font></p>  <p><font size="2"></font></p> <a href="file:///C:\Users\ajays\AppData\Local\Temp\WindowsLiveWriter-352555430\supfiles38EA6005\image5.png"><font size="2"><img style="border-right-width: 0px; margin: 0px 20px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="clip_image001" border="0" alt="clip_image001" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/35/40/metablogapi/5857.clip_image001_0AE2F145.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-01-35-40-metablogapi/5857.clip_5F00_image001_5F00_0AE2F145.png" width="244" height="234" /></font></a>   <p><font size="2">Blend creates several files, let us not get into details of each file, but for now let us concentrate on the MainPage.xaml which is the first XAML that will be shown when the application starts.</font></p>  <p><u><font size="2">Step 2 – Add a new UserControl to the Project.</font></u></p>  <p><font size="2">From the global menu choose Project –&gt; “Add New Item..” which brings up the following screen. UserControl is chosen by default. Leave it as it is, and give the UserControl a name. Let us call it “MyFirstUserControl” and click OK. This will create “MyFirstUserControl.xaml” and “MyFirstUserControl.Xaml.cs” files.</font></p> <a href="file:///C:\Users\ajays\AppData\Local\Temp\WindowsLiveWriter-352555430\supfiles38EA6005\image9.png"><font size="2"><img style="border-right-width: 0px; margin: 0px 20px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="clip_image002" border="0" alt="clip_image002" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/35/40/metablogapi/0576.clip_image002_519C6482.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-01-35-40-metablogapi/0576.clip_5F00_image002_5F00_519C6482.png" width="226" height="244" /></font></a>   <p><font size="2">Now change the background color of the UserControl by open “MyFirstUserControl.xaml” in XAML view and adding modify the XAML to make the Grid Background color Green.</font></p>  <p><font size="2">&lt;Grid x:Name=&quot;LayoutRoot&quot; Background=&quot;Green&quot;/&gt;</font></p>  <p><u><font size="2">Step 3: Add the UserControl to MainPage</font></u></p>  <p><font size="2">Now, Build the project (Project –&gt; Build Project) . One it builds sucessfully, navigate to “MainPage.xaml”. Click on Assets arrow, and then click on Projects to bring up the controls from the project. Select the “MyFirstUserControl”.</font></p> <a href="file:///C:\Users\ajays\AppData\Local\Temp\WindowsLiveWriter-352555430\supfiles38EA6005\image20.png"><font size="2"><img style="border-right-width: 0px; margin: 0px 20px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="clip_image004" border="0" alt="clip_image004" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/35/40/metablogapi/3716.clip_image004_10FA1813.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-01-35-40-metablogapi/3716.clip_5F00_image004_5F00_10FA1813.png" width="244" height="156" /></font></a>   <p><font size="2">In the design view of “MainPage.xaml”, drop the UserControl. You can do it multiple times, based on what your application may need, but for now, let us do it twice just for the demo purpose. </font></p> <a href="file:///C:\Users\ajays\AppData\Local\Temp\WindowsLiveWriter-352555430\supfiles38EA6005\image24.png"><font size="2"><img style="border-right-width: 0px; margin: 0px 20px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="clip_image006" border="0" alt="clip_image006" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/35/40/metablogapi/3617.clip_image006_6C688A8E.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-01-35-40-metablogapi/3617.clip_5F00_image006_5F00_6C688A8E.png" width="244" height="166" /></font></a>   <p><font size="2">That’s it. You have created a UserControl and re-used it twice in another page. This is a very simple demo just to show how to re-use. Build and run the project, you should see the application inside the browser window with two green rectangles.</font></p>  <p><u><font size="2">Step 3: Use WEST to generate the SWE application from the C# project</font></u></p>  <p><font size="2">You can do this by following the steps outlined in the previous post about </font><a href="https://blogs.msdn.com/b/silverlightforwindowsembedded/archive/2010/07/19/first-silverlight-for-windows-embedded-application.aspx"><font size="2">creating your first SWE application</font></a><font size="2">. </font></p>  <p><font size="2">Compile and run the application on the device.</font></p>  <p><font size="2">Understanding the WEST generated code.</font></p>  <p><font size="2">Once WEST generates the code, you will see that there is a header file and C++ file created for each UserControl in the code.&#160; Observe the following generated files.</font></p>  <p><font size="2">- MyFirstUserControl.cpp, MyFirstUserControl.h. You will see that the MyFirstUserControl class is derived from the template class XRCustomUserControlImpl&lt;&gt;.</font></p> <a href="file:///C:\Users\ajays\AppData\Local\Temp\WindowsLiveWriter-352555430\supfiles38EA6005\image28.png"><font size="2"><img style="border-right-width: 0px; margin: 0px 20px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="clip_image008" border="0" alt="clip_image008" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/35/40/metablogapi/8507.clip_image008_44C20E64.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-01-35-40-metablogapi/8507.clip_5F00_image008_5F00_44C20E64.png" width="195" height="244" /></font></a>   <p><font size="2">If you look at the generated code the important pieces of code to notice are:</font></p>  <p><u><font size="2">1. MyFirstUserControl class declaration: </font></u></p>  <p><font size="2">If you look at the C# project generated using Blend, it will have a UserControl with name MainPage. The MainPage class in C# project would be derived from UserControl. If you look at MainPage.xaml.cs, you will find it in the code.</font></p>  <p><font size="2"></font></p>  <div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper">   <div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet">     <pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum1">   1:</span> <span style="color: #0000ff">public</span> <span style="color: #0000ff">partial</span> <span style="color: #0000ff">class</span> MyFirstUserControl : UserControl</pre>
<!--crlf-->

    <pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum2">   2:</span> {</pre>
<!--crlf-->

    <pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum3">   3:</span>      <span style="color: #0000ff">public</span> MyFirstUserControl ()</pre>
<!--crlf-->

    <pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum4">   4:</span>      {</pre>
<!--crlf-->

    <pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum5">   5:</span>          <span style="color: #008000">// Required to initialize variables</span></pre>
<!--crlf-->

    <pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum6">   6:</span>          InitializeComponent();</pre>
<!--crlf-->

    <pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum7">   7:</span>      }</pre>
<!--crlf-->

    <pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum8">   8:</span> }</pre>
<!--crlf--></!--crlf--></!--crlf--></!--crlf--></!--crlf--></!--crlf--></!--crlf--></!--crlf--></!--crlf--></div>
</div>

<p><font size="2">When you create a SWE project using csproj into <b><i>Windows Embedded Silverlight Tools(WEST)</i></b>, you will see a MyFirstUserControl C++ class created and is derived from the XRCustomUserControlImpl&lt;&gt; template class. <u></u></font></p>

<p><font size="2">Notice that the MainPage class declaration is prefixed with </font><a href="https://msdn.microsoft.com/en-us/library/3b6wkewa(VS.80).aspx"><font size="2">__declspec() of a uuid</font></a><font size="2">. We need to do this so that the class pointer can be wrapped using the smart pointer </font><a href="https://msdn.microsoft.com/en-us/library/ee502937.aspx"><font size="2">XRPtr&lt;Interface&gt;</font></a><font size="2">.&#160; </font></p>

<div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper">
  <div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet">
    <pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum1">   1:</span> <span style="color: #008000">// &lt;UserControl x:Class=&quot;UserControlSample.MainPage&quot;&gt;</span></pre>
<!--crlf-->

    <pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum2">   2:</span> <span style="color: #0000ff">class</span> __declspec(uuid(<span style="color: #006080">&quot;{64d102b8-555b-49f7-b43d-dd44166b8f14}&quot;</span>)) </pre>
<!--crlf-->

    <pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum3">   3:</span>    MyFirstUserControl : <span style="color: #0000ff">public</span> XRCustomUserControlImpl&lt; MyFirstUserControl &gt;</pre>
<!--crlf-->

    <pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum4">   4:</span>&#160; </pre>
<!--crlf-->

    <pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum5">   5:</span>     QI_IDENTITY_MAPPING(MyFirstUserControl, XRCustomUserControlImpl)</pre>
<!--crlf-->

    <pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum6">   6:</span>&#160; </pre>
<!--crlf-->

    <pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum7">   7:</span> <span style="color: #0000ff">public</span>:</pre>
<!--crlf-->

    <pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum8">   8:</span>     <span style="color: #0000ff">static</span> HRESULT GetXamlSource(__in XRXamlSource* pXamlSource)</pre>
<!--crlf-->

    <pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum9">   9:</span>     {</pre>
<!--crlf-->

    <pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum10">  10:</span>         HRESULT hr = E_INVALIDARG;</pre>
<!--crlf-->

    <pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum11">  11:</span>         <span style="color: #0000ff">if</span> (pXamlSource)</pre>
<!--crlf-->

    <pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum12">  12:</span>         {</pre>
<!--crlf-->

    <pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum13">  13:</span>             pXamlSource-&gt;SetResource (App::GetHInstance(),IDR_USERCONTROLSAMPLECSHARP_MYFIRSTUSERCONTROL);</pre>
<!--crlf-->

    <pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum14">  14:</span>             hr = S_OK;</pre>
<!--crlf-->

    <pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum15">  15:</span>         }</pre>
<!--crlf-->

    <pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum16">  16:</span>         <span style="color: #0000ff">return</span> hr;</pre>
<!--crlf-->

    <pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum17">  17:</span>     }</pre>
<!--crlf-->

    <pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum18">  18:</span>     <span style="color: #0000ff">static</span> HRESULT Register()</pre>
<!--crlf-->

    <pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum19">  19:</span>     {</pre>
<!--crlf-->

    <pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum20">  20:</span>         <span style="color: #0000ff">return</span> XRCustomUserControlImpl&lt;MyFirstUserControl&gt;::Register (__uuidof(MyFirstUserControl), L<span style="color: #006080">&quot;MyFirstUserControl&quot;</span>, L<span style="color: #006080">&quot;clr-namespace:UserControlSampleCSharp&quot;</span>);</pre>
<!--crlf-->

    <pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum21">  21:</span>     }</pre>
<!--crlf-->

    <pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum22">  22:</span>     ...</pre>
<!--crlf-->

    <pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum23">  23:</span>     ...</pre>
<!--crlf-->

    <pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum24">  24:</span>     ...</pre>
<!--crlf-->

    <pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum25">  25:</span> }</pre>
<!--crlf--></!--crlf--></!--crlf--></!--crlf--></!--crlf--></!--crlf--></!--crlf--></!--crlf--></!--crlf--></!--crlf--></!--crlf--></!--crlf--></!--crlf--></!--crlf--></!--crlf--></!--crlf--></!--crlf--></!--crlf--></!--crlf--></!--crlf--></!--crlf--></!--crlf--></!--crlf--></!--crlf--></!--crlf--></!--crlf--></div>
</div>

<p><font size="2"></font></p>
<u><font size="2">2. Registering the UserControl with the SWE runtime: </font></u>

<p><font size="2">This step is not required in C# because the Silverlight C# runtime can create a type by using the power of reflection in C#. </font></p>

<p><font size="2">But in <b><i>SWE</i></b> the programmer needs to explicitly let the runtime know the existence of the UserControl by registering the control with the runtime. This is done inside the MyFirstUserControl::Register() function.</font></p>

<p><font size="2">In this function, the MyFirstUserControl class is registered with the SWE runtime using the class name, namespace and the UUID of the class.</font></p>

<div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper">
  <div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet">
    <pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum1">   1:</span> <span style="color: #0000ff">static</span> HRESULT Register()</pre>
<!--crlf-->

    <pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum2">   2:</span> {</pre>
<!--crlf-->

    <pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum3">   3:</span>  <span style="color: #0000ff">return</span> XRCustomUserControlImpl&lt;MyFirstUserControl&gt;::Register (__uuidof(MyFirstUserControl), L<span style="color: #006080">&quot;MyFirstUserControl&quot;</span>, L<span style="color: #006080">&quot;clr-namespace:UserControlSampleCSharp&quot;</span>);</pre>
<!--crlf-->

    <pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum4">   4:</span> }</pre>
<!--crlf--></!--crlf--></!--crlf--></!--crlf--></!--crlf--></div>
</div>

<p><u><font size="2">3. Associating the XAML with the code behind:</font></u></p>

<p><font size="2">The XAML file needs to associated with the C++ class. This will be done inside the MyFirstUserControl::GetXamlSource() function.</font></p>

<p><font size="2">When WEST generates the code, it marks the XAML files as resources in the project. In the MyFirstUserControl::GetXamlSource() function, this XAML resource is paired with the MyFirstUserControl UserControl.</font></p>

<p><font size="2"></font></p>

<div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper">
  <div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet">
    <pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum1">   1:</span> <span style="color: #0000ff">static</span> HRESULT GetXamlSource(__in XRXamlSource* pXamlSource)</pre>
<!--crlf-->

    <pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum2">   2:</span> {</pre>
<!--crlf-->

    <pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum3">   3:</span>  HRESULT hr = E_INVALIDARG;</pre>
<!--crlf-->

    <pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum4">   4:</span>  <span style="color: #0000ff">if</span> (pXamlSource)</pre>
<!--crlf-->

    <pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum5">   5:</span>  {</pre>
<!--crlf-->

    <pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum6">   6:</span>      pXamlSource-&gt;SetResource (App::GetHInstance IDR_USERCONTROLSAMPLECSHARP_MYFIRSTUSERCONTROL);</pre>
<!--crlf-->

    <pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum7">   7:</span>      hr = S_OK;</pre>
<!--crlf-->

    <pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum8">   8:</span>  }</pre>
<!--crlf-->

    <pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum9">   9:</span>  <span style="color: #0000ff">return</span> hr;</pre>
<!--crlf-->

    <pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum10">  10:</span> }</pre>
<!--crlf-->

    <pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum11">  11:</span>&#160; </pre>
<!--crlf--></!--crlf--></!--crlf--></!--crlf--></!--crlf--></!--crlf--></!--crlf--></!--crlf--></!--crlf--></!--crlf--></!--crlf--></!--crlf--></div>
</div>

<p><u><font size="2">4. Using an instance of MyFirstUserControl in the MainPage class:</font></u></p>

<p><font size="2">In the sample above, the MainPage xaml contains an instance of MyFirstUserControl. But you will not find any code in the MainPage class that declares an instance of the UserControl. This is defined in the XAML directly. WEST does not create member variables for elements in the XAML that does not have x:Name associated with them. If we had given a name for the MyFirstUserControl inside the MainPage.xaml, WEST would have generated corresponding member variables.</font></p>

<p><font size="2">In the next part of this tutorial, we will see how this can be done and also enhance the MyFirstUserControl to contain </font><a href="https://msdn.microsoft.com/en-us/library/cc221408(VS.95).aspx"><font size="2">Dependency Properties</font></a><font size="2"> and </font><a href="https://msdn.microsoft.com/en-us/library/cc265152(VS.95).aspx"><font size="2">Attached Properties</font></a><font size="2">. </font></p>

<p><font size="2">Stay tuned for Part 2.</font></p>]]></content:encoded>
    </item>
    <item>
      <title>First Silverlight for Windows Embedded Application</title>
      <link>https://docs.microsoft.com/archive/blogs/silverlightforwindowsembedded/first-silverlight-for-windows-embedded-application</link>
      <pubDate>Mon, 19 Jul 2010 21:09:00 GMT</pubDate>
      <dc:creator><![CDATA[Paul Monson]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/silverlightforwindowsembedded/2010/07/19/first-silverlight-for-windows-embedded-application/</guid>
      <description><![CDATA[Hello, my name is Paul Monson and I am one of developers of the Windows Embedded Silverlight Tools...]]></description>
      <content:encoded><![CDATA[<p>Hello, my name is Paul Monson and I am one of developers of the Windows Embedded Silverlight Tools (WEST). </p>  <p>This post will give you a brief introduction to the following features:</p>  <ul>   <li>The Blend 3 template for Silverlight for Windows Embedded (SWE) Applications.</li>    <li>The wizard for creating a Platform Builder subproject that uses SWE.</li>    <li>The event tool.</li>    <li>The project update wizard.</li> </ul>  <p>The Blend template provides a Blend project that restricts the features available in Blend to match the features available in Silverlight for Windows Embedded as closely as possible. Using this template will enable designers and developers to create projects more quickly since the features available in Blend when using this template should just work in SWE.</p>  <p>Once you have designed the UI in a Blend project you can quickly create a SWE Application using the wizards and tools in Visual Studio 2008. The wizard creates a Platform Builder subproject that provides a minimalist C++ application. The wizard also generates wrapper controls for each of the UserControls that are designed in Blend.</p>  <p>The event tool assists in connecting event handlers to Silverlight controls.</p>  <p>The update wizard updates the subproject with new UserControls, named objects, and event handlers that are added to the original Blend project.</p>  <p>David Shoemaker <a href="https://blogs.msdn.com/b/silverlightforwindowsembedded/archive/2010/07/09/first-image.aspx">explained how to install the tools you will need</a>. After build and test your <a href="https://blogs.msdn.com/b/silverlightforwindowsembedded/archive/2010/07/09/first-image.aspx">First Image</a> you are ready to create a Platform Builder subproject application using Blend and WEST. </p>  <p>1. Begin by opening Blend 3, creating a new “Silverlight for Windows Embedded Application” project. We will be creating a Platform Builder subproject later, so make sure the location doesn’t have any spaces in it (this means that you can’t create the project in the default project location in the documents folder.)</p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/35/40/metablogapi/2146.image_1C52D5C2.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-01-35-40-metablogapi/2146.image_5F00_1C52D5C2.png"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/35/40/metablogapi/8400.image_thumb_30A87580.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-01-35-40-metablogapi/8400.image_5F00_thumb_5F00_30A87580.png" width="450" height="365" /></a> </p>  <p>Once the project is created you should see an empty design surface in Blend. Let’s add the text “Hello World” to the design surface by adding a TextBlock and setting the following properties.</p>  <p>2. Set Name to “HelloWorldTextBlock”, Text to “Hello World” and the font size to 24pt.</p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/35/40/metablogapi/7433.image_7D6C3C16.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-01-35-40-metablogapi/7433.image_5F00_7D6C3C16.png"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/35/40/metablogapi/0005.image_thumb_1523737D.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-01-35-40-metablogapi/0005.image_5F00_thumb_5F00_1523737D.png" width="467" height="293" /></a> </p>  <p>3. Hit F5 and verify that you see the words “Hello World when you run the Silverlight App. Launch VS 2008. </p>  <p>Now that you’ve created a “Hello World” Blend application you are ready to use the WEST subproject wizard to create a Silverlight for Windows Embedded Application. This wizard takes the Blend project you just created as input and creates Platform Builder subproject.</p>  <p>4. Open your OS Design in VS 2008.</p>  <p>5. On the Tools menu find “Windows Embedded Silverlight Tools” and click “Create Platform Builder Subproject…” and click “Next”</p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/35/40/metablogapi/1072.image_2CDAAAE3.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-01-35-40-metablogapi/1072.image_5F00_2CDAAAE3.png"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/35/40/metablogapi/4606.image_thumb_64ACEF06.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-01-35-40-metablogapi/4606.image_5F00_thumb_5F00_64ACEF06.png" width="473" height="405" /></a> </p>  <p>6. Project Name</p>  <blockquote>   <p>a. Name=Hello</p> </blockquote>  <blockquote>   <p>b. Choose a location for your subproject.</p> </blockquote>  <blockquote>   <p>c. Click “Next”</p> </blockquote>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/35/40/metablogapi/4621.image_713A9C22.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-01-35-40-metablogapi/4621.image_5F00_713A9C22.png"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/35/40/metablogapi/2555.image_thumb_6223BD48.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-01-35-40-metablogapi/2555.image_5F00_thumb_5F00_6223BD48.png" width="496" height="424" /></a> </p>  <p>7. Project Selection</p>  <blockquote>   <p>a. Browse to and select the Blend project you just created.</p> </blockquote>  <blockquote>   <p>b. Click “Next”</p> </blockquote>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/35/40/metablogapi/1256.image_0ECC7722.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-01-35-40-metablogapi/1256.image_5F00_0ECC7722.png"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/35/40/metablogapi/4718.image_thumb_7FB59847.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-01-35-40-metablogapi/4718.image_5F00_thumb_5F00_7FB59847.png" width="499" height="427" /></a> </p>  <p>8. Check the validation report for errors. If you are following along there shouldn’t be any, but if the Silverlight project you selected uses features that are not supported by Silverlight for Windows Embedded you will see warnings or errors here. When you’re done with the report click Finish.</p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/35/40/metablogapi/2158.image_176CCFAE.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-01-35-40-metablogapi/2158.image_5F00_176CCFAE.png"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/35/40/metablogapi/7532.image_thumb_044BA302.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-01-35-40-metablogapi/7532.image_5F00_thumb_5F00_044BA302.png" width="511" height="437" /></a> </p>  <p>9. Now you should see a Summary Report in Visual Studio that includes a list of the files added and the information from the validation report. </p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/35/40/metablogapi/2555.image_54AD8475.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-01-35-40-metablogapi/2555.image_5F00_54AD8475.png"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/35/40/metablogapi/1581.image_thumb_3A00E85C.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-01-35-40-metablogapi/1581.image_5F00_thumb_5F00_3A00E85C.png" width="513" height="312" /></a> </p>  <p>10. The subproject was created but it isn’t added to your OS Design yet. To add the new subproject to your OS Design, right-click “Subprojects” in the solution explorer, and choose “Add Existing Subproject…” from the context menu.</p>  <p>11. Select the subproject you just created and click OK. The new subproject should now appear as a node in your OS Design. </p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/35/40/metablogapi/7848.image_586B2945.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-01-35-40-metablogapi/7848.image_5F00_586B2945.png"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/35/40/metablogapi/5126.image_thumb_447196AF.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-01-35-40-metablogapi/5126.image_5F00_thumb_5F00_447196AF.png" width="323" height="444" /></a> </p>  <p>12. Open MainPage.xaml</p>  <p>13. Click View -&gt; Other Windows -&gt; Windows Embedded Events to show the event tool.</p>  <p>14. Select “LayoutRoot” in the upper treeview.</p>  <p>15. Double-click the empty text box next to MouseLeftButtonDown in the lower half of the event tool.</p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/35/40/metablogapi/1172.image_509310D6.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-01-35-40-metablogapi/1172.image_5F00_509310D6.png"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/35/40/metablogapi/8358.image_thumb_489B6E74.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-01-35-40-metablogapi/8358.image_5F00_thumb_5F00_489B6E74.png" width="475" height="385" /></a> </p>  <p>16. Copy the following implementation into the stub. This code will exit the application when you click anywhere in the root Grid that isn’t covered by another control.</p>  <div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper">   <div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet">     <pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum1">   1:</span> HRESULT MainPage::LayoutRoot_MouseLeftButtonDown (IXRDependencyObject* pSender, XRMouseButtonEventArgs* pArgs)</pre>
<!--crlf-->

    <pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum2">   2:</span> {</pre>
<!--crlf-->

    <pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum3">   3:</span>     IXRVisualHostPtr pHost;</pre>
<!--crlf-->

    <pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum4">   4:</span>     App::GetVisualHost(&amp;pHost);</pre>
<!--crlf-->

    <pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum5">   5:</span>     <span style="color: #0000ff">if</span>(pHost)</pre>
<!--crlf-->

    <pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum6">   6:</span>     {</pre>
<!--crlf-->

    <pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum7">   7:</span>         pHost-&gt;EndDialog(0);</pre>
<!--crlf-->

    <pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum8">   8:</span>     }</pre>
<!--crlf-->

    <pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum9">   9:</span>     <span style="color: #0000ff">return</span> S_OK;</pre>
<!--crlf-->

    <pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum10">  10:</span> }</pre>
<!--crlf--></!--crlf--></!--crlf--></!--crlf--></!--crlf--></!--crlf--></!--crlf--></!--crlf--></!--crlf--></!--crlf--></!--crlf--></div>
</div>

<p>17. Right-click the subproject node and choose Build.</p>

<p>18. Download your OS image to your device or vCEPC.</p>

<p>19. On the menu choose Platform&gt;Run and select Hello.exe</p>

<p>At this point you should see your “Hello World” screen appear on the device. You have just created a Silverlight for Windows Embedded application. Now let’s add a button and make it do something when you click on it.</p>

<p>20. In Blend 3 add a Button to MainPage.xaml. Set the Name to “Button1” and the Content of the button to “Click Me” and then run the Blend project to verify that it is valid.</p>

<p>21. In VS 2008 open MainPage.cpp and make it the active editor. Any file from the project should work, but in order for the update menu item to work correctly you must have a project file from the project you want to update open in the active editor.</p>

<p>22. On the Tools menu find Windows Embedded Silverlight Tools and click Update Silverlight for Windows Embedded Project…</p>

<p>23. You should see a progress bar briefly, and when it finishes the message “Update Completed” should be displayed in the Output pane.</p>

<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/35/40/metablogapi/3247.image_78E2432A.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-01-35-40-metablogapi/3247.image_5F00_78E2432A.png"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/35/40/metablogapi/1425.image_thumb_6CE052F6.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-01-35-40-metablogapi/1425.image_5F00_thumb_5F00_6CE052F6.png" width="482" height="178" /></a> </p>

<p>24. Open the MainPage.xaml from the subproject resources node.</p>

<p>25. Click View -&gt; Other Windows -&gt; Windows Embedded Events to show the event tool.</p>

<p>26. Select “Button1” in the upper treeview.</p>

<p>27. Double-click in the right-hand side of the Click event row in the lower grid.</p>

<p>28. A Button1_Click event handler stub is inserted and the cursor is positioned in MainPage.cpp at the insertion point.</p>

<p>29. Change the implementation of the stub to:</p>

<div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper">
  <div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet">
    <pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum1">   1:</span> HRESULT MainPage::Button1_Click (IXRDependencyObject* pSender, XRMouseButtonEventArgs* pArgs)</pre>
<!--crlf-->

    <pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum2">   2:</span> {</pre>
<!--crlf-->

    <pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum3">   3:</span>     m_pHelloWorldTextBlock-&gt;SetText(L<span style="color: #006080">&quot;Click&quot;</span>);</pre>
<!--crlf-->

    <pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum4">   4:</span>     <span style="color: #0000ff">return</span> S_OK;</pre>
<!--crlf-->

    <pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum5">   5:</span> }</pre>
<!--crlf--></!--crlf--></!--crlf--></!--crlf--></!--crlf--></!--crlf--></div>
</div>

<p>30. Right-click the subproject and choose Build.</p>

<p>31. If you disconnected from the test device or emulator you will need to reconnect now, and then select Target -&gt; Run -&gt; Hello.exe again.</p>

<p>32. Click the button, you should see the text block change to “Click”</p>

<p>If the new subproject is checked into source control, both the Blend project and the Platform Builder subproject need to be checked in with the same relative path between the projects that they had at the time the new subproject was created.</p>]]></content:encoded>
    </item>
    <item>
      <title>First image</title>
      <link>https://docs.microsoft.com/archive/blogs/silverlightforwindowsembedded/first-image</link>
      <pubDate>Fri, 09 Jul 2010 11:17:56 GMT</pubDate>
      <dc:creator><![CDATA[DavidShoemaker]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/silverlightforwindowsembedded/2010/07/09/first-image/</guid>
      <description><![CDATA[Hello, my name is David Shoemaker and I am one of the developers of Silverlight for Windows...]]></description>
      <content:encoded><![CDATA[<p> Hello, my name is David Shoemaker and I am one of the developers of Silverlight for Windows Embedded (SWE).  In this blog entry I am going to walk you through the basic setup of the Windows Embedded Compact 7 CTP and getting your first SWE enabled image up and running.
</p><p>I assume you have Visual Studio 2008 SP1, some flavor of Virtual PC*, Blend 3 and the CTP installed.  If not, go back to the previous blog entry by David Franklin and install the CTP.
</p><p>*For Windows 7 you can get XP Mode and Virtual PC from <a href="https://www.microsoft.com/windows/virtual-pc/download.aspx">https://www.microsoft.com/windows/virtual-pc/download.aspx</a>
	</p><p>
 </p><p>Open Visual Studio (if this is the first time you have run VS with PB installed there will be some configuration dialogs about default settings).
</p><p>
 </p><ol style="margin-left: 53pt"><li><div style="background: white">File -&gt; New -&gt; Project (I named mine Blog1)
</div></li><li><div style="background: white">Project type = Platform Builder 2008
</div></li><li><div style="background: white">Click the OK button which brings up the CE OS design wizard.
</div></li><li><div style="background: white">[Next]
</div></li><li><div style="background: white">BSP select the Virtual PC : x86 [Next]
</div></li><li><div style="background: white">Design template = PDA Device -&gt; Enterprise Web Pad [Next]
</div></li><li><div style="background: white">Applications / Media (no changes) [Next]
</div></li><li><div style="background: white">Network communications (no changes) [Next]
</div></li><li><div style="background: white">OS Design Project Wizard Complete (Don't select "Build the following configuration after I click Finish") [Finish]
</div></li><li><div style="background: white">Acknowledge any security warnings or license dialogs that come up.
</div></li></ol><p style="background: white">You should now be in VS with the solution open.  We didn't just build at the end of the wizard because we want to add a couple of things to the image before we build.
</p><p style="background: white">Select the Catalog Items View tab (if not visible you can use View -&gt; Other Windows -&gt; Catalog Items View).
</p><p style="background: white">Enter "Silverlight for Windows Embedded" into the search box and click the search button.  This will bring you to the SWE options in the catalog.  Open that and select the SWE checkbox. This brings in the SWE component for later use.
</p><p style="background: white">We are going to bring the xamlperf sample into the image to give us some instant gratification. As this sample is not in the catalog we need to add the sysgen flag manually.
</p><ol><li><div style="background: white">In VS select the solution explorer tab (Or Ctrl+Alt+L), right click on the project name (in my case the Blog1 name) and select properties.
</div></li><li><div style="background: white">Configuration properties -&gt; Environment
</div></li><li><div style="background: white">New…
</div></li><li><div style="background: white">Variable name = <strong>SYSGEN_SAMPLEXAMLPERF</strong>
			</div></li><li><div style="background: white"><strong>Value = 1</strong>
			</div></li><li><div style="background: white"><strong>Apply</strong>
			</div></li><li><div style="background: white"><strong>OK</strong>
			</div></li></ol><p style="background: white">To verify everything is set as expected you can do:
</p><ol><li><div style="background: white">Build -&gt; Open Release Directory in Build Window.
</div></li><li><div style="background: white">Set Sysgen [Enter]
</div></li><li><div style="background: white">Look at the output and verify that sysgen_xaml_runtime=1 &amp; sysgen_samplexamlperf=1 are set.
</div></li></ol><p style="background: white">Now do a build.  Build -&gt; Build Solution (or F7) and wait a while.  Depending on your machine this could take a while.
</p><p style="background: white">At the end of the build you will get output like:
</p><p>BLDDEMO: BUILDMSG:  Directory of C:\WINCE700\OSDesigns\Blog1\Blog1\RelDir\VirtualPC_x86_Release
</p><p>BLDDEMO: BUILDMSG: 07/09/2010  11:52 AM        40,528,451 NK.bin
</p><p>BLDDEMO: BUILDMSG:                1 File(s)     40,528,451 bytes
</p><p>BLDDEMO: BUILDMSG:                0 Dir(s)  293,800,824,832 bytes free
</p><p>BLDDEMO: BUILDMSG: cebase build complete.
</p><p>BLDDEMO: BUILDMSG: BldDemo ended at 11:52:39.73 on Fri 07/09/2010 (exit code 0)
</p><p>BuildLogs: BUILDMSG: Exiting: BldDemo1.bat  (result code 0).
</p><p>BuildLogs: BUILDMSG: C:\WINCE700\build.log
</p><p>BuildLogs: BUILDMSG: C:\WINCE700\build.out
</p><p>BuildLogs: BUILDMSG: C:\WINCE700\build.wrn
</p><p>Blog1 - 0 error(s), 723 warning(s)
</p><p style="background: white">========== Build: 1 succeeded or up-to-date, 0 failed, 0 skipped ==========
</p><p style="background: white">I am using virtual PC (Win Xp mode on Windows 7) so I need to create a virtual machine to be my target device.
</p><ol><li><div style="background: white">Start -&gt; Windows Virtual PC
</div></li><li><div style="background: white">Create virtual machine
</div></li><li><div style="background: white">Name (I used VPC) [Next]
</div></li><li><div style="background: white">Memory and networking [Next]
</div></li><li><div style="background: white">Add a virtual hard disk
</div><ol><li><div style="background: white">Use an existing virtual hard disk (navigate to where in you installed the CTP)
</div></li><li><div style="background: white">C:\wince700\platform\virtualpc\vm\hd0_sample.vhd (this comes with the CTP)
</div></li></ol></li><li><div style="background: white">[Create]
</div></li></ol><p style="background: white">To use this from Platform Builder you need to make a connection in VS
</p><ol><li><div style="background: white">Start the virtual machine
</div></li><li><div style="background: white">In VS, Target -&gt; Connectivity Options…
</div></li><li><div style="background: white">Add Device
</div></li><li><div style="background: white">Name (I used VPC) [Add]
</div></li><li><div style="background: white">Kernel Download -&gt; [Settings] (this may bring up a firewall dialog, if so "Allow Access")
</div></li><li><div style="background: white">This brings up a dialog which should detect the "Bootme's" from the virtual machine.  Select the target device that shows up (mine was named "PC-0003FF10A48F" and [Apply]
</div></li><li><div style="background: white">[Close]
</div></li><li><div style="background: white">This takes you back to the VS main window.  In the Device: Drop down on the toolbar select the connection you just made (VPC in my case). 
</div></li></ol><p style="background: white">We are now ready to download our first image.
</p><ol><li><div style="background: white">You will probably have to restart your VM as the bootme's have run out (only sends a fixed number before giving up).
</div></li><li><div style="background: white">Then on the device toolbar press connect (the play symbol next to the dropdown).
</div></li><li><div style="background: white">The Device Status window should appear and show the image downloading.
</div></li><li><div style="background: white">Once that has finished the output window should show some debug spew about the boot process and then finally the VPC window should appear with your image loaded.
</div></li></ol><p style="background: white"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/35/40/metablogapi/2476.070910_1817_Firstimage1.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-01-35-40-metablogapi/2476.070910_5F00_1817_5F00_Firstimage1.png" alt=""/><span style="font-family:Courier New; font-size:8pt">
		</span></p><p>This has three samples (brought in by the SYSGEN_SAMPLEXAMLPERF sysgen).
</p><p>Double Click Bounce, Bubbles or Carousel to see the samples in action.  Clicking in the running app will close it.
</p><p>We now have an image up and running which allows you to try out SWE applications.  
</p><p>
 </p>]]></content:encoded>
    </item>
    <item>
      <title>Welcome to the Silverlight for Windows Embedded team blog!</title>
      <link>https://docs.microsoft.com/archive/blogs/silverlightforwindowsembedded/welcome-to-the-silverlight-for-windows-embedded-team-blog</link>
      <pubDate>Thu, 24 Jun 2010 15:36:00 GMT</pubDate>
      <dc:creator><![CDATA[David.Franklin]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/silverlightforwindowsembedded/2010/06/24/welcome-to-the-silverlight-for-windows-embedded-team-blog/</guid>
      <description><![CDATA[Welcome to the Silverlight for Windows Embedded team blog.&nbsp; This serves as a place for the...]]></description>
      <content:encoded><![CDATA[<p><v:shapetype coordsize="21600,21600" o:spt="75" o:preferrelative="t" path="m@4@5l@4@11@9@11@9@5xe" filled="f" stroked="f" id="_x0000_t75"><v:stroke joinstyle="miter"></v:stroke><v:formulas><v:f eqn="if lineDrawn pixelLineWidth 0"></v:f><v:f eqn="sum @0 1 0"></v:f><v:f eqn="sum 0 0 @1"></v:f><v:f eqn="prod @2 1 2"></v:f><v:f eqn="prod @3 21600 pixelWidth"></v:f><v:f eqn="prod @3 21600 pixelHeight"></v:f><v:f eqn="sum @0 0 1"></v:f><v:f eqn="prod @6 1 2"></v:f><v:f eqn="prod @7 21600 pixelWidth"></v:f><v:f eqn="sum @8 21600 0"></v:f><v:f eqn="prod @7 21600 pixelHeight"></v:f><v:f eqn="sum @10 21600 0"></v:f></v:formulas><v:path o:extrusionok="f" gradientshapeok="t" o:connecttype="rect"></v:path><o:lock v:ext="edit" aspectratio="t"></o:lock></v:shapetype></p>
<p class="MsoNormal"><span style="font-family: Calibri;"><span style="color: #1f497d; font-size: 12pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: Calibri; mso-ascii-font-family: Calibri; mso-hansi-font-family: Calibri;"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/35/40/5481.windowsce.png" original-url="https://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-01-35-40/5481.windowsce.png" border="0" style="float: right;" />Welcome to the Silverlight for Windows Embedded team blog.&nbsp; This serves as a place for the Silverlight team to share information about the Silverlight for Windows Embedded API set and how it can be used to create compelling UI on Windows Embedded Compact-based devices.&nbsp; This blog will include everything from small UI examples to tips and tricks on how to make the most of Silverlight.&nbsp; We also welcome comments and suggestions from our readers to help make this a valuable UI development resource.</span></span></p>
<p>&nbsp;</p>
<p class="MsoNormal"><span style="font-family: Calibri;"><span style="color: #1f497d; font-size: 12pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: Calibri; mso-ascii-font-family: Calibri; mso-hansi-font-family: Calibri;"></span></span><span style="font-family: Calibri;"><span style="color: #1f497d; font-size: 12pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: Calibri; mso-ascii-font-family: Calibri; mso-hansi-font-family: Calibri;">To kick things off, today I am providing some background on Silverlight for Windows Embedded and some links to help you get started.</span><span style="font-family: 'Times New Roman','serif'; color: black; font-size: 12pt; mso-fareast-font-family: 'Times New Roman';"><o:p></o:p></span></span></p>
<p>&nbsp;</p>
<p class="MsoNormal"><span style="font-family: Calibri;"><span style="color: #1f497d; font-size: 12pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: Calibri; mso-ascii-font-family: Calibri; mso-hansi-font-family: Calibri;">Silverlight for Windows Embedded is a native code (C++) UI framework that enables a new designer/developer paradigm that will dramatically improve the user interfaces on devices and the time and cost needed to deliver a differentiated experience.&nbsp; Leveraging familiar tools like Expression Blend, designers can quickly and easily design rich, compelling UIs for embedded devices on the Windows Embedded CE platform.&nbsp; At the same time, developers implement the code-behind with Visual Studio and Platform Builder.</span></span><span style="font-family: Calibri;"><span style="color: #1f497d; font-size: 12pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: Calibri; mso-ascii-font-family: Calibri; mso-hansi-font-family: Calibri;"><span style="font-family: Calibri;"><span style="color: #1f497d; font-size: 12pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: Calibri; mso-ascii-font-family: Calibri; mso-hansi-font-family: Calibri;"></span></span></span></span></p>
<p>&nbsp;</p>
<p class="MsoNormal"><span style="font-family: Calibri;"><span style="color: #1f497d; font-size: 12pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: Calibri; mso-ascii-font-family: Calibri; mso-hansi-font-family: Calibri;"><span style="font-family: Calibri;"><span style="color: #1f497d; font-size: 12pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: Calibri; mso-ascii-font-family: Calibri; mso-hansi-font-family: Calibri;"></span></span>The key to enabling the designers and developers to work simultaneously is Extensible Application Markup Language (XAML), a markup language for declarative application programming.&nbsp; As with Silverlight on the desktop, the designer creates the visible UI elements in the XAML and the developer creates the separate code-behind files to respond to events, manipulate the elements declared in the XAML, and control the underlying business logic of the application.</span></span></p>
<p>&nbsp;</p>
<p class="MsoNormal"><span style="font-family: Calibri;"><span style="color: #1f497d; font-size: 12pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: Calibri; mso-ascii-font-family: Calibri; mso-hansi-font-family: Calibri;"></span></span><span style="font-family: Calibri;"><span style="color: #1f497d; font-size: 12pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: Calibri; mso-ascii-font-family: Calibri; mso-hansi-font-family: Calibri;">Unlike Silverlight on the desktop PC, which uses managed code (like C# or Visual Basic), Silverlight for Windows Embedded uses native code (C++) and does not run in a security sandbox, meaning that it has access to any API and resource on the device.</span><span style="font-family: 'Times New Roman','serif'; color: black; font-size: 12pt; mso-fareast-font-family: 'Times New Roman';"><o:p></o:p></span></span></p>
<p>&nbsp;</p>
<p class="MsoNormal"><span style="font-family: Calibri;"><span style="color: #1f497d; font-size: 12pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: Calibri; mso-ascii-font-family: Calibri; mso-hansi-font-family: Calibri;">To make setting up the C++ project easier, we provide the Windows Embedded Silverlight Tools (WEST) which allows you to take a Blend 3 project and create a C++ project in Visual Studio with many of the required initialization functions and event handlers automatically stubbed out for you.&nbsp; If you make changes to the Blend project, you can just run WEST again, and have the C++ project updated to reflect those changes.</span><span style="font-family: 'Times New Roman','serif'; color: black; font-size: 12pt; mso-fareast-font-family: 'Times New Roman';"><o:p></o:p></span></span></p>
<p>&nbsp;</p>
<p class="MsoNormal"><span style="font-family: Calibri;"><span style="color: #1f497d; font-size: 12pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: Calibri; mso-ascii-font-family: Calibri; mso-hansi-font-family: Calibri;">Due to the differences between managed and unmanaged code, Silverlight for Windows Embedded uses an entirely different Base Class Library than the Silverlight that runs on your desktop PC, meaning that some functionality from the desktop (like .NET and sockets) will be very different on the device.&nbsp; This also means that desktop Silverlight applications will not run on Windows Embedded CE devices.</span><span style="font-family: 'Times New Roman','serif'; color: black; font-size: 12pt; mso-fareast-font-family: 'Times New Roman';"><o:p></o:p></span></span></p>
<p>&nbsp;</p>
<p class="MsoNormal"><span style="font-family: Calibri;"><span style="color: #1f497d; font-size: 12pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: Calibri; mso-ascii-font-family: Calibri; mso-hansi-font-family: Calibri;">Finally, rather than running in a web browser, Silverlight for Windows Embedded applications are hosted in any Win32 window.&nbsp; To provide an immersive user experience, Silverlight for Windows Embedded shells and applications are typically run in full-screen mode.</span><span style="font-family: 'Times New Roman','serif'; color: black; font-size: 12pt; mso-fareast-font-family: 'Times New Roman';"><o:p></o:p></span></span></p>
<p>&nbsp;</p>
<p class="MsoNormal"><span style="font-family: Calibri;"><span style="color: #1f497d; font-size: 12pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: Calibri; mso-ascii-font-family: Calibri; mso-hansi-font-family: Calibri;">In order to achieve smooth, responsive animations, devices can take advantage of the acceleration commonly enabled by the Graphics Processing Units (GPUs) on their hardware.&nbsp; Silverlight for Windows Embedded supports hardware acceleration using DirectDraw and OpenGL through a process called cached composition.</span></span></p>
<p>&nbsp;</p>
<p class="MsoNormal"><span style="font-family: Calibri;"><span style="color: #1f497d; font-size: 12pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: Calibri; mso-ascii-font-family: Calibri; mso-hansi-font-family: Calibri;"></span></span><span style="font-family: Calibri;"><span style="color: #1f497d; font-size: 12pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: Calibri; mso-ascii-font-family: Calibri; mso-hansi-font-family: Calibri;">Silverlight for Windows Embedded first shipped with Windows Embedded Compact 6.0 R3, but this blog will be covering features shipping with the Windows Embedded Compact 7.0 Public Community Technology Preview (available since June 2, 2010).&nbsp; In order to use Silverlight for Windows Embedded you will need to install the following applications:</span><span style="font-family: 'Times New Roman','serif'; color: black; font-size: 12pt; mso-fareast-font-family: 'Times New Roman';"><o:p></o:p></span></span></p>
<ul>
<li>
<div class="MsoNormal"><span style="font-family: Calibri;"><span style="color: #1f497d; font-size: 12pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: Calibri; mso-ascii-font-family: Calibri; mso-hansi-font-family: Calibri;">Windows Embedded Compact 7.0 CTP (see instructions, below)</span><span style="font-family: 'Arial','sans-serif'; color: black; font-size: 9pt; mso-fareast-font-family: 'Times New Roman';"><o:p></o:p></span></span></div>
</li>
<li>
<div class="MsoNormal"><span style="font-family: Calibri;"><span style="color: #1f497d; font-size: 12pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: Calibri; mso-ascii-font-family: Calibri; mso-hansi-font-family: Calibri;">Microsoft Expression Blend 3</span><span style="font-family: 'Arial','sans-serif'; color: black; font-size: 9pt; mso-fareast-font-family: 'Times New Roman';"><o:p></o:p></span></span></div>
</li>
<li>
<div class="MsoNormal"><span style="font-family: Calibri;"><span style="color: #1f497d; font-size: 12pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: Calibri; mso-ascii-font-family: Calibri; mso-hansi-font-family: Calibri;">Visual Studio 2008</span></span>&nbsp;</div>
</li>
</ul>
<h4 class="MsoNormal"><span style="font-family: Calibri;"><span style="color: #1f497d; font-size: 12pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: Calibri; mso-ascii-font-family: Calibri; mso-hansi-font-family: Calibri;">To Install Windows Embedded Compact 7:</span><span style="font-family: 'Times New Roman','serif'; color: black; font-size: 12pt; mso-fareast-font-family: 'Times New Roman';"><o:p></o:p></span></span></h4>
<ol>
<li>
<div class="MsoNormal"><span style="font-family: Calibri;"><span style="color: #1f497d; font-size: 12pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: Calibri; mso-ascii-font-family: Calibri; mso-hansi-font-family: Calibri;">In Internet Explorer, on the Microsoft Connect site (</span><span style="font-family: 'Arial','sans-serif'; color: #1f497d; font-size: 9pt; mso-fareast-font-family: 'Times New Roman';"><a href="https://go.microsoft.com/fwlink/?LinkId=193528"><span style="font-family: 'Calibri','sans-serif'; color: blue; font-size: 12pt;">https://go.microsoft.com/fwlink/?LinkId=193528</span></a></span><span style="color: #1f497d; font-size: 12pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: Calibri; mso-ascii-font-family: Calibri; mso-hansi-font-family: Calibri;">), go to your My Connect Dashboard and select the Windows Embedded Compact program.&nbsp; You will need to register with Microsoft Connect, if you haven&rsquo;t already done so.&nbsp; Select Windows Embedded Compact 7 version 1347 from the Downloads menu.</span><span style="font-family: 'Arial','sans-serif'; color: black; font-size: 9pt; mso-fareast-font-family: 'Times New Roman';"><o:p></o:p></span></span></div>
</li>
<li>
<div class="MsoNormal"><span style="font-family: Calibri;"><span style="color: #1f497d; font-size: 12pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: Calibri; mso-ascii-font-family: Calibri; mso-hansi-font-family: Calibri;">Download your zipped package file.</span><span style="font-family: 'Arial','sans-serif'; color: black; font-size: 9pt; mso-fareast-font-family: 'Times New Roman';"><o:p></o:p></span></span></div>
</li>
<li>
<div class="MsoNormal"><span style="font-family: Calibri;"><span style="color: #1f497d; font-size: 12pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: Calibri; mso-ascii-font-family: Calibri; mso-hansi-font-family: Calibri;">In Windows Explorer, navigate to the extracted file location, and double-click Windows Embedded Compact 7.exe.&nbsp; Follow the instructions in the installer.</span><span style="font-family: 'Arial','sans-serif'; color: black; font-size: 9pt; mso-fareast-font-family: 'Times New Roman';"><o:p></o:p></span></span></div>
</li>
</ol>
<p class="MsoNormal"><span style="font-family: Calibri;"><span style="color: #1f497d; font-size: 12pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: Calibri; mso-ascii-font-family: Calibri; mso-hansi-font-family: Calibri;">Note:&nbsp;&nbsp; Depending on the options you choose, this release could take up to 90 minutes to install. Additionally, having virus protection enabled may greatly increase your installation time.</span><span style="font-family: 'Times New Roman','serif'; color: black; font-size: 12pt; mso-fareast-font-family: 'Times New Roman';"><o:p></o:p></span></span></p>
<p>&nbsp;</p>
<p class="MsoNormal"><span style="font-family: Calibri;"><span style="color: #1f497d; font-size: 12pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: Calibri; mso-ascii-font-family: Calibri; mso-hansi-font-family: Calibri;">We hope that this blog proves useful to you and that you frequently check back to see the content that we will be adding to it.</span><span style="font-family: 'Times New Roman','serif'; color: black; font-size: 12pt; mso-fareast-font-family: 'Times New Roman';"><o:p></o:p></span></span></p>
<p>&nbsp;</p>
<p class="MsoNormal"><span style="font-family: Calibri;"><span style="color: #1f497d; font-size: 12pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: Calibri; mso-ascii-font-family: Calibri; mso-hansi-font-family: Calibri;">David.</span></span></p>]]></content:encoded>
    </item>
  </channel>
</rss>