<?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>Embedded Musings</title>
    <atom:link
      href="https://docs.microsoft.com/archive/blogs/smaillet/feed.xml"
      rel="self"
      type="application/rss+xml" />
    <link>https://docs.microsoft.com/archive/blogs/smaillet/feed.xml</link>
    <description>Musings, ramblings and thoughts on embedded systems and other random stuff that pops into my head.</description>
    <lastBuildDate>Tue, 16 Apr 2019 05:27:49 GMT</lastBuildDate>
    <language>en-US</language>
    <sy:updatePeriod>hourly</sy:updatePeriod>
    <sy:updateFrequency>1</sy:updateFrequency>
    <item>
      <title>Windows Embedded Device Manager 2011 released!</title>
      <link>https://docs.microsoft.com/archive/blogs/smaillet/windows-embedded-device-manager-2011-released</link>
      <pubDate>Thu, 24 Mar 2011 13:23:35 GMT</pubDate>
      <dc:creator><![CDATA[Steve_Maillet]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/smaillet/2011/03/24/windows-embedded-device-manager-2011-released/</guid>
      <description><![CDATA[https://www.microsoft.com/presspass/presskits/embedded/  At long last the curtain opens on what I’ve...]]></description>
      <content:encoded><![CDATA[<p><a title="https://www.microsoft.com/presspass/presskits/embedded/" href="https://www.microsoft.com/presspass/presskits/embedded/">https://www.microsoft.com/presspass/presskits/embedded/</a></p>  <p>At long last the curtain opens on what I’ve been working on over the last year.</p>]]></content:encoded>
    </item>
    <item>
      <title>.NET Micro Framework : .NET Micro Framework Version 4.0 ships, Open Source, Community Development, and more.</title>
      <link>https://docs.microsoft.com/archive/blogs/smaillet/net-micro-framework-net-micro-framework-version-4-0-ships-open-source-community-development-and-more</link>
      <pubDate>Mon, 16 Nov 2009 09:52:42 GMT</pubDate>
      <dc:creator><![CDATA[Steve_Maillet]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/smaillet/2009/11/16/net-micro-framework-net-micro-framework-version-4-0-ships-open-source-community-development-and-more/</guid>
      <description><![CDATA[Woohoo! V4.0 is out with community code. This is a major step forward for the .NET Micro Framework!...]]></description>
      <content:encoded><![CDATA[<p>Woohoo! V4.0 is out with community code. This is a major step forward for the .NET Micro Framework! I’m hoping to dive into core details in this blog in the future. (I know I’ve been silent here for&#160; a while, more like an eternity in the blogosphere. A lot of things have been going on in my life that have prevented me from blogging as actively as I’d otherwise prefer. )</p>  <p><a href="https://blogs.msdn.com/netmfteam/archive/2009/11/15/net-micro-framework-version-4-0-ships-open-source-community-development-and-more.aspx#9922983">.NET Micro Framework : .NET Micro Framework Version 4.0 ships, Open Source, Community Development, and more.</a></p>]]></content:encoded>
    </item>
    <item>
      <title>.NET Micro Framework : .NET Micro Framework 4.0 Goes to Beta!!!</title>
      <link>https://docs.microsoft.com/archive/blogs/smaillet/net-micro-framework-net-micro-framework-4-0-goes-to-beta</link>
      <pubDate>Tue, 08 Sep 2009 11:07:14 GMT</pubDate>
      <dc:creator><![CDATA[Steve_Maillet]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/smaillet/2009/09/08/net-micro-framework-net-micro-framework-4-0-goes-to-beta/</guid>
      <description><![CDATA[The .NET Micro Framework V4.0 has gone into public beta. Congrats to the team for all the hard work...]]></description>
      <content:encoded><![CDATA[<p>The .NET Micro Framework V4.0 has gone into public beta. Congrats to the team for all the hard work getting this done with reduced resources and an uphill legal battle on the source code release!</p>  <p><a href="https://blogs.msdn.com/netmfteam/archive/2009/09/04/net-micro-framework-4-0-goes-to-beta.aspx">.NET Micro Framework : .NET Micro Framework 4.0 Goes to Beta!!!</a></p>]]></content:encoded>
    </item>
    <item>
      <title>.NET Micro Framework V4.0 Beta</title>
      <link>https://docs.microsoft.com/archive/blogs/smaillet/net-micro-framework-v4-0-beta</link>
      <pubDate>Tue, 01 Sep 2009 06:33:52 GMT</pubDate>
      <dc:creator><![CDATA[Steve_Maillet]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/smaillet/2009/09/01/net-micro-framework-v4-0-beta/</guid>
      <description><![CDATA[The .NET V4.0 Beta is coming to a PC near you. Sign up on Microsoft Connect to get your copy when it...]]></description>
      <content:encoded><![CDATA[<p>The .NET V4.0 Beta is coming to a PC near you. Sign up on <a href="https://connect.microsoft.com/netmf">Microsoft Connect</a> to get your copy when it becomes available!n Lot’s of great new features and SOURCE CODE in this release!</p>]]></content:encoded>
    </item>
    <item>
      <title>Download details: .NET MF Port Kit</title>
      <link>https://docs.microsoft.com/archive/blogs/smaillet/download-details-net-mf-port-kit</link>
      <pubDate>Mon, 13 Jul 2009 13:06:43 GMT</pubDate>
      <dc:creator><![CDATA[Steve_Maillet]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/smaillet/2009/07/13/download-details-net-mf-port-kit/</guid>
      <description><![CDATA[In case you hadn’t noticed or seen it. The .NET Micro Framework Porting Kit V3.0 is now freely...]]></description>
      <content:encoded><![CDATA[<p>In case you hadn’t noticed or seen it. The .NET Micro Framework Porting Kit V3.0 is now freely available on MS downloads. This isn’t a new version, it’s the same one we released in 3Q08. It’s just a free download now. Work is progressing on the next version so stay tuned</p>  <p><a href="https://www.microsoft.com/downloads/details.aspx?displaylang=en&amp;FamilyID=42ce8508-ff00-4ab8-8495-df587d77a8f2">Download details: .NET MF Port Kit</a></p>]]></content:encoded>
    </item>
    <item>
      <title>Strange days are these…</title>
      <link>https://docs.microsoft.com/archive/blogs/smaillet/strange-days-are-these</link>
      <pubDate>Mon, 06 Jul 2009 14:07:57 GMT</pubDate>
      <dc:creator><![CDATA[Steve_Maillet]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/smaillet/2009/07/06/strange-days-are-these/</guid>
      <description><![CDATA[As many readers know (Wait, is there really more than one?) by now my position on the .NET Micro...]]></description>
      <content:encoded><![CDATA[<p>As many readers know (Wait, is there really more than one?) by now my position on the .NET Micro framework team was eliminated. I was given 60 days to find a job within Microsoft before termination and severance kicked in on July 4th. Last week I started to write a farewell as my final post. However, I had one final interview loop to go, so I held off… Apparently somebody liked me in this interview as I got the job! I’ve moved to the Windows Embedded team as a developer. (I can’t say much about it at this point as we’re working on some new stuff and I’m not entirely clear on what’s public info or not but as things go public I’ll be sure to blog about it!) I officially started on Thursday last week so things switched pretty quickly.</p>  <p>While I won’t be abandoning the .NET MF, I’ll shift my blogging to a larger embedded products focus depending on my current whims. I will follow through and finish on the KIOSK emulator and basic demo app code. I’ll also probably spend some time dissecting the <a href="https://fusionwarebsp.codeplex.com/Wiki/View.aspx?title=FusionWare%3a%3aDFX">FusionWare::DFX</a> (Driver Framework for windows CE). Since it is publicly available in source code form I can make a change or two to increase the overall efficiency of the system that was more difficult to do when it was something we tried to protect as “IP”.</p>  <p>-Steve</p>]]></content:encoded>
    </item>
    <item>
      <title>Colin has posted a clarification of rumors</title>
      <link>https://docs.microsoft.com/archive/blogs/smaillet/colin-has-posted-a-clarification-of-rumors</link>
      <pubDate>Thu, 07 May 2009 17:16:46 GMT</pubDate>
      <dc:creator><![CDATA[Steve_Maillet]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/smaillet/2009/05/07/colin-has-posted-a-clarification-of-rumors/</guid>
      <description><![CDATA[Please see Colin’s post for official word on rumors about the demise of .NET Micro Framework. (Hint:...]]></description>
      <content:encoded><![CDATA[<p>Please see Colin’s post for official word on rumors about the demise of .NET Micro Framework. (Hint: he’s <strong><em><u>NOT</u></em></strong> dead Jim!)</p>  <p><a title="https://blogs.msdn.com/netmfteam/archive/2009/05/07/net-mf-moves-to-developer-division.aspx" href="https://blogs.msdn.com/netmfteam/archive/2009/05/07/net-mf-moves-to-developer-division.aspx">https://blogs.msdn.com/netmfteam/archive/2009/05/07/net-mf-moves-to-developer-division.aspx</a></p>]]></content:encoded>
    </item>
    <item>
      <title>Building a WPF Emulator Part V</title>
      <link>https://docs.microsoft.com/archive/blogs/smaillet/building-a-wpf-emulator-part-v</link>
      <pubDate>Mon, 04 May 2009 18:35:56 GMT</pubDate>
      <dc:creator><![CDATA[Steve_Maillet]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/smaillet/2009/05/04/building-a-wpf-emulator-part-v/</guid>
      <description><![CDATA[In our last episode the super hero(ok it was just me) was creating a device emulator for a KIOSK...]]></description>
      <content:encoded><![CDATA[<p>In our last episode the <strike>super hero</strike>(ok it was just me) was creating a device emulator for a KIOSK system based on the .NET Micro Framework. So far we’ve seen the application code from the custom emulator side of things but haven’t looked at any of the XAML yet. So what is this XAML stuff anyway? XAML is an XML language (Xml Application Markup Language) for describing hierarchies of components. In WPF those components are .NET classes. Instead of writing a lot of code to initialize and set up the UI for an application you can declare it in XAML. XAML was designed alongside of the Windows Presentation Framework (WPF) but the two are technically orthogonal. (This was a big surprise to me when I first started digging into WPF, the appendix on XAML in Chris Sells and Ian Griffith’s excellent book <a href="https://oreilly.com/catalog/9780596510374/"><em>Programming WPF</em></a><em>&#160;</em>was a real eye opener on that.)</p>  <p>The application XAML file is one of the first you see for the KIOSK emulator it looks like this:</p>  <div style="font-family: lucida console; background: silver; color: black; font-size: 11pt">   <pre style="margin: 0px"><span style="color: blue">&lt;</span><span style="color: #a31515">Application</span></pre>

  <pre style="margin: 0px">&#160;&#160; <span style="color: red"> xmlns</span><span style="color: blue">=&quot;https://schemas.microsoft.com/winfx/2006/xaml/presentation&quot;</span></pre>

  <pre style="margin: 0px">&#160;&#160; <span style="color: red"> xmlns</span><span style="color: blue">:</span><span style="color: red">x</span><span style="color: blue">=&quot;https://schemas.microsoft.com/winfx/2006/xaml&quot;</span></pre>

  <pre style="margin: 0px">&#160;</pre>

  <pre style="margin: 0px">&#160;&#160; <span style="color: red"> xmlns</span><span style="color: blue">:</span><span style="color: red">app</span><span style="color: blue">=&quot;clr-namespace:KioskEmulator&quot;</span></pre>

  <pre style="margin: 0px">&#160;&#160; <span style="color: red"> <strong>x</strong></span><strong><span style="color: blue">:</span><span style="color: red">Class</span><span style="color: blue">=&quot;KioskEmulator.App&quot;</span></strong></pre>

  <pre style="margin: 0px">&#160;&#160; <span style="color: red"> <strong>StartupUri</strong></span><span style="color: blue"><strong>=&quot;UI\MainWindow.xaml&quot;</strong></span></pre>

  <pre style="margin: 0px"><span style="color: blue">&gt;</span></pre>

  <pre style="margin: 0px"><span style="color: #a31515">&#160;&#160;&#160; </span><span style="color: blue">&lt;</span><span style="color: #a31515">Application.Resources</span><span style="color: blue">&gt;</span></pre>

  <pre style="margin: 0px"><span style="color: #a31515">&#160;&#160;&#160; </span><span style="color: blue">&lt;/</span><span style="color: #a31515">Application.Resources</span><span style="color: blue">&gt;</span></pre>

  <pre style="margin: 0px"><span style="color: blue">&lt;/</span><span style="color: #a31515">Application</span><span style="color: blue">&gt;</span></pre>
</div>

<p>The most important items of note for the application XAML in this sample are the StartupUri attribute that specifies the starting XAML window and the x:Class attribute which specifies the name of a class to generate for this application. Ultimately this XAML description generates a C# class that contains the basic application init. The generated code for that looks like this:</p>

<div style="font-family: lucida console; background: silver; color: black; font-size: 11pt">
  <pre style="margin: 0px">&#160;&#160;&#160; <span style="color: blue">public</span> <span style="color: blue">partial</span> <span style="color: blue">class</span> <span style="color: #2b91af">App</span> : System.Windows.<span style="color: #2b91af">Application</span> {</pre>

  <pre style="margin: 0px">&#160;</pre>

  <pre style="margin: 0px">&#160;&#160;&#160;&#160;&#160;&#160;&#160; <span style="color: gray">///</span><span style="color: green"> </span><span style="color: gray">&lt;summary&gt;</span></pre>

  <pre style="margin: 0px">&#160;&#160;&#160;&#160;&#160;&#160;&#160; <span style="color: gray">///</span><span style="color: green"> InitializeComponent</span></pre>

  <pre style="margin: 0px">&#160;&#160;&#160;&#160;&#160;&#160;&#160; <span style="color: gray">///</span><span style="color: green"> </span><span style="color: gray">&lt;/summary&gt;</span></pre>

  <pre style="margin: 0px">&#160;&#160;&#160;&#160;&#160;&#160;&#160; [System.Diagnostics.<span style="color: #2b91af">DebuggerNonUserCodeAttribute</span>()]</pre>

  <pre style="margin: 0px">&#160;&#160;&#160;&#160;&#160;&#160;&#160; <span style="color: blue">public</span> <span style="color: blue">void</span> InitializeComponent() {</pre>

  <pre style="margin: 0px">&#160;</pre>

  <pre style="margin: 0px"><span style="color: blue">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; #line</span> 5 &quot;..\..\App.xaml&quot;</pre>

  <pre style="margin: 0px">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <span style="color: blue">this</span>.StartupUri = <span style="color: blue">new</span> System.<span style="color: #2b91af">Uri</span>(<span style="color: #a31515">&quot;UI\\EngMainWindow.xaml&quot;</span></pre>

  <pre style="margin: 0px"><span style="color: #a31515">                                            </span>, System.<span style="color: #2b91af">UriKind</span>.Relative);</pre>

  <pre style="margin: 0px">&#160;</pre>

  <pre style="margin: 0px"><span style="color: blue">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; #line</span> default</pre>

  <pre style="margin: 0px"><span style="color: blue">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; #line</span> hidden</pre>

  <pre style="margin: 0px">&#160;&#160;&#160;&#160;&#160;&#160;&#160; }</pre>

  <pre style="margin: 0px">&#160;</pre>

  <pre style="margin: 0px">&#160;&#160;&#160;&#160;&#160;&#160;&#160; <span style="color: gray">///</span><span style="color: green"> </span><span style="color: gray">&lt;summary&gt;</span></pre>

  <pre style="margin: 0px">&#160;&#160;&#160;&#160;&#160;&#160;&#160; <span style="color: gray">///</span><span style="color: green"> Application Entry Point.</span></pre>

  <pre style="margin: 0px">&#160;&#160;&#160;&#160;&#160;&#160;&#160; <span style="color: gray">///</span><span style="color: green"> </span><span style="color: gray">&lt;/summary&gt;</span></pre>

  <pre style="margin: 0px">&#160;&#160;&#160;&#160;&#160;&#160;&#160; [System.<span style="color: #2b91af">STAThreadAttribute</span>()]</pre>

  <pre style="margin: 0px">&#160;&#160;&#160;&#160;&#160;&#160;&#160; [System.Diagnostics.<span style="color: #2b91af">DebuggerNonUserCodeAttribute</span>()]</pre>

  <pre style="margin: 0px">&#160;&#160;&#160;&#160;&#160;&#160;&#160; <span style="color: blue">public</span> <span style="color: blue">static</span> <span style="color: blue">void</span> Main() {</pre>

  <pre style="margin: 0px">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; KioskEmulator.<span style="color: #2b91af">App</span> app = <span style="color: blue">new</span> KioskEmulator.<span style="color: #2b91af">App</span>();</pre>

  <pre style="margin: 0px">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; app.InitializeComponent();</pre>

  <pre style="margin: 0px">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; app.Run();</pre>

  <pre style="margin: 0px">&#160;&#160;&#160;&#160;&#160;&#160;&#160; }</pre>

  <pre style="margin: 0px">&#160;&#160;&#160; }</pre>
</div>
Ahhhh – there’s Main()! Note that the class is declared as partial so that’s how it relates to the App code I showed in <a href="https://blogs.msdn.com/smaillet/archive/2009/04/06/building-a-wpf-emulator-part-ii.aspx">Part II</a> of this series. 

<p></p>

<p>The App class from Part II contained a bit of application specific startup logic that is necessary for the application to function. Based on how things are often done with Windows Forms (and our sample emulators based on it) you’d expect that the code for the main window class of the emulator would have a lot of application specific stuff in it. But, as you probably guessed by how I point that out – you’d be wrong! Here’s what the main window class code looks like:</p>

<div style="font-family: lucida console; background: silver; color: black; font-size: 11pt">
  <pre style="margin: 0px"><span style="color: blue">using</span> System.Windows;</pre>

  <pre style="margin: 0px">&#160;</pre>

  <pre style="margin: 0px"><span style="color: blue">namespace</span> KioskEmulator</pre>

  <pre style="margin: 0px">{</pre>

  <pre style="margin: 0px">&#160;&#160;&#160; <span style="color: gray">///</span><span style="color: green"> </span><span style="color: gray">&lt;summary&gt;</span></pre>

  <pre style="margin: 0px">&#160;&#160;&#160; <span style="color: gray">///</span><span style="color: green"> Interaction logic for EngMainWindow.xaml</span></pre>

  <pre style="margin: 0px">&#160;&#160;&#160; <span style="color: gray">///</span><span style="color: green"> </span><span style="color: gray">&lt;/summary&gt;</span></pre>

  <pre style="margin: 0px">&#160;&#160;&#160; <span style="color: blue">public</span> <span style="color: blue">partial</span> <span style="color: blue">class</span> <span style="color: #2b91af">EngMainWindow</span> : <span style="color: #2b91af">Window</span></pre>

  <pre style="margin: 0px">&#160;&#160;&#160; {</pre>

  <pre style="margin: 0px">&#160;&#160;&#160;&#160;&#160;&#160;&#160; <span style="color: blue">public</span> EngMainWindow( )</pre>

  <pre style="margin: 0px">&#160;&#160;&#160;&#160;&#160;&#160;&#160; {</pre>

  <pre style="margin: 0px">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; InitializeComponent( );</pre>

  <pre style="margin: 0px">&#160;&#160;&#160;&#160;&#160;&#160;&#160; }</pre>

  <pre style="margin: 0px">&#160;&#160;&#160; }</pre>

  <pre style="margin: 0px">}</pre>
</div>

<p>Honestly, that’s it - nothing more! This is one of those blow your mind / pull the rug out from under you kind of things when you first encounter it. (at least for me it was – what, wait no Onclick handlers, no Onbutton pressed handlers - what’s going on?) This is the true beauty of XAML and WPF and the <a href="https://blogs.msdn.com/johngossman/archive/2005/10/08/478683.aspx">Model View + View Model</a> (MV+VM) design pattern.&#160; There is no business logic in the UI – not a thing. Any code that is needed in the window class is entirely related to the UI. (We’ll see in a later post that the nicer looking designer version needs a little bit of code.) Once you get your head around this idea you’ll really start to love the WPF.</p>

<p>Of course the natural question from this new model is: If there’s no business logic in the window code how does the application work? Well that’s the job of data binding and the ViewModel as part of the MV+VM pattern. To help get a handle on that here’s the XAML for the main window (the engineers ugly version) [ NOTE: to keep things simple and focused I’ve removed the elements and attributes that are not relevant to understanding the connection to the ViewModel ] :</p>

<div style="font-family: lucida console; background: silver; color: black; font-size: 11pt">
  <pre style="margin: 0px"><span style="color: blue">&lt;</span><span style="color: #a31515">Window</span><span style="color: red"> x</span><span style="color: blue">:</span><span style="color: red">Class</span><span style="color: blue">=&quot;KioskEmulator.EngMainWindow&quot;</span></pre>

  <pre style="margin: 0px">&#160;&#160; <span style="color: red"> xmlns</span><span style="color: blue">=&quot;https://schemas.microsoft.com/winfx/2006/xaml/presentation&quot;</span></pre>

  <pre style="margin: 0px">&#160;&#160; <span style="color: red"> xmlns</span><span style="color: blue">:</span><span style="color: red">x</span><span style="color: blue">=&quot;https://schemas.microsoft.com/winfx/2006/xaml&quot;</span></pre>

  <pre style="margin: 0px"><strong>&#160;&#160; <span style="color: red"> xmlns</span><span style="color: blue">:</span><span style="color: red">em</span><span style="color: blue">=&quot;https://microsoft.com/MicroFramework/Emulator&quot;</span></strong></pre>

  <pre style="margin: 0px"><strong>&#160;&#160; <span style="color: red"> xmlns</span><span style="color: blue">:</span><span style="color: red">app</span><span style="color: blue">=&quot;clr-namespace:KioskEmulator&quot;</span></strong></pre>

  <pre style="margin: 0px">&#160;&#160; <span style="color: red"> Title</span><span style="color: blue">=&quot;Kiosk Emulator&quot;</span></pre>

  <pre style="margin: 0px">&#160; <span style="color: blue">&gt;</span></pre>

  <pre style="margin: 0px"><span style="color: #a31515">&#160; </span><span style="color: blue">&lt;</span><span style="color: #a31515">Canvas</span><span style="color: red"> Height</span><span style="color: blue">=&quot;367&quot;</span><span style="color: red"> Width</span><span style="color: blue">=&quot;420&quot;&gt;</span></pre>

  <pre style="margin: 0px"><span style="color: blue">    &lt;</span><span style="color: #a31515">Image</span><span style="color: red"> <strong>em</strong></span><strong><span style="color: blue">:</span><span style="color: red">TouchBehavior.TouchPort</span><span style="color: blue">=&quot;{</span><span style="color: #a31515">Binding</span><span style="color: red"> TouchPort</span><span style="color: blue">}&quot;</span></strong></pre>

  <pre style="margin: 0px">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <span style="color: red"> <strong>Source</strong></span><strong><span>=&quot;{Binding</span><span> LcdImage}&quot;</span></strong></pre>

  <pre style="margin: 0px">&#160;&#160;&#160; <span style="color: blue">/&gt;</span></pre>

  <pre style="margin: 0px"><span style="color: blue">    &lt;</span><span style="color: #a31515">Button</span><strong><span style="color: red"> em</span><span style="color: blue">:</span><span style="color: red">ButtonPressBehavior.ChangedCommand</span><span style="color: blue">=&quot;{</span><span style="color: #a31515">Binding</span><span style="color: red"> SetPinStateCommand</span><span style="color: blue">}&quot;</span></strong></pre>

  <pre style="margin: 0px"><strong>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <span style="color: red"> em</span><span style="color: blue">:</span><span style="color: red">ButtonPressBehavior.PinName</span><span style="color: blue">=&quot;Select&quot;</span></strong></pre>

  <pre style="margin: 0px"><strong>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <span style="color: red"> em</span><span style="color: blue">:</span><span style="color: red">ButtonPressBehavior.PropertyName</span><span style="color: blue">=&quot;IsPressed&quot;</span></strong></pre>

  <pre style="margin: 0px">&#160;&#160;&#160; <span style="color: blue">&gt;</span><span style="color: #a31515">Select</span><span style="color: blue">&lt;/</span><span style="color: #a31515">Button</span><span style="color: blue">&gt;</span></pre>

  <pre style="margin: 0px"><span style="color: blue">    &lt;</span><span style="color: #a31515">Label</span><span style="color: red"> <strong>app</strong></span><strong><span style="color: blue">:</span><span style="color: red">DropCardBehavior.DropCardCommand</span><span style="color: blue">=&quot;{</span><span style="color: #a31515">Binding</span><span style="color: red"> DropNfcCard</span><span style="color: blue">}&quot;</span></strong></pre>

  <pre style="margin: 0px"><strong>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <span style="color: red"> app</span><span style="color: blue">:</span><span style="color: red">DropCardBehavior.ReaderType</span><span style="color: blue">=&quot;NfcCard&quot;</span></strong></pre>

  <pre style="margin: 0px">&#160; <span style="color: blue">&gt;</span><span style="color: #a31515">Nfc Reader</span><span style="color: blue">&lt;/</span><span style="color: #a31515">Label</span><span style="color: blue">&gt;</span></pre>

  <pre style="margin: 0px"><span style="color: blue">    &lt;</span><span style="color: #a31515">Label</span><span style="color: red"> <strong>app</strong></span><strong><span style="color: blue">:</span><span style="color: red">DropCardBehavior.DropCardCommand</span><span style="color: blue">=&quot;{</span><span style="color: #a31515">Binding</span><span style="color: red"> DropMagCard</span><span style="color: blue">}&quot;</span></strong></pre>

  <pre style="margin: 0px"><strong>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <span style="color: red"> app</span><span style="color: blue">:</span><span style="color: red">DropCardBehavior.ReaderType</span><span style="color: blue">=&quot;MagCard&quot;</span></strong></pre>

  <pre style="margin: 0px"><span style="color: blue">    &gt;</span><span style="color: #a31515">MagStrip</span><span style="color: blue">&lt;/</span><span style="color: #a31515">Label</span><span style="color: blue">&gt;</span></pre>

  <pre style="margin: 0px"><span style="color: blue">    &lt;</span><span style="color: #a31515">ToggleButton</span><span style="color: red"> IsChecked</span><span style="color: blue">=&quot;<strong>{</strong></span><strong><span style="color: #a31515">Binding</span><span style="color: red"> LED1</span><span style="color: blue">,</span><span style="color: red">Mode</span></strong><span style="color: blue"><strong>=OneWay}</strong>&quot;</span><span style="color: blue">&gt;</span><span style="color: #a31515">LED1</span><span style="color: blue">&lt;/</span><span style="color: #a31515">ToggleButton</span><span style="color: blue">&gt;</span></pre>

  <pre style="margin: 0px"><span style="color: blue">    &lt;</span><span style="color: #a31515">ToggleButton</span><span style="color: red"> IsChecked</span><span style="color: blue">=&quot;<strong>{</strong></span><strong><span style="color: #a31515">Binding</span><span style="color: red"> LED2</span><span style="color: blue">,</span><span style="color: red">Mode</span></strong><span style="color: blue"><strong>=OneWay}</strong>&quot;</span><span style="color: blue">&gt;</span><span style="color: #a31515">LED2</span><span style="color: blue">&lt;/</span><span style="color: #a31515">ToggleButton</span><span style="color: blue">&gt;</span></pre>

  <pre style="margin: 0px"><span style="color: blue">    &lt;</span><span style="color: #a31515">ToggleButton</span><span style="color: red"> IsChecked</span><span style="color: blue">=&quot;<strong>{</strong></span><strong><span style="color: #a31515">Binding</span><span style="color: red"> LED3</span><span style="color: blue">,</span><span style="color: red">Mode</span></strong><span style="color: blue"><strong>=OneWay}</strong>&quot;</span><span style="color: blue">&gt;</span><span style="color: #a31515">LED3</span><span style="color: blue">&lt;/</span><span style="color: #a31515">ToggleButton</span><span style="color: blue">&gt; </span></pre>

  <pre style="margin: 0px"><span style="color: blue">    &lt;</span><span style="color: #a31515">ToggleButton</span><span style="color: red"> IsChecked</span><span style="color: blue">=&quot;<strong>{</strong></span><strong><span style="color: #a31515">Binding</span><span style="color: red"> RFIDLED</span><span style="color: blue">,</span><span style="color: red">Mode</span></strong><span style="color: blue"><strong>=OneWay}</strong>&quot;</span><span style="color: blue">&gt;</span><span style="color: #a31515">RFIDLED</span><span style="color: blue">&lt;/</span><span style="color: #a31515">ToggleButton</span><span style="color: blue">&gt;</span></pre>

  <pre style="margin: 0px"><span style="color: blue"><font color="#a31515">  </font>&lt;/</span><span style="color: #a31515">Canvas</span><span style="color: blue">&gt;</span></pre>

  <pre style="margin: 0px"><span style="color: blue">&lt;/</span><span style="color: #a31515">Window</span><span style="color: blue">&gt;</span></pre>
</div>

<p>At the top I’ve added a couple extra namespace entries to reference the WPF emulator standard behaviors and a custom application one to access the drag and drop support for the card readers. The engineers design uses a canvas as the primary UI element container. This is usually not the best idea for production UI but is a simple way for a dev to get something going for basic testing. Inside the canvas is an image control. The first thing to notice about the image control is that it has the em:TouchBehavior.TouchPort=&quot;{Binding TouchPort}&quot; attribute. This uses an attached property to create an <a href="https://blogs.msdn.com/johngossman/archive/2008/05/07/the-attached-behavior-pattern.aspx">attached behavior</a> for touch support and binds it to a property on the ViewModel called TouchPort. ok, I can hear some readers thinking – “ok, right – huh?”. (Bet you didn’t know I could read minds through this here interweb thingy didya?) What that means is that we can define behavior for a UI Element independent of the actual element itself and then re-use it wherever we need to. Thus we can attach the TouchBehavior.TouchPort property to any UIElement and bind that property to a TouchPort in the Viewmodel and things get automatically hooked up. If the view model is derived from the EmulatorViewModel (part of my custom WPF emulator assembly) then all the work is done. The emulator View model will receive commands from the attached touch behavior and send it on to the emulator engine! So with the new WPF emulator library adding touch is as simple as one attribute on any UIElement in XAML – That’s what I call cool!. [Uh-oh, nerd alert!]</p>

<p>For the KIOSK the touch support is attached to an Image for the LCD, getting the LCD updates is also just a matter of setting up the data binding for the Image’s Source property to the ViewModel’s LcdImage property. </p>

<p>While the Kiosk hardware doesn’t have any buttons, it only has the LCD and touch panel, it was useful to run basic sample touch applications on the emulator as I was building up the WPF library to verify things worked. Thus the engineers view has the Select button in there. The button is using the ButtonPressBehavior, which has three attached properties. The first is a data bound command SetPinStateCommand, which comes from the general EmulatorViewModel, to change the state of a GPIO pin in the emulator based on a change in state of a boolean property. The PinName is the name used to register the Pin in the emulator class. Using a name helps keep things cleaner and allows for pin remapping in hardware revisions to impact only one place in the code. The third property is the Property name of the control that will trigger a change in the state. In this case we want to change the state of the pin with the state of the IsPressed property of the button class. Unfortunately the IsPressed property is not one that the Button class implementation will allow you to data bind directly to. Which is what drove the need for the ButtonPressBehavior.</p>

<p>The MagStrip and NFC Readers required drag and drop capabilities to be able to drag a data file onto the emulator to simulate swiping/tapping a card. Since a card could have both NFC and magstrip data I created a single application specific behavior for that and attached it to the label controls and data bind it to a command provided by the ViewModel. The ReaderType Property determines which type of card the reader supports so that the drag and drop behavior will show a proper icon as a file is dragged over the NFC or magstrip areas. (e.g. if you drag a card file with magstrip only data over the NFC area it should indicate you can’t drop that file on the NFC reader.)</p>

<p>The KIOSK Device has 3 LEDs that I emulated using a standard ToggleButton control (like a radio button without the “select only one of many” behavior). I use data binding to bind the IsChecked property of the button to the led property of the ViewModel. However, since the LED is an output it is read only on the ViewModel and therefore must be specified as OneWay binding. Otherwise, WPF will try to connect up to the property set method so that whenever the IsChecked property changes (say from clicking on the button) then the ViewModel is updated. That will generate an exception since the setter method doesn’t exist.</p>

<p>The really amazing thing about all this data binding and attached properties for behaviors is that it is completely re-usable without altering the ViewModel itself. The UI can be literally anything a designer can dream up and represent in XAML and the rest of the code doesn’t need to care one teensy little bit. Even better is that there doesn’t even need to be any UI!? Yep, you read that correctly - you can make unit testing or automated tests of all your core logic by exercising the ViewModel directly in the same way that the XAML windows would do. This is a big benefit to automated testing as it is more easily automated then GUI UI testing. </p>

<p>OK, that’s a lot to absorb, especially for us “old dogs”. I’ll leave things for the moment so there aren’t any heads exploding. Next post I’ll dig into the whole view model and data binding in more details along with the View model support classes.</p>]]></content:encoded>
    </item>
    <item>
      <title>GHI releases updated firmware for Embedded Master</title>
      <link>https://docs.microsoft.com/archive/blogs/smaillet/ghi-releases-updated-firmware-for-embedded-master</link>
      <pubDate>Thu, 30 Apr 2009 12:39:41 GMT</pubDate>
      <dc:creator><![CDATA[Steve_Maillet]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/smaillet/2009/04/30/ghi-releases-updated-firmware-for-embedded-master/</guid>
      <description><![CDATA[GHI has released updated firmware for the Embedded Master module. New features include:  Version...]]></description>
      <content:encoded><![CDATA[<p>GHI has released updated firmware for the Embedded Master module. New features include:</p>  <p>Version 1.0.7</p>  <p>04/29/2009 </p>  <p><strong>Firmware Version 03.00.000</strong>    <br /><strong>Tiny Booter Version 03.00.000</strong>    <br />&gt; Includes .Net Micro Framework V3.0 Service Pack 1    <br />&gt; TinyBooter is defaulted to USB    <br />&gt; User can access Ethernet registers now    <br />&gt; Custom PPP communication interface support    <br />&gt; In-Field update support    <br />&gt; USB Host to Serial Sierra C885, 3G Modem    <br />&gt; Battery RAM Support    <br />&gt; Reboot support    <br />&gt; RawUSBDevice descriptor parsing enhancement    <br />&gt; Managed code protection support    <br />&gt; New Bootloader on USBizi products. Supports managed application update and protection.    </p>]]></content:encoded>
    </item>
    <item>
      <title>.NET Micro Framework Porting kit is now available in MSDN subscriptions</title>
      <link>https://docs.microsoft.com/archive/blogs/smaillet/net-micro-framework-porting-kit-is-now-available-in-msdn-subscriptions</link>
      <pubDate>Thu, 30 Apr 2009 12:31:30 GMT</pubDate>
      <dc:creator><![CDATA[Steve_Maillet]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/smaillet/2009/04/30/net-micro-framework-porting-kit-is-now-available-in-msdn-subscriptions/</guid>
      <description><![CDATA[Yesterday the .NET MF team announced that the .NET Micro Framework will be available in the MSDN...]]></description>
      <content:encoded><![CDATA[<p>Yesterday the .NET MF team <a href="https://blogs.msdn.com/netmfteam/archive/2009/04/29/porting-kit-free-with-msdn-subscription.aspx">announced</a> that the .NET Micro Framework will be available in the MSDN subscriptions starting with the OS level subscription. This is great news as MSDN is already available in many distribution outlets world wide. With the recent addition of the Windows Embedded Family of products into MSDN you can get all your development tools for sensors to servers in one subscription. </p>]]></content:encoded>
    </item>
  </channel>
</rss>