<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="wordpress/2.3.1" -->
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	>

<channel>
	<title>Designer WPF</title>
	<link>http://www.designerwpf.com</link>
	<description>Matthias Shapiro's WPF Blog - Because Developers Get All The Good Blogs</description>
	<pubDate>Wed, 25 Jun 2008 15:08:52 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.3.1</generator>
	<language>en</language>
			<item>
		<title>Designer WPF Update</title>
		<link>http://www.designerwpf.com/2008/06/25/designer-wpf-update/</link>
		<comments>http://www.designerwpf.com/2008/06/25/designer-wpf-update/#comments</comments>
		<pubDate>Wed, 25 Jun 2008 15:08:52 +0000</pubDate>
		<dc:creator>Matthias Shapiro</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.designerwpf.com/2008/06/25/designer-wpf-update/</guid>
		<description><![CDATA[I apologize for my extended sabbatical here&#8230; I&#8217;ve recently gotten married, which has thrown a bit of a wrench in my blogging commitment.
I&#8217;ll start posting again with some regularity in about three weeks, at which point I will also  start working on my first line-of-business Silverlight project. Until then&#8230;
]]></description>
			<content:encoded><![CDATA[<p>I apologize for my extended sabbatical here&#8230; I&#8217;ve recently gotten married, which has thrown a bit of a wrench in my blogging commitment.</p>
<p>I&#8217;ll start posting again with some regularity in about three weeks, at which point I will also  start working on my first line-of-business Silverlight project. Until then&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.designerwpf.com/2008/06/25/designer-wpf-update/feed/</wfw:commentRss>
		</item>
		<item>
		<title>How Do I Make a ListView or a ScrollViewer Left Handed?</title>
		<link>http://www.designerwpf.com/2008/04/18/how-do-i-make-a-listview-or-a-scrollviewer-left-handed/</link>
		<comments>http://www.designerwpf.com/2008/04/18/how-do-i-make-a-listview-or-a-scrollviewer-left-handed/#comments</comments>
		<pubDate>Sat, 19 Apr 2008 05:40:32 +0000</pubDate>
		<dc:creator>Matthias Shapiro</dc:creator>
		
		<category><![CDATA[Blend]]></category>

		<category><![CDATA[ScrollViewer]]></category>

		<category><![CDATA[Tutorial]]></category>

		<category><![CDATA[WPF]]></category>

		<category><![CDATA[XAML]]></category>

		<category><![CDATA[listview]]></category>

		<category><![CDATA[left handed]]></category>

		<category><![CDATA[lefty]]></category>

		<category><![CDATA[scrollbar]]></category>

		<category><![CDATA[Triggers]]></category>

		<guid isPermaLink="false">http://www.designerwpf.com/2008/04/18/how-do-i-make-a-listview-or-a-scrollviewer-left-handed/</guid>
		<description><![CDATA[Several months back, I was doing some work for a company that was using WPF for a stylus based application. One of the things that they found they needed was a scrollbar that could be used by left handed people who would have to cover the entire screen with their left hand in order to [...]]]></description>
			<content:encoded><![CDATA[<p>Several months back, I was doing some work for a company that was using WPF for a stylus based application. One of the things that they found they needed was a scrollbar that could be used by left handed people who would have to cover the entire screen with their left hand in order to scroll a traditional scroll viewer.</p>
<p>The solution ended up being so easy in WPF that I thought I&#8217;d post it here.</p>
<p>I&#8217;m in a two-birds-one-stone mood, so we&#8217;ll do this for both the listview, which will also cover a more traditional scrollviewer. Let&#8217;s start with our ever friendly listview.</p>
<p><img src="http://www.designerwpf.com/wp-content/uploads/2008/04/normallistview.png" alt="NormalListView" />At the very sight of this thing, with a stylus in hand, your average lefty is thinking to him or herself &#8220;I wonder if I can do my work upside down?&#8221; Let&#8217;s show them that we love and accept them just as they are.</p>
<p>The first thing we&#8217;re going to do is create a new template for this sucker, so right click on your listview and go to &#8220;<strong>Edit Control Parts (Template) -&gt; Edit a Copy…</strong>&#8221;</p>
<p><img src="http://www.designerwpf.com/wp-content/uploads/2008/04/lefty_editcontrolparts.png" alt="Lefty_EditControlParts" /></p>
<p>Now we&#8217;re looking at the standard listview template. Mine looks like this:</p>
<p><img src="http://www.designerwpf.com/wp-content/uploads/2008/04/lefty_listviewtemplate.png" alt="ListViewTemplate" />Let&#8217;s dig right into the ScrollViewer. If you&#8217;re doing this from the listview (like I am) then creating a template for the listview has already created a template for the scrollviewer. If you&#8217;re starting from a basic scrollviewer, you can pretty much start right here.</p>
<p>For the purposes of making this thing easy to work with in Blend, go ahead and set the HorizontalScrollBarVisibility and VerticalScrollBarVisibility to Visible.</p>
<p> <img src="http://www.designerwpf.com/wp-content/uploads/2008/04/scrollbarvisibiltiy.png" alt="ScrollBar_Visibility" /></p>
<p>And then &#8220;<strong>Edit Control Parts (Template) -&gt; Edit a Copy…</strong>&#8221; (or &#8220;<strong>Edit Control Parts (Template) -&gt; Edit Template</strong>&#8221; if it is available).</p>
<p>We are now looking at the guts of the ScrollViewer Control.</p>
<p>ListView ScrollViewer will look like this:</p>
<p><img src="http://www.designerwpf.com/wp-content/uploads/2008/04/listviewscrolltemplate.png" alt="ListViewScrollTemplate" />The normal ScrollViewer will look like this:</p>
<p> <img src="http://www.designerwpf.com/wp-content/uploads/2008/04/lefty_normalscrollviewer.png" alt="NormalScrollViewer" /></p>
<p>For our purposes, they&#8217;re functionally the same. It is actually a fairly simple control… basically just a Grid panel with the columns and rows set up like so:</p>
<p><font color="#0000ff">&lt;</font><font color="#800000">Grid.ColumnDefinitions</font><font color="#0000ff">&gt;</font><br />
<font color="#0000ff">      &lt;</font><font color="#800000">ColumnDefinition</font> <font color="#ff0000">Width</font>=&#8221;<font color="#0000ff">*</font>&#8220;<font color="#0000ff">/&gt;</font><br />
<font color="#0000ff">      &lt;</font><font color="#800000">ColumnDefinition</font> <font color="#ff0000">Width</font>=&#8221;<font color="#0000ff">Auto</font>&#8220;<font color="#0000ff">/&gt;</font><br />
<font color="#0000ff">&lt;/</font><font color="#800000">Grid.ColumnDefinitions</font><font color="#0000ff">&gt;</font></p>
<p><font color="#0000ff">&lt;</font><font color="#800000">Grid.RowDefinitions</font><font color="#0000ff">&gt;</font><br />
<font color="#0000ff">      &lt;</font><font color="#800000">RowDefinition</font> <font color="#ff0000">Height</font>=&#8221;<font color="#0000ff">*</font>&#8220;<font color="#0000ff">/&gt;</font><br />
<font color="#0000ff">      &lt;</font><font color="#800000">RowDefinition</font> <font color="#ff0000">Height</font>=&#8221;<font color="#0000ff">Auto</font>&#8220;<font color="#0000ff">/&gt;</font><br />
<font color="#0000ff">&lt;/</font><font color="#800000">Grid.RowDefinitions</font><font color="#0000ff">&gt;</font></p>
<p>The scrollBars are set up so that their visibility is tied to (duh) the visibility that is set on the control. But what this does is it means that when they are collapsed… they Grid reclaims the space that they were taking up.</p>
<p>Now… here&#8217;s the hilarious part… in order to make this ScrollViewer left handed, all you have to do is swap the Grid.Columns:</p>
<p><font color="#0000ff">&lt;</font><font color="#800000">Grid.ColumnDefinitions</font><font color="#0000ff">&gt;</font><br />
<font color="#0000ff">      &lt;</font><font color="#800000">ColumnDefinition</font> <font color="#ff0000">Width</font>=&#8221;<font color="#0000ff">Auto</font>&#8220;<font color="#0000ff">/&gt;</font><br />
<font color="#0000ff">      &lt;</font><font color="#800000">ColumnDefinition</font> <font color="#ff0000">Width</font>=&#8221;<font color="#0000ff">*</font>&#8220;<font color="#0000ff">/&gt;</font><br />
<font color="#0000ff">&lt;/</font><font color="#800000">Grid.ColumnDefinitions</font><font color="#0000ff">&gt;</font></p>
<p>You&#8217;ve now switched the columns so that the left handed column is auto. Here&#8217;s a list of the Grid.Column realignments you&#8217;ll need to make:</p>
<p><strong>Change Column to &#8220;1&#8243;:</strong></p>
<p><img src="http://www.designerwpf.com/wp-content/uploads/2008/04/lefty_columnswitch1.png" alt="Lefty_Column1" /></p>
<ul>
<li>PART_HorizontalScrollBar</li>
<li>All DockPanels (ListView only)</li>
<li>PART_ScrollContentPresenter (ScrollViewer only)</li>
<li>Corner (ScrollViewer only)</li>
</ul>
<p><strong>Change Column to &#8220;0&#8243;:</strong></p>
<p><img src="http://www.designerwpf.com/wp-content/uploads/2008/04/lefty_columnswitch0.png" alt="Lefty_Column0" /></p>
<ul>
<li>PART_VerticalScrollBar</li>
</ul>
<p>Basically, swap everything from in the two columns.</p>
<p>Done.</p>
<p><img src="http://www.designerwpf.com/wp-content/uploads/2008/04/finalleftyproduct.png" alt="FinalLeftyListView" />If you want to make this a more robust control, I recommend creating a ScrollViewer with an additional dependency property (IsSouthPaw or something). Make it so that your Grid has three columns:</p>
<p><font color="#0000ff">&lt;</font><font color="#800000">Grid.ColumnDefinitions</font><font color="#0000ff">&gt;</font><br />
<font color="#0000ff">      &lt;</font><font color="#800000">ColumnDefinition</font> <font color="#ff0000">Width</font>=&#8221;<font color="#0000ff">Auto</font>&#8220;<font color="#0000ff">/&gt;</font><br />
<font color="#0000ff">      &lt;</font><font color="#800000">ColumnDefinition</font> <font color="#ff0000">Width</font>=&#8221;<font color="#0000ff">*</font>&#8220;<font color="#0000ff">/&gt;<br />
      &lt;<font color="#800000">ColumnDefinition</font><font color="#000000"> </font><font color="#ff0000">Width</font><font color="#000000">=&#8221;</font><font color="#0000ff">Auto</font><font color="#000000">&#8220;</font><font color="#0000ff">/&gt;</font></font><br />
<font color="#0000ff">&lt;/</font><font color="#800000">Grid.ColumnDefinitions</font><font color="#0000ff">&gt;</font></p>
<p>And then you can just create a trigger that swaps the column placement of your PART_VerticalScrollBar. Such a trigger will look something like this. And by &#8220;something&#8221;, I mean &#8220;exactly&#8221;.</p>
<p><font color="#0000ff">&lt;</font><font color="#800000">Trigger</font> <font color="#ff0000">Property</font>=&#8221;<font color="#0000ff">IsSouthPaw</font>&#8221; <font color="#ff0000">Value</font>=&#8221;<font color="#0000ff">True</font>&#8220;<font color="#0000ff">&gt;</font><br />
      <font color="#0000ff">&lt;</font><font color="#800000">Setter</font> <font color="#ff0000">Property</font>=&#8221;<font color="#0000ff">Grid.Column</font>&#8221; <font color="#ff0000">TargetName</font>=&#8221;<font color="#0000ff">PART_VerticalScrollBar</font>&#8220;  <font color="#ff0000">Value</font>=&#8221;<font color="#0000ff">0</font>&#8221; <font color="#0000ff">/&gt;</font><br />
<font color="#0000ff">&lt;/</font><font color="#800000">Trigger</font><font color="#0000ff">&gt;</font></p>
<p>Go forth and make Ned Flanders proud.</p>
<p>By the way, I listen to pop punk whenever I write my tutorials and I just thought I should let <a href="http://en.wikipedia.org/wiki/Senses_Fail" onclick="javascript:urchinTracker ('/outbound/article/en.wikipedia.org');">Senses Fail </a>know that they can probably get away with about 80% less &#8220;dying cat&#8221; screaming and still put out good music. You know&#8230; because they&#8217;re probably WPF programmers on the side and they&#8217;ll probably read this to solve all their left-handed scrollbar needs.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.designerwpf.com/2008/04/18/how-do-i-make-a-listview-or-a-scrollviewer-left-handed/feed/</wfw:commentRss>
		</item>
		<item>
		<title>WPF Designers Guide to Styles And Templates</title>
		<link>http://www.designerwpf.com/2008/03/27/wpf-designers-guide-to-styles-and-templates/</link>
		<comments>http://www.designerwpf.com/2008/03/27/wpf-designers-guide-to-styles-and-templates/#comments</comments>
		<pubDate>Thu, 27 Mar 2008 20:45:04 +0000</pubDate>
		<dc:creator>Matthias Shapiro</dc:creator>
		
		<category><![CDATA[WPF]]></category>

		<category><![CDATA[WPF Designer Guides]]></category>

		<category><![CDATA[XAML]]></category>

		<category><![CDATA[styles]]></category>

		<category><![CDATA[templates]]></category>

		<category><![CDATA[]]></category>

		<category><![CDATA[ContentPresenter]]></category>

		<category><![CDATA[WPF Designers Guide]]></category>

		<guid isPermaLink="false">http://www.designerwpf.com/2008/03/27/wpf-designers-guide-to-styles-and-templates/</guid>
		<description><![CDATA[This is a post that has taken months to complete, but addresses something that I don’t think I&#8217;ve seen sufficiently covered for anyone who is new to WPF. Resultantly, we&#8217;re going to go through it slowly and I&#8217;m officially begging for additional questions at the end.
Part of the problem with styles and templates in WPF [...]]]></description>
			<content:encoded><![CDATA[<p>This is a post that has taken months to complete, but addresses something that I don’t think I&#8217;ve seen sufficiently covered for anyone who is new to WPF. Resultantly, we&#8217;re going to go through it slowly and I&#8217;m officially begging for additional questions at the end.</p>
<p>Part of the problem with styles and templates in WPF stems from the fact that Blend allows a wonderfully simply way of creating a copy of a template:</p>
<p><img src="http://www.designerwpf.com/wp-content/uploads/2008/03/snt_editcontrolparts.png" alt="SNT_EditControlParts" /></p>
<p>It then gives you something that looks like this:</p>
<p><font color="#0000ff">&lt;</font><font color="#800000">Style</font> <font color="#ff0000">x:Key</font>=&#8221;<font color="#0000ff">My_Template</font>&#8221; <font color="#ff0000">TargetType</font>=&#8221;<font color="#b8860b">{x:Type Button}</font>&#8220;<font color="#0000ff">&gt;</font><br />
      <font color="#0000ff">&lt;</font><font color="#800000">Setter</font> <font color="#ff0000">Property</font>=&#8221;<font color="#0000ff">Template</font>&#8220;<font color="#0000ff">&gt;</font><br />
            <font color="#0000ff">&lt;</font><font color="#800000">Setter.Value</font><font color="#0000ff">&gt;<br />
</font>                  <font color="#0000ff">&lt;</font><font color="#800000">ControlTemplate</font> <font color="#ff0000">TargetType</font>=&#8221;<font color="#b8860b">{x:Type Button}</font>&#8220;<font color="#0000ff">&gt;</font><br />
                        <font color="#008000">&lt;!&#8211; blah blah blah &#8211;&gt;</font></p>
<p>So, from a usability point of view… I told it to create a Template and it created a style. I judged from this that styles and templates were roughly the same thing.</p>
<p>And I was confused.</p>
<p>So, first, I&#8217;ll try to explain styles and templates by explaining how they work and then I&#8217;ll draw an analogy that I hope is helpful.</p>
<p>Let&#8217;s say you have a button.</p>
<p><img src="http://www.designerwpf.com/wp-content/uploads/2008/03/snt_basicbtn.png" alt="Hi_Button" /></p>
<p>You can change all sorts of properties of that button… visibility, background, width, height, margins, border thickness, alignment, font, whatever.</p>
<p>If you have a dozen buttons and you want them all to have the same properties, you can create a button style that specifies those properties and assigns them across the board. You can edit a style in Blend by selecting your control, clicking in the menu: &#8220;<strong>Objects -&gt; Edit Style -&gt; Edit a Copy…</strong>&#8220;.</p>
<p>Style editing in the objects tab will look like this.</p>
<p><img src="http://www.designerwpf.com/wp-content/uploads/2008/03/snt_styleobjects.png" alt="Style_Objects" /></p>
<p>As you can see, there are no objects in the visual tree to play with… only properties to assign in the properties tab.</p>
<p><img src="http://www.designerwpf.com/wp-content/uploads/2008/03/snt_styleproperties.png" alt="Button_Style_Properties" /></p>
<p>When you assign a property in Blend, your styles will save that assignment as setters and values. Let&#8217;s say we wanted all of our buttons to have green 18 point font  bold text. We could create a style that looked like this:</p>
<p><font color="#0000ff">&lt;</font><font color="#800000">Style</font> <font color="#ff0000">x:Key</font>=&#8221;<font color="#0000ff">GreenBorderButton</font>&#8221; <font color="#ff0000">TargetType</font>=&#8221;<font color="#b8860b">{x:Type Button}</font>&#8220;<font color="#0000ff">&gt;</font><br />
      <font color="#0000ff">&lt;</font><font color="#800000">Setter</font> <font color="#ff0000">Property</font>=&#8221;<font color="#0000ff">Foreground</font>&#8221; <font color="#ff0000">Value</font>=&#8221;<font color="#0000ff">#FF00FF00</font>&#8221; <font color="#0000ff">/&gt;</font><br />
      <font color="#0000ff">&lt;</font><font color="#800000">Setter</font> <font color="#ff0000">Property</font>=&#8221;<font color="#0000ff">FontSize</font>&#8221; <font color="#ff0000">Value</font>=&#8221;<font color="#0000ff">18</font>&#8220;<font color="#0000ff"> /&gt;</font><br />
      <font color="#0000ff">&lt;</font><font color="#800000">Setter</font> <font color="#ff0000">Property</font>=&#8221;<font color="#0000ff">FontWeight</font>&#8221; <font color="#ff0000">Value</font>=&#8221;<font color="#0000ff">Bold</font>&#8221; <font color="#0000ff">/&gt;</font><br />
<font color="#0000ff">&lt;/</font><font color="#800000">Style</font><font color="#0000ff">&gt;</font></p>
<p>The styles can only define properties that belong to the control type that they are styling (which is defined in the &#8220;<strong>TargetType</strong>&#8220;). Also, styles can only give information for properties the control already has and only in the way that the control is already set up. For example, because there is no property for changing the corner radius of a button, you can&#8217;t change the corner radius of a button using a button style.</p>
<p>However, what if we want to change something about the button that we can&#8217;t change with the given properties? For example, let&#8217;s say we wanted to see all the text show up twice.</p>
<p><img src="http://www.designerwpf.com/wp-content/uploads/2008/03/snt_doublebtn.png" alt="Double_Button" /></p>
<p>In order to do this, we need to make what I&#8217;m going to call &#8220;structural changes&#8221; to our control. Structural changes are changes in the actual guts of the control, changes to the base elements that make up the control. For this we need a control template.</p>
<p>Boiled down to their essence, templates are little chunks of XAML that are inserted whenever you use your control. When you right click on something and go to  &#8220;<strong>Edit Control Parts (Template) -&gt; Edit a Copy…</strong>&#8220;, Blend takes the default XAML that makes up your control and places it in the resources so that you can change it at your whim.</p>
<p>You can get to the Control Template using the right-click method described at the top of this post. Your basic button template will look something like this:</p>
<p><img src="http://www.designerwpf.com/wp-content/uploads/2008/03/snt_btntemplate.png" alt="Button_Template" /></p>
<p><font color="#0000ff">&lt;</font><font color="#800000">Style</font><font color="#ff0000"> x:Key</font>=&#8221;<font color="#0000ff">MyButtonStyle</font>&#8221; <font color="#ff0000">TargetType</font>=&#8221;<font color="#b8860b">{x:Type Button}</font>&#8220;<font color="#0000ff">&gt;</font><br />
      <font color="#0000ff">&lt;</font><font color="#800000">Setter</font> <font color="#ff0000">Property</font>=&#8221;<font color="#0000ff">Template</font>&#8221; <font color="#ff0000">Value</font>=&#8221;<font color="#b8860b">{DynamicResource MyButtonTemplate}</font>&#8221; <font color="#0000ff">/&gt;<br />
</font><font color="#0000ff">&lt;/</font><font color="#800000">Style</font><font color="#0000ff">&gt;</font></p>
<p><font color="#0000ff">&lt;</font><font color="#800000">ControlTemplate</font> <font color="#ff0000">x:Key</font>=&#8221;<font color="#0000ff">MyButtonTemplate</font>&#8221; <font color="#ff0000">TargetType</font>=&#8221;<font color="#b8860b">{x:Type Button}</font>&#8221; <font color="#0000ff">&gt;</font><br />
      <font color="#0000ff">&lt;</font><font color="#800000">Microsoft_Windows_Themes:ButtonChrome</font> <font color="#ff0000">x:Name</font>=&#8221;<font color="#0000ff">Chrome</font>&#8221; <font color="#0000ff">&gt;</font><br />
            <font color="#0000ff">&lt;</font><font color="#800000">ContentPresenter</font> <font color="#0000ff">/&gt;<br />
</font>      <font color="#0000ff">&lt;/</font><font color="#800000">Microsoft_Windows_Themes:ButtonChrome</font><font color="#0000ff">&gt;</font><br />
<font color="#0000ff">&lt;/</font><font color="#800000">ControlTemplate</font><font color="#0000ff">&gt;</font></p>
<p>We can go in and add an additional ContentPresenter in here, like so:</p>
<p><font color="#0000ff">&lt;</font><font color="#800000">ControlTemplate</font><font color="#ff0000"><font color="#800000"> </font>x:Key</font>=&#8221;<font color="#0000ff">MyButtonTemplate</font>&#8221; <font color="#ff0000">TargetType</font>=&#8221;<font color="#b8860b">{x:Type Button}</font>&#8221; <font color="#0000ff">&gt;</font><br />
      <font color="#0000ff">&lt;</font><font color="#800000">Microsoft_Windows_Themes:ButtonChrome</font> <font color="#ff0000">x:Name</font>=&#8221;<font color="#0000ff">Chrome</font>&#8221; <font color="#0000ff">&gt;<br />
</font>            <font color="#0000ff">&lt;</font><font color="#800000">Grid</font><font color="#0000ff">&gt;<br />
</font>                  <font color="#0000ff">&lt;</font><font color="#800000">Grid.RowDefinitions</font><font color="#0000ff">&gt;</font><br />
                        <font color="#0000ff">&lt;</font><font color="#800000">RowDefinition</font> <font color="#ff0000">Height</font>=&#8221;<font color="#0000ff">.5*</font>&#8221; <font color="#0000ff">/&gt;<br />
</font>                        <font color="#0000ff">&lt;</font><font color="#800000">RowDefinition</font> <font color="#ff0000">Height</font>=&#8221;<font color="#0000ff">.5*</font>&#8221; <font color="#0000ff">/&gt;</font><br />
                  <font color="#0000ff">&lt;</font><font color="#800000">Grid.RowDefinitions</font><font color="#0000ff">&gt;</font><br />
                  <font color="#0000ff">&lt;</font><font color="#800000">ContentPresenter</font> <font color="#ff0000">Grid.Row</font>=&#8221;<font color="#0000ff">0</font>&#8221; <font color="#0000ff">/&gt;</font><br />
                  <font color="#0000ff">&lt;</font><font color="#800000">ContentPresenter</font> <font color="#ff0000">Grid.Row</font>=&#8221;<font color="#0000ff">1</font>&#8221; <font color="#0000ff">/&gt;</font><br />
            <font color="#0000ff">&lt;/</font><font color="#800000">Grid</font><font color="#0000ff">&gt;</font><br />
      <font color="#0000ff">&lt;/</font><font color="#800000">Microsoft_Windows_Themes:ButtonChrome</font><font color="#0000ff">&gt;</font><br />
<font color="#0000ff">&lt;/</font><font color="#800000">ControlTemplate</font><font color="#0000ff">&gt;</font></p>
<p>And now our button shows all the content twice, one right on top of another.</p>
<p>The best way I&#8217;ve found to think about it is to think of your control as a car.</p>
<p>The dealer give the buyer a list of things that they can change about the car… interior color, leather or fabric seats, 4 or 6 cylinder engine… these are properties of the car… defined in the car &#8220;style&#8221;. (Basically, you can think of everything that you&#8217;re allowed to tweak <a href="http://www.toyota.com/byt/pub/setStartOptions.do?seriesCategory=3&amp;zipHolder=&amp;modelId=&amp;zipEditInputTextField=&amp;zipCode=84124" onclick="javascript:urchinTracker ('/outbound/article/www.toyota.com');">at this website </a>as the style of the car.)</p>
<p><font color="#0000ff">&lt;</font><font color="#800000">Style</font> <font color="#ff0000">x:Name</font>=&#8221;<font color="#0000ff">MySpecialCar</font>&#8221; <font color="#ff0000">TargetType</font>=&#8221;<font color="#b8860b">{x:Type Camry}</font>&#8221; <font color="#0000ff">&gt;</font><br />
      <font color="#0000ff">&lt;</font><font color="#800000">Setter</font> <font color="#ff0000">Property</font>=&#8221;<font color="#0000ff">ExteriorColor</font>&#8221; <font color="#ff0000">Value</font>=&#8221;<font color="#0000ff">Blue</font>&#8221; <font color="#0000ff">/&gt;</font><br />
      <font color="#0000ff">&lt;</font><font color="#800000">Setter </font><font color="#ff0000">Property</font>=&#8221;<font color="#0000ff">TransmissionType</font>&#8221; <font color="#ff0000">Value</font>=&#8221;<font color="#0000ff">5SpeedManual</font>&#8221; <font color="#0000ff">/&gt;<br />
</font><font color="#0000ff">&lt;/</font><font color="#800000">Style</font><font color="#0000ff">&gt;</font></p>
<p><img src="http://www.designerwpf.com/wp-content/uploads/2008/03/snt_camerybasic.png" alt="Camery_Basic" /><br />
 <br />
But let&#8217;s say that the buyer doesn&#8217;t want a normal seat… she wants a big comfy chair in place of the regular drivers seat. This is something outside of the scope of the list of things she was allowed to choose from, so they have to draw up new blueprints for making this new car. They have to create a new car &#8220;template&#8221;.</p>
<p>If our normal Camry blueprint looks like this:</p>
<p><font color="#0000ff">&lt;</font><font color="#800000">ControlTemplate</font> <font color="#ff0000">x:Key</font>=&#8221;<font color="#0000ff">MySpecialCarBlueprint</font>&#8221; <font color="#ff0000">TargetType</font>=&#8221;<font color="#b8860b">{x:Type Camry}</font>&#8220;<font color="#0000ff">&gt;</font><br />
      <font color="#0000ff">&lt;</font><font color="#800000">CamryFrame</font> <font color="#ff0000">x:Name</font>=&#8221;<font color="#0000ff">CamryFrame</font>&#8221; <font color="#0000ff">&gt;</font><br />
            <font color="#0000ff">&lt;</font><font color="#800000">Seat</font> <font color="#ff0000">Type</font>=&#8221;<font color="#0000ff">Drivers</font> &#8221; <font color="#0000ff">/&gt;<br />
</font>            <font color="#0000ff">&lt;</font><font color="#800000">Seat</font> <font color="#ff0000">Type</font>=&#8221;<font color="#0000ff">FrontPassenger</font>&#8221; <font color="#0000ff">/&gt;</font><br />
            <font color="#0000ff">&lt;</font><font color="#800000">Seat</font> <font color="#ff0000">Type</font>=&#8221;<font color="#0000ff">BackBench</font>&#8221; <font color="#0000ff">/&gt;</font><br />
      <font color="#0000ff">&lt;/</font><font color="#800000">CamryFrame</font><font color="#0000ff">&gt;<br />
</font><font color="#0000ff">&lt;<font size="+0">/</font></font><font color="#800000">ControlTemplate</font><font color="#0000ff">&gt;</font></p>
<p>We can go in and replace :</p>
<p><font color="#0000ff">&lt;</font><font color="#800000">Seat</font> <font color="#ff0000">Type</font>=&#8221;<font color="#0000ff">Drivers</font> &#8221; <font color="#0000ff">/&gt;</font></p>
<p>With</p>
<p><font color="#0000ff">&lt;</font><font color="#800000">Seat</font> <font color="#ff0000">Type</font>=&#8221;<font color="#0000ff">ComfyChair</font>&#8221; <font color="#0000ff">/&gt;</font></p>
<p><img width="198" src="http://www.designerwpf.com/wp-content/uploads/2008/03/comfychair.png" alt="ComfyChair" height="154" /></p>
<p>You may also notice that, with this model we could get rid of all the other seats except the drivers seat or we could add 12 new rows of seats. We can change anything about the car because we&#8217;re down into the original car blueprint.</p>
<p><strong>This is the basic difference between styles and templates. </strong></p>
<ul>
<li>A<em> style</em> is a list of properties that can be assigned in bulk to a control.</li>
<li>A<em> template</em> goes a big step further and actually defines the underlying structure of the control.</li>
</ul>
<p>You may be asking: &#8220;So how do these two work together? And what is this Data Template think I keep hearing about?&#8221;</p>
<p>Given that this post is getting dangerously long already, I&#8217;m going to address those issues in a couple more posts on styles and templates.</p>
<p>I&#8217;ll end on this note: if you are working in WPF and you&#8217;re having trouble with styles and templates, please read all of these posts (as I get to them) and ask questions in the comments section. I&#8217;m pretty good about getting to the comments questions and if the question is big enough, I&#8217;ll write a whole post on it. There are few things more vital to a WPF developer/designer than to have a firm grasp on styles and templates. It is in this understanding that the power of WPF really comes out.</p>
<ul>
<li>Who&#8217;s The Boss? Property Priority in Styles and Templates (coming soon)</li>
<li>Create Conditional Styles and Templates (With the Magic of Triggers) (coming soon)</li>
<li>So How Do Data Templates Fit Into All This? (coming soon)</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.designerwpf.com/2008/03/27/wpf-designers-guide-to-styles-and-templates/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Styling the ComboBox Dropdown (popup)</title>
		<link>http://www.designerwpf.com/2008/03/24/styling-the-combobox-dropdown-popup/</link>
		<comments>http://www.designerwpf.com/2008/03/24/styling-the-combobox-dropdown-popup/#comments</comments>
		<pubDate>Tue, 25 Mar 2008 03:36:25 +0000</pubDate>
		<dc:creator>Matthias Shapiro</dc:creator>
		
		<category><![CDATA[Blend]]></category>

		<category><![CDATA[combobox]]></category>

		<category><![CDATA[cornerradius]]></category>

		<category><![CDATA[dropdown]]></category>

		<category><![CDATA[padding]]></category>

		<category><![CDATA[Popup]]></category>

		<guid isPermaLink="false">http://www.designerwpf.com/2008/03/24/styling-the-combobox-dropdown-popup/</guid>
		<description><![CDATA[ This tutorial derives from the general &#8220;How to Style the ComboBox&#8221; set of tutorials.
First let&#8217;s make sure you&#8217;re in the right place. In this tutorial, we&#8217;re going to style the comboBox drop down (also known as the ComboBox popup) seen highlighted in red below.

We will not be styling the items inside the dropdown (highlighted in [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.designerwpf.com/wp-content/uploads/2008/03/cb_dropdown_example.png" title="CB_Image_1" ></a> This tutorial derives from the general &#8220;<a href="http://www.designerwpf.com/2008/02/07/the-wpf-designers-guide-to-styling-the-combobox/" >How to Style the ComboBox</a>&#8221; set of tutorials.</p>
<p>First let&#8217;s make sure you&#8217;re in the right place. In this tutorial, we&#8217;re going to style the comboBox drop down (also known as the ComboBox popup) seen highlighted in red below.</p>
<p><img src="http://www.designerwpf.com/wp-content/uploads/2008/03/cb_dropdown_example.png" alt="CB_Image_1" /></p>
<p>We will not be styling the items inside the dropdown (highlighted in blue). You can learn how to do that here.</p>
<p>So… let&#8217;s just go after some of the basics in styling the dropdown. We&#8217;ll give it a new background, a new border and we&#8217;ll round the edges to make it just a little more bubbly.</p>
<p>To start out, we&#8217;ll need to get to our comboBox control template, so right click on the comboBox in the Objects and Timeline window and go to &#8220;<strong>Edit Control Parts (Template) -&gt; Edit a Copy…</strong>&#8221;</p>
<p><img src="http://www.designerwpf.com/wp-content/uploads/2008/03/cb_dropdown_edittemplate.png" alt="CB_Image_2" /></p>
<p>Name it something you like and we&#8217;re on our way. </p>
<p>We&#8217;ll be editing the <strong>PART_Popup</strong>. Whatever you do, don&#8217;t change the name to this sucker. Whenever you see a &#8220;PART_Something&#8221;, it is a necessary part of that specific control (hence the naming convention).</p>
<p>The ComboBox dropdown (which we&#8217;ll be calling a popup for the remainder of this post)<span>  </span>is made up of a low cost drop shadow (see <a href="http://www.designerwpf.com/2008/02/08/wpf-drop-shadows-on-the-cheap/" >more on that here</a>), a border, a scrollviewer and the itemsPresenter.</p>
<p><img src="http://www.designerwpf.com/wp-content/uploads/2008/03/cb_dropdown_guts.png" alt="CB_Image_3" /></p>
<p>Most of the standard styling we might want to do is probably going to happen in the Border titled DropDownBorder. We can alter the background and the border brushes easily enough by just changing them in the Properties window. But you may notice some quirky behavior from our scrollviewer when we change the CornerRadius. Below, I&#8217;ve changed the CornerRadius to &#8220;<strong>0,0,10,10</strong>&#8221; and we can see that we lose part of the corner under the scrollviewer.</p>
<p><img src="http://www.designerwpf.com/wp-content/uploads/2008/03/cb_dropdown_borderconer.png" alt="CB_Image_4" /></p>
<p><img src="http://www.designerwpf.com/wp-content/uploads/2008/03/cb_dropdown_corner_eh.png" alt="CB_Image_5" /></p>
<p>We can solve this easily enough by adding some padding through the Border. Below I&#8217;ve added a padding of &#8220;<strong>0,0,2,6</strong>&#8220;.</p>
<p><img src="http://www.designerwpf.com/wp-content/uploads/2008/03/cb_dropdown_corner_fixed.png" alt="CB_Image_6" /></p>
<p>Better, but not really ideal. In a perfect world, we would be able to say that the border us able to cut off its content in that nice pretty rounded manner.<span>  </span>(If anyone knows how to do that… let me know, I haven&#8217;t given it hours of thought yet, but I&#8217;d love to know). In this case, however, this sub-optimization is the price we&#8217;re going to have to pay if we don&#8217;t want to have to go in and mess with the scrollbar style and template.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.designerwpf.com/2008/03/24/styling-the-combobox-dropdown-popup/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Usability Design For Forms: Luke Wroblewski</title>
		<link>http://www.designerwpf.com/2008/03/11/usability-design-for-forms-luke-wroblewski/</link>
		<comments>http://www.designerwpf.com/2008/03/11/usability-design-for-forms-luke-wroblewski/#comments</comments>
		<pubDate>Tue, 11 Mar 2008 17:53:37 +0000</pubDate>
		<dc:creator>Matthias Shapiro</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<category><![CDATA[]]></category>

		<category><![CDATA[form design]]></category>

		<category><![CDATA[Luke Wroblewski]]></category>

		<category><![CDATA[usability]]></category>

		<guid isPermaLink="false">http://www.designerwpf.com/2008/03/11/usability-design-for-forms-luke-wroblewski/</guid>
		<description><![CDATA[I swear&#8230; I&#8217;ll get back to the tutorials any day now!
 By in the meantime, I&#8217;m doing some form redesign and I wanted to praise to the heavesn Luke Wroblewski, whose many blog posts on form usability is some of the best, most practical stuff I&#8217;ve ever seen.
Stuff I&#8217;m reading and using right now:

Guide for aligning input [...]]]></description>
			<content:encoded><![CDATA[<p>I swear&#8230; I&#8217;ll get back to the tutorials any day now!</p>
<p> By in the meantime, I&#8217;m doing some form redesign and I wanted to praise to the heavesn Luke Wroblewski, whose <a href="http://www.lukew.com/ff/archive.asp?tag&amp;forms" onclick="javascript:urchinTracker ('/outbound/article/www.lukew.com');">many blog posts on form usability</a> is some of the best, most practical stuff I&#8217;ve ever seen.</p>
<p>Stuff I&#8217;m reading and using right now:</p>
<ul>
<li><a href="http://www.lukew.com/ff/entry.asp?144" onclick="javascript:urchinTracker ('/outbound/article/www.lukew.com');">Guide for aligning input fields and labels</a> - Left align? Right align? Top align? Get some guidance here.</li>
<li><a href="http://www.lukew.com/ff/entry.asp?502" onclick="javascript:urchinTracker ('/outbound/article/www.lukew.com');">Best Practices for Web Form Design</a> - a PDF on &#8220;the importance of Web forms and a series of design best practices culled from live to site analytics, usability testing, eye-tracking studies, and best practice surveys.&#8221;</li>
</ul>
<p>UPDATE: It turns out that Luke was at MIX&#8230; a tragedy that I&#8217;m discovering this just now. You can see his panel <a href="http://sessions.visitmix.com/?selectedSearch=PNL11" onclick="javascript:urchinTracker ('/outbound/article/sessions.visitmix.com');">&#8220;The Business Value of Design&#8221;</a> or read more about it <a href="http://feeds.feedburner.com/~r/FunctioningForm/~3/247517512/entry.asp" onclick="javascript:urchinTracker ('/outbound/article/feeds.feedburner.com');">at his website.</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.designerwpf.com/2008/03/11/usability-design-for-forms-luke-wroblewski/feed/</wfw:commentRss>
		</item>
		<item>
		<title>MIX 08 WPF/Wiimote Show Off Video</title>
		<link>http://www.designerwpf.com/2008/03/10/mix-08-wpfwiimote-show-off-video/</link>
		<comments>http://www.designerwpf.com/2008/03/10/mix-08-wpfwiimote-show-off-video/#comments</comments>
		<pubDate>Mon, 10 Mar 2008 23:01:59 +0000</pubDate>
		<dc:creator>Matthias Shapiro</dc:creator>
		
		<category><![CDATA[MIX08]]></category>

		<category><![CDATA[Veracity]]></category>

		<category><![CDATA[WPF]]></category>

		<category><![CDATA[Wii]]></category>

		<category><![CDATA[]]></category>

		<category><![CDATA[MIX 08]]></category>

		<category><![CDATA[Show Off]]></category>

		<category><![CDATA[Veracity Solutions]]></category>

		<category><![CDATA[Video]]></category>

		<category><![CDATA[Wiimote]]></category>

		<guid isPermaLink="false">http://www.designerwpf.com/2008/03/10/mix-08-wpfwiimote-show-off-video/</guid>
		<description><![CDATA[Thought I&#8217;d take a moment and toss up the WPF/Wiimote video that we submitted to the MIX 08 Show Off competition:

]]></description>
			<content:encoded><![CDATA[<p>Thought I&#8217;d take a moment and toss up the WPF/Wiimote video that we submitted to the MIX 08 Show Off competition:</p>
<p><embed flashvars="height=360&amp;width=640&amp;file=http://www.designerwpf.com/WiimoteVideo.flv" allowfullscreen="true" allowscriptaccess="always" height="360" width="640" src="http://www.jeroenwijering.com/embed/mediaplayer.swf"></embed></p>
]]></content:encoded>
			<wfw:commentRss>http://www.designerwpf.com/2008/03/10/mix-08-wpfwiimote-show-off-video/feed/</wfw:commentRss>
		</item>
		<item>
		<title>MIX 08 Sessions Now Online</title>
		<link>http://www.designerwpf.com/2008/03/10/mix-08-sessions-now-online/</link>
		<comments>http://www.designerwpf.com/2008/03/10/mix-08-sessions-now-online/#comments</comments>
		<pubDate>Mon, 10 Mar 2008 17:35:18 +0000</pubDate>
		<dc:creator>Matthias Shapiro</dc:creator>
		
		<category><![CDATA[Helpful Links]]></category>

		<category><![CDATA[MIX08]]></category>

		<category><![CDATA[WPF]]></category>

		<category><![CDATA[]]></category>

		<category><![CDATA[Anson Tsao]]></category>

		<category><![CDATA[Christ Pendleton]]></category>

		<category><![CDATA[Joe Stegman]]></category>

		<category><![CDATA[Karen Corby]]></category>

		<category><![CDATA[Mike Harsh]]></category>

		<category><![CDATA[Nathan Dunlap]]></category>

		<category><![CDATA[Robby Ingebretsen]]></category>

		<category><![CDATA[Silverlight 2.0]]></category>

		<category><![CDATA[VirtualEarth]]></category>

		<guid isPermaLink="false">http://www.designerwpf.com/2008/03/10/mix-08-sessions-now-online/</guid>
		<description><![CDATA[You can now check out all the MIX sessions, online.
 I attended the following sessions:
Bringing Your Data to Life with Windows Presentation Foundation - Anson Tsao
This is a great crash course to data binding in WPF.
Building Rich Internet Applications using Microsoft Silverlight Part 1 - Mike Harsh and Joe Stegman
Building Rich Internet Application using Microsoft Silverlight Part 2 [...]]]></description>
			<content:encoded><![CDATA[<p>You can now check out all the MIX sessions, online.</p>
<p> I attended the following sessions:</p>
<p><a href="http://sessions.visitmix.com/?selectedSearch=CT05" onclick="javascript:urchinTracker ('/outbound/article/sessions.visitmix.com');">Bringing Your Data to Life with Windows Presentation Foundation</a> - Anson Tsao</p>
<p>This is a great crash course to data binding in WPF.</p>
<p><a href="http://sessions.visitmix.com/?selectedSearch=CT01" onclick="javascript:urchinTracker ('/outbound/article/sessions.visitmix.com');">Building Rich Internet Applications using Microsoft Silverlight Part 1</a> - Mike Harsh and Joe Stegman</p>
<p><a href="http://sessions.visitmix.com/?selectedSearch=CT02" onclick="javascript:urchinTracker ('/outbound/article/sessions.visitmix.com');">Building Rich Internet Application using Microsoft Silverlight Part 2</a> - Mike Harsh</p>
<p>Good walkthrough  on building a basic Silverlight 2.0 application. You can get <a href="http://blogs.msdn.com/mharsh/archive/2008/03/05/slides-and-demos-from-my-mix-08-talk.aspx" onclick="javascript:urchinTracker ('/outbound/article/blogs.msdn.com');">the files that accompany this talk </a>at Mike Harsh&#8217;s blog. While attending these sessions, Mike and Joe repeatedly reccomended&#8230;</p>
<p><a href="http://visitmix.com/blogs/2008Sessions/T20/" onclick="javascript:urchinTracker ('/outbound/article/visitmix.com');">Creating Rich Dynamic User Interfaces with Silverlight 2 Controls</a> - Karen Corby</p>
<p>This was possibly the most valuable session I attended. Karen Corby walks us through how to create custom controls in Silverlight. The result is mind-blowingly powerful&#8230; and it seemed not to difficult. I hesitate on saying that simply because I haven&#8217;t done it myself yet. <img src='http://www.designerwpf.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> I&#8217;m going to go back over it and walk myself through the whole thing with <a href="http://scorbs.com/2008/03/09/mix08-creating-rich-dynamic-user-interfaces-with-silverlight-2-controls/" onclick="javascript:urchinTracker ('/outbound/article/scorbs.com');">the source code that she has posted.</a></p>
<p><a href="http://sessions.visitmix.com/?selectedSearch=BC01" onclick="javascript:urchinTracker ('/outbound/article/sessions.visitmix.com');">Nerd + Art : 10 Code Snippets to Empower Your Inner Artist</a> - Nathan Dunlap and Robby Ingebretsen</p>
<p>Two of the guys from Identity Mine walk through some great code snippets that allow designers a little more freedom to do the work they need to do. You can get the <a href="http://www.blendables.com/files/folders/nerd_43_art/entry387.aspx" onclick="javascript:urchinTracker ('/outbound/article/www.blendables.com');">Code Snippet Visual Studio 2008 installer file </a>and some of the <a href="http://www.blendables.com/files/folders/nerd_43_art/entry388.aspx" onclick="javascript:urchinTracker ('/outbound/article/www.blendables.com');">samples used in the talk </a>from the Identity Mine website.</p>
<p><a href="http://sessions.visitmix.com/?selectedSearch=T17" onclick="javascript:urchinTracker ('/outbound/article/sessions.visitmix.com');">Developing Applications with Microsoft VirtualEarth</a> - Chris Pendleton</p>
<p>Christ Pendleton walked us through integrating VirtualEarth into Internet applications. Pretty cool, although I&#8217;m not sure how much better than Google&#8217;s Maps/Earth API this is. It&#8217;s been a while since I&#8217;ve played with Google Maps, but I remember it being much easier than I thought it would be. Keep an eye on <a href="http://blogs.msdn.com/mappoint_b2b/" onclick="javascript:urchinTracker ('/outbound/article/blogs.msdn.com');">Chris&#8217; blog</a>, where he&#8217;ll be posting the code for the lab shortly (I&#8217;m told).</p>
]]></content:encoded>
			<wfw:commentRss>http://www.designerwpf.com/2008/03/10/mix-08-sessions-now-online/feed/</wfw:commentRss>
		</item>
		<item>
		<title>WPF Wii Binding Properties: Infrared Data</title>
		<link>http://www.designerwpf.com/2008/03/10/wpf-wii-binding-properties-infrared-data/</link>
		<comments>http://www.designerwpf.com/2008/03/10/wpf-wii-binding-properties-infrared-data/#comments</comments>
		<pubDate>Mon, 10 Mar 2008 15:32:15 +0000</pubDate>
		<dc:creator>Matthias Shapiro</dc:creator>
		
		<category><![CDATA[Binding]]></category>

		<category><![CDATA[Wii]]></category>

		<category><![CDATA[multipoint]]></category>

		<category><![CDATA[]]></category>

		<category><![CDATA[WPF Wii Binding Library]]></category>

		<guid isPermaLink="false">http://www.designerwpf.com/2008/03/10/wpf-wii-binding-properties-infrared-data/</guid>
		<description><![CDATA[This is an extension of my previous post, WPF Wiimote Library (Now With Project Files!), which has links to the WPF Wiimote Binding Library project files as well as some information vital to getting you started in connecting your application to the Wiimote.
And now for the IR properties:
The Wiimote can track up to 4 infrared (IR) [...]]]></description>
			<content:encoded><![CDATA[<p>This is an extension of my previous post, <a href="http://www.designerwpf.com/2008/03/07/wpf-wiimote-library-now-with-project-files/"rel="bookmark"  title="Permanent Link to WPF Wiimote Library (Now With Project Files!)" >WPF Wiimote Library (Now With Project Files!)</a>, which has links to the WPF Wiimote Binding Library project files as well as some information vital to getting you started in connecting your application to the Wiimote.</p>
<p>And now for the IR properties:</p>
<p>The Wiimote can track up to 4 infrared (IR) LEDs at a time. If I were a programmer, I would have created an IR LED enum with the following properties as part of each IR LED. But since I&#8217;m not, these properties can be accessed with the following convention: IR[#][propertyName]. Each IR LED has the following properties:</p>
<h2>IR[#]RawPosition</h2>
<p><strong>Type:</strong> Point</p>
<p><strong>Summary:</strong> The IR camera has a X,Y resolution of 1024, 768. This property will give you the raw X,Y position that the Wiimote is tracking this LED at.</p>
<p><strong>Binding Usage Example:</strong></p>
<p><font color="#0000ff">&lt;</font><font color="#800000">Grid </font><font color="#ff0000">Canvas.Left</font>=&#8221;<font color="#b8860b">{Binding Source={StaticResource WiiData}, Path=&#8221;IR1RawPosition.X, Mode=OneWay}</font>&#8221;<br />
<font color="#ff0000">Canvas.Top</font>=&#8221;<font color="#b8860b">{Binding Source={StaticResource WiiData}, Path=&#8221;IR1RawPosition.Y, Mode=OneWay}</font>&#8221; <font color="#0000ff">/&gt;</font></p>
<p><strong>Additional Info:</strong> This will work best if your Canvas is the exact dimensions of the Wiimote camera (1024, 768). These properties are automatically converted to take into account the IsMultiPoint setting (described in the Miscellaneous Properties (coming soon)).</p>
<h2>IR[#]Position</h2>
<p><strong>Type:</strong> Point</p>
<p><strong>Summary:</strong> This is the X,Y ratio of the position of your IR LED. The best way to use this is in a multi-binding with the width and height of your target Canvas. Fortunately for you, I&#8217;ve added a converter that will help with this. Simply add the following code in your resources:</p>
<p><font color="#0000ff">&lt;</font><font color="#800000">Wii:VariableCanvasPointConverter</font> <font color="#ff0000">x:Key</font>=&#8221;<font color="#0000ff">VariableCanvasConverter</font>&#8221; <font color="#0000ff">/&gt;</font></p>
<p>And follow the binding example below.</p>
<p><strong>Binding Usage Example:</strong></p>
<p><font color="#0000ff">&lt;</font><font color="#800000">Grid</font><font color="#0000ff">&gt;</font><br />
<font color="#0000ff">   &lt;</font><font color="#800000">Canvas.Left</font><font color="#0000ff">&gt;</font><br />
<font color="#0000ff">      &lt;</font><font color="#800000">MultiBinding</font> <font color="#ff0000">Converter</font>=&#8221;<font color="#b8860b">{StaticResource VariableCanvasConverter}</font>&#8220;<font color="#0000ff">&gt;</font><br />
<font color="#0000ff">         &lt;</font><font color="#800000">Binding</font> <font color="#ff0000">Source</font>=&#8221;<font color="#b8860b">{StaticResource WiiData}</font>&#8221; <font color="#ff0000">Path</font>=&#8221;<font color="#0000ff">IR1Position.X</font>&#8221; <font color="#ff0000">Mode</font>=&#8221;<font color="#0000ff">OneWay</font>&#8221; <font color="#0000ff">/&gt;<br />
</font><font color="#0000ff">         &lt;</font><font color="#800000">Binding</font> <font color="#ff0000">ElementName</font>=&#8221;<font color="#0000ff">MyCanvas</font>&#8221; <font color="#ff0000">Path</font>=&#8221;<font color="#0000ff">ActualWidth</font>&#8221; <font color="#ff0000">Mode</font>=&#8221;<font color="#0000ff">Default</font>&#8221; <font color="#0000ff">/&gt;<br />
</font><font color="#0000ff">      &lt;/</font><font color="#800000">MultiBinding</font><font color="#0000ff">&gt;</font><br />
<font color="#0000ff">   &lt;/</font><font color="#800000">Canvas.Left</font><font color="#0000ff">&gt;</font><br />
<font color="#0000ff">   &lt;</font><font color="#800000">Canvas.Top</font><font color="#0000ff">&gt;</font><br />
<font color="#0000ff">      &lt;</font><font color="#800000">MultiBinding</font> <font color="#ff0000">Converter</font>=&#8221;<font color="#b8860b">{StaticResource VariableCanvasConverter}</font>&#8220;<font color="#0000ff">&gt;</font><br />
<font color="#0000ff">         &lt;</font><font color="#800000">Binding</font> <font color="#ff0000">Source</font>=&#8221;<font color="#b8860b">{StaticResource WiiData}</font>&#8221; <font color="#ff0000">Path</font>=&#8221;<font color="#0000ff">IR1Position.Y</font>&#8221; <font color="#ff0000">Mode</font>=&#8221;<font color="#0000ff">OneWay</font>&#8221; <font color="#0000ff">/&gt;<br />
</font><font color="#0000ff">         &lt;</font><font color="#800000">Binding</font> <font color="#ff0000">ElementName</font>=&#8221;<font color="#0000ff">MyCanvas</font>&#8221; <font color="#ff0000">Path</font>=&#8221;<font color="#0000ff">ActualHeight</font>&#8221; <font color="#ff0000">Mode</font>=&#8221;<font color="#0000ff">Default</font>&#8221; <font color="#0000ff">/&gt;</font><br />
<font color="#0000ff">      &lt;/</font><font color="#800000">MultiBinding</font><font color="#0000ff">&gt;</font><br />
<font color="#0000ff">   &lt;/</font><font color="#800000">Canvas.Top</font><font color="#0000ff">&gt;</font><br />
<font color="#0000ff">&lt;/</font><font color="#800000">Grid</font><font color="#0000ff">&gt;</font></p>
<p><strong>Additional Info:</strong> These properties are automatically converted to take into account the IsMultiPoint setting (described in the Miscellaneous Properties (coming soon)).</p>
<h2>IR[#]Found</h2>
<p><strong>Type:</strong> boolean</p>
<p><strong>Summary:</strong> This is a property that is &#8220;true&#8221; if the Wiimote can see the target LED and &#8220;false&#8221; if it cannot.</p>
<p><strong>Binding Usage Example:</strong></p>
<p><font color="#0000ff">&lt;</font><font color="#800000">Grid</font> <font color="#ff0000">IsEnabled</font>=&#8221;<font color="#b8860b">{Binding Source={StaticResource WiiData}, Path=IR2Found, Mode=OneWay}</font>&#8221; <font color="#0000ff">/&gt;</font></p>
<p><strong>Additional Info:</strong><span>  </span>This property is also available for the midpoint between the first and second infrared light (MidPointFound) and for the target point (TargetFound) which displays a calculated position of where the Wiimote is being pointed.</p>
<h2>IR[#]Size</h2>
<p><strong>Type:</strong> double</p>
<p><strong>Summary:</strong> The Wiimote naturally picks up the size of the LED it is tracking. To get larger sizes<span>  </span>(which translates into better reliability) use a small cluster of LEDs (three should do the trick) rather than a single one.</p>
<p><strong>Binding Usage Example:</strong></p>
<p><font color="#0000ff">&lt;</font><font color="#800000">Grid</font> <font color="#ff0000">Width</font>=&#8221;<font color="#b8860b">{Binding Source={StaticResource WiiData}, Path=IR1Size, Mode=OneWay}</font>&#8221; <font color="#0000ff">/&gt;</font></p>
<h2>IsIR[#]Visible</h2>
<p><strong>Type:</strong> bool</p>
<p><strong>Summary:</strong> This item is meant for two way binding. If you want a way to programmatically choose whether or not to show the item that is bound to your IR interface, use this property. It is most useful when used in conjunction with the BoolToVisibility Converter, which can be used by placing this XAML in your resources:</p>
<p><font color="#0000ff">&lt;</font><font color="#800000">BooleanToVisibilityConverter</font> <font color="#ff0000">x:Key</font>=&#8221;<font color="#0000ff">boolToVis</font>&#8221; <font color="#0000ff">/&gt;</font></p>
<p><strong>Binding Usage Example:</strong></p>
<p><font color="#0000ff">&lt;</font><font color="#800000">Grid</font> <font color="#ff0000">Visibility</font>=&#8221;<font color="#b8860b">{Binding Source={StaticResource WiiData}, Path=IsIR3Visible, Mode=OneWay, Converter={StaticResource boolToVis}</font>&#8220;<font color="#0000ff">/&gt;</font></p>
<p><font color="#0000ff">&lt;</font><font color="#800000">CheckBox</font> <font color="#ff0000">IsChecked</font>=&#8221;<font color="#b8860b">{Binding Source={StaticResource WiiData}, Path=IsIR3Visible, Mode=TwoWay}</font>&#8220;<font color="#0000ff">/&gt;</font></p>
<p><strong>Additional Info:</strong><span>  </span>This is a great property to attach to a checkbox (as seen above) to allow user control over which items are to be shown.</p>
<p>In addition to the infrared lights, the WPF Wii library is set up to display two calculated points as well:</p>
<ul>
<li>A midpoint between IR1 and IR2</li>
<li>A target point (based on the midpoint) which indicates where the Wiimote is being pointed.</li>
</ul>
<p>These two calculated points still have the position properties listed above (<strong>TargetRawPosition, MidPoint RawPosition, TargetPosition, MidPointPosition</strong>) as well as the visibility booleans (<strong>IsTargetVisible</strong> and <strong>IsMidPointVisible</strong>) and the &#8220;found&#8221; boolean properties (<strong>MidPointFound</strong> and <strong>IsTargetPossible</strong>).</p>
<p>Of course, you can also play around with the items in Intellisense is also a great way to discover all the available properties.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.designerwpf.com/2008/03/10/wpf-wii-binding-properties-infrared-data/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Show Off Winners!</title>
		<link>http://www.designerwpf.com/2008/03/07/show-off-winners/</link>
		<comments>http://www.designerwpf.com/2008/03/07/show-off-winners/#comments</comments>
		<pubDate>Fri, 07 Mar 2008 21:31:29 +0000</pubDate>
		<dc:creator>Matthias Shapiro</dc:creator>
		
		<category><![CDATA[WPF]]></category>

		<category><![CDATA[Wii]]></category>

		<category><![CDATA[]]></category>

		<category><![CDATA[Crayon Physics]]></category>

		<category><![CDATA[MIX08]]></category>

		<category><![CDATA[Silverlight]]></category>

		<category><![CDATA[Wiimote]]></category>

		<guid isPermaLink="false">http://www.designerwpf.com/2008/03/07/show-off-winners/</guid>
		<description><![CDATA[They&#8217;ve just posted the Show Off winners from MIX 08, and my Wiimote Visualization squeaked in at number 3. Here is the complete list of winners:

Crayon Physics Deluxe by Petri Purho
Real Time Physics in Silverlight by Bill Reiss, Andy Beaulieu and Jeff Webber
Wii Data Visualization and Multipoint Nonsense by Matthias Shapiro (that&#8217;s me!)

I&#8217;ll post the full [...]]]></description>
			<content:encoded><![CDATA[<p>They&#8217;ve just posted the <a href="http://visitmix.com/blogs/News/802/" onclick="javascript:urchinTracker ('/outbound/article/visitmix.com');">Show Off winners </a>from MIX 08, and my Wiimote Visualization squeaked in at number 3. Here is the complete list of winners:</p>
<ol>
<li><a href="http://www.kloonigames.com/crayon/" onclick="javascript:urchinTracker ('/outbound/article/www.kloonigames.com');">Crayon Physics Deluxe</a> by Petri Purho</li>
<li><a href="http://www.codeplex.com/FarseerPhysics" onclick="javascript:urchinTracker ('/outbound/article/www.codeplex.com');">Real Time Physics in Silverlight </a>by Bill Reiss, Andy Beaulieu and Jeff Webber</li>
<li>Wii Data Visualization and Multipoint Nonsense by Matthias Shapiro (that&#8217;s me!)</li>
</ol>
<p>I&#8217;ll post the full video on this blog and on the Veracity blog by Monday. Thank you for everyone who attended and voted&#8230; and go check out the other videos! There was alot of cool stuff besides physics and Wiimote hacking in those videos. (I&#8217;ll post a link when they post one on the MIX site.)</p>
]]></content:encoded>
			<wfw:commentRss>http://www.designerwpf.com/2008/03/07/show-off-winners/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Make Your Own Deep Zoom Images for Silverlight</title>
		<link>http://www.designerwpf.com/2008/03/07/make-your-own-deep-zoom-images-for-silverlight/</link>
		<comments>http://www.designerwpf.com/2008/03/07/make-your-own-deep-zoom-images-for-silverlight/#comments</comments>
		<pubDate>Fri, 07 Mar 2008 17:54:06 +0000</pubDate>
		<dc:creator>Matthias Shapiro</dc:creator>
		
		<category><![CDATA[Silverlight]]></category>

		<category><![CDATA[]]></category>

		<category><![CDATA[Deep Zoom]]></category>

		<category><![CDATA[Hard Rock Cafe]]></category>

		<category><![CDATA[petabyte]]></category>

		<category><![CDATA[Robby Ingebretsen]]></category>

		<category><![CDATA[Silverlight 2.0]]></category>

		<guid isPermaLink="false">http://www.designerwpf.com/2008/03/07/make-your-own-deep-zoom-images-for-silverlight/</guid>
		<description><![CDATA[Have you heard about Deep Zoom?
No&#8230; it is not a porno filmed exclusivly with the Canon 5200mm mirror lens (although that would actually be kind of kinky), it is Microsoft&#8217;s new, dangerously named technology for taking huge pictures and making them completely zoomable over the internet through Silverlight.
&#8220;How huge?&#8221; you may ask. Well, I don&#8217;t [...]]]></description>
			<content:encoded><![CDATA[<p>Have you heard about Deep Zoom?</p>
<p>No&#8230; it is not a porno filmed exclusivly with the <a href="http://www.canonfd.com/mirrorlenses/pages/page10.html" onclick="javascript:urchinTracker ('/outbound/article/www.canonfd.com');">Canon 5200mm mirror lens</a> (although that would actually be kind of kinky), it is Microsoft&#8217;s new, dangerously named technology for taking huge pictures and making them completely zoomable over the internet through Silverlight.</p>
<p>&#8220;How huge?&#8221; you may ask. Well, I don&#8217;t know if there is a hard limit, but the biggest one I saw was 14 petabytes. </p>
<p>Petabytes. With a &#8220;p&#8221;. </p>
<p>Basically, take your bedroom, and fill it top to bottom with those nifty little 500GB external back-up hard drives. And you can see any part of that image almost instantly by simply zooming in on the part you want to see.</p>
<p>To see a demo, you can look at the<a href="http://memorabilia.hardrock.com/" onclick="javascript:urchinTracker ('/outbound/article/memorabilia.hardrock.com');"> Hard Rock memorabilia page</a>.</p>
<p>Well, with proper thanks to <a href="http://notstatic.com/archives/132" onclick="javascript:urchinTracker ('/outbound/article/notstatic.com');">Robby Ingebretsen</a>, Microsoft has released the <a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=457B17B7-52BF-4BDA-87A3-FA8A4673F8BF&amp;displaylang=en" onclick="javascript:urchinTracker ('/outbound/article/www.microsoft.com');">Deep Zoom Composer</a>, which allows us normal people to make and implement these kinds of super-zooming interfaces.</p>
<p>I&#8217;ll be working on it in the coming weeks and I&#8217;ll let you know what I come up with.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.designerwpf.com/2008/03/07/make-your-own-deep-zoom-images-for-silverlight/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
