<?xml version="1.0" encoding="UTF-8"?>
<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/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Veracity Solutions Blog &#187; WPF</title>
	<atom:link href="http://blogs.veracitysolutions.com/category/wpf/feed/" rel="self" type="application/rss+xml" />
	<link>http://blogs.veracitysolutions.com</link>
	<description>Software Consulting That Rocks</description>
	<lastBuildDate>Thu, 22 Apr 2010 17:21:20 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Roles of User Experience Design: User Research</title>
		<link>http://blogs.veracitysolutions.com/roles-of-user-experience-design-user-research/</link>
		<comments>http://blogs.veracitysolutions.com/roles-of-user-experience-design-user-research/#comments</comments>
		<pubDate>Mon, 15 Feb 2010 04:46:20 +0000</pubDate>
		<dc:creator>Matthias Shapiro</dc:creator>
				<category><![CDATA[Silverlight]]></category>
		<category><![CDATA[UX Methodology]]></category>
		<category><![CDATA[User Experience]]></category>
		<category><![CDATA[WPF]]></category>
		<category><![CDATA[Agile]]></category>
		<category><![CDATA[User Research]]></category>
		<category><![CDATA[UX]]></category>

		<guid isPermaLink="false">http://blogs.veracitysolutions.com/?p=693</guid>
		<description><![CDATA[This is the second post in a series on User Experience design. See other posts here:

Introduction to User Experience (UX) Design

User Research
Definition
User research means learning about your users &#8211; your customers – by gathering data and testing designs for the two purposes of discovery and evaluation. User research answers questions like the following:

What is the [...]]]></description>
			<content:encoded><![CDATA[<p>This is the second post in a series on User Experience design. See other posts here:</p>
<ul>
<li><a href="http://blogs.veracitysolutions.com/introduction-to-user-experience-ux-design/">Introduction to User Experience (UX) Design</a></li>
</ul>
<h2>User Research</h2>
<h3>Definition</h3>
<p><strong>User research</strong> means learning about your users &#8211; your customers – by gathering data and testing designs for the two purposes of <em>discovery</em> and <em>evaluation</em>. User research answers questions like the following:</p>
<ul>
<li>What is the user&#8217;s workflow for their job (or given tasks)?</li>
<li>What do users want to ultimately <em>do</em>?</li>
<li>What terminology do they use? (what&#8217;s their domain language?)</li>
<li>How well does your software help users do what they need to do?</li>
<li>How well does the software match users&#8217; <em>mental model</em> of what they expect it should do?</li>
<li>What parts of your software do users find confusing?</li>
<li>What parts of your software do users love?</li>
</ul>
<p>The data you get from user research is both <strong>quantitative</strong> (hard numbers and statistics that tell you what is happening) and <strong>qualitative</strong> (observed behaviors and user rationales that give you the context of why).</p>
<h3>How it fits into Agile</h3>
<p>The trick about Agile and UX is that <strong>Agile development already involves user research</strong>.</p>
<p>Agile has a discovery process, in which we gather user stories from actual users and map them into goals, activities, and stories on a story wall. Discovery is about learning how users do their tasks and how your software can help them do what they need to do efficiently.</p>
<p>We also do evaluations, in which we show our designs or working prototype code to the customer (as a user or user advocate) for feedback, at the end of each iteration. Usability testing has a reputation for being formal and summative (when everything is done), but it&#8217;s just as useful when formative (while you&#8217;re building things) and the Agile methodology (done right) actually has an insertion point where the user research that has been gathered can usefully inform the on-going product development.</p>
<p>Making it a more formal part of the process gives Agile development <strong>three benefits</strong>:</p>
<ol>
<li>It makes getting feedback from users an explicit part of Agile development, so that we can get the info we need at the end of each iteration, throughout the design and development process, and make quick course corrections.</li>
<li>It gives us a &#8220;utility belt&#8221; of best practices for gathering data and evaluating software with users, so that the information we have is more accurate, and saves money and time.</li>
<li>The data we gather helps us make models of how users think and act, and having a rich model means that <a href="http://www.thinkingandmaking.com/view/agile-ux-six">designing (and redesigning) is much more rapid</a>.</li>
</ol>
<h3>User Research methods</h3>
<p>User research gathers data through a variety of methods. The methods we most commonly advocate are:</p>
<p>Field observations (watching users&#8217; behavior in context)</p>
<ul>
<li>semi-structured interviews (asking users both prepared and extemporaneous questions)</li>
<li>data logging (collecting statistics on software usage)</li>
<li>diary studies (asking users to record their experiences)</li>
</ul>
<p>Usability testing puts designs (sketches, or prototype code) in front of users, and then uses all of the methods above to get feedback and evaluate design decisions. [We've written far more information about these methods <a title="User Research Methods" href="http://wiki.veracitysolutions.com/confluence/display/veracity/User+Research+Methods">over here</a>.]</p>
<h3>What deliverables can I expect from User Research?</h3>
<p>Data gathering gives us the information we need to build a model of the users. This generally manifests itself in personas (write-ups describing the different typical users of your software) and in the user stories of an Agile story wall. As further data is gathered, the stories may change, and the story wall is an evolving model for a user&#8217;s workflow and needs.</p>
<p>Evaluation findings and raw data are kept in whatever system the team is using to document design. We recommend a wiki or blog as a repository for user research findings (and as a journal of design decisions for the rest of the UX design).</p>
<p>Findings should identify problems that need fixing and provide data to support the finding.</p>
<p><strong>Example: </strong>a wiki page with video that shows a user getting confused when trying to submit a form on a specific screen of your application. (There should be video of both the person&#8217;s reaction and the screen they see.)</p>
<p>User research informs decisions and makes recommendations, but should not prescribe how to fix the problems identified.</p>
<p>Keep in mind that there is <em>no such thing</em> as &#8220;fixing problems proactively&#8221;. Every piece of software is going to have problems and every piece of software is going to need to have the experience fixed. Many people have the idea that a good enough UX designer will be able to spot problems with their magical designer intuition and fix them without any contact with the target users. While there are best practices in terms of layout, color, type and flow, it is impossible to build a perfect application on the first try.</p>
<h3>Where in the development process does User Research fit?</h3>
<p>User research should occur throughout the entire design and development process. Before any coding begins and iterations begin in earnest, it is a vital component for properly identifying stories and the tasks associated with them.</p>
<p>For more specific information about how to implement the various user research tasks into the development process, see the chart in “User Experience and App Workflow”.</p>
<h3>What benefits can I expect from User Research?</h3>
<p>As mentioned before, user research is already a native part of Agile methodology; you&#8217;re not buying something extra by doing user research. If you don&#8217;t do it, you&#8217;re taking something OUT of Agile and weakening the strength of the methodology in the process.</p>
<p>As stated above, formalizing user research helps you set up an infrastructure for getting feedback on a more regular basis so that you can be more agile, and helps you be the most efficient and get the most accurate data when gathering feedback from users. User research helps you better understand the needs of your customers, identify software requirements, prioritize features and drive product strategy. This results in spending appropriate time and money on features that deliver the greatest return on investment (ROI).</p>
<p><em>(Silverlight/WPF technologies have some specific ROI benefits for gathering data. See below.)</em></p>
<h3>How do Silverlight/WPF technologies help me with User Research?</h3>
<p>The biggest aspect of the current Silvelright/WPF technogies that aids in user research is the SketchFlow application that comes as a part of Blend 3 (and later versions).</p>
<p>In early product planning and development,  SketchFlow lets you mock-up an interactive prototype that you can put in front of users in order to quickly collect feedback. While the system is not yet perfected, it offers significant savings over traditional shoe-leather data gathering.</p>
<p>For more developed projects, it is possible to hook <a href="http://mark.mymonster.nl/2009/02/15/tracking-silverlight-support-in-google-analytics/">Google Analytics into Silverlight</a> projects and let it listen for certain events. However, the most effective (and cheapest) method we&#8217;ve found is the old fashioned methods of user interviews and observation.</p>
<h2>Additional User Research links</h2>
<p>D. Chisnell. <em>Usability Testing Demystified</em>. (2009)<br />
<a href="http://www.alistapart.com/articles/usability-testing-demystified/">http://www.alistapart.com/articles/usability-testing-demystified/</a><br />
Straight-forward explanation of what usability testing is, how to do it, and why it doesn&#8217;t need to be formal summative testing.</p>
<p>S. Krug. <em>Don&#8217;t Make Me Think: A Common Sense Approach to Web Usability, 2nd Edition</em>. (2005)<br />
<a href="http://www.amazon.com/exec/obidos/ASIN/0321344758/ref=nosim/advancedcommonse">http://www.amazon.com/exec/obidos/ASIN/0321344758/ref=nosim/advancedcommonse</a><br />
S. Krug. <em>Rocket Surgery Made Easy: A Do-It-Yourself Guide to Finding and Fixing Usability Problems</em>. (2009)<br />
<a href="http://www.amazon.com/exec/obidos/ASIN/0321657292/ref=nosim/advancedcommonse">http://www.amazon.com/exec/obidos/ASIN/0321657292/ref=nosim/advancedcommonse</a><br />
Excellent books, with some of the best advice on low/no-budget usability testing we&#8217;ve seen.</p>
<p>R. Jones, N. Milic-Frayling, K. Rodden, A. Blackwell, &#8220;Contextual Method for the Redesign of Existing Software Products,&#8221; <em>International Journal of Human-Computer Interaction</em>, 2007, 22(1-2). (Original paper dated 2004.)<br />
<a href="http://research.microsoft.com/apps/pubs/default.aspx?id=70095">http://research.microsoft.com/apps/pubs/default.aspx?id=70095</a><br />
Great practical overview of many of the methods described above, courtesy Microsoft Research.</p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.veracitysolutions.com/roles-of-user-experience-design-user-research/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Create A Snapping Slider In Blend Using Behaviors (Silverlight 3 or WPF)</title>
		<link>http://blogs.veracitysolutions.com/create-a-snapping-slider-in-blend-using-behaviors-silverlight-3-or-wpf/</link>
		<comments>http://blogs.veracitysolutions.com/create-a-snapping-slider-in-blend-using-behaviors-silverlight-3-or-wpf/#comments</comments>
		<pubDate>Wed, 02 Sep 2009 02:59:08 +0000</pubDate>
		<dc:creator>Matthias Shapiro</dc:creator>
				<category><![CDATA[Advanced Tutorial]]></category>
		<category><![CDATA[Silverlight]]></category>
		<category><![CDATA[Tutorial]]></category>
		<category><![CDATA[WPF]]></category>
		<category><![CDATA[Behaviors]]></category>
		<category><![CDATA[Rounding Slider]]></category>
		<category><![CDATA[Silverlight 3]]></category>
		<category><![CDATA[Slider]]></category>
		<category><![CDATA[Snapping Slider]]></category>

		<guid isPermaLink="false">http://blogs.veracitysolutions.com/?p=650</guid>
		<description><![CDATA[UPDATE: It turns out that in WPF, there is an easier way to snap the slider. For integers, simply check the &#8220;IsSnapToTickEnabled&#8221; and set your TickFrequency accordingly. Which means that this behavior is really only useful for Silverlight, which doesn&#8217;t have those properties.
Behaviors are easily the coolest thing that has ever happened to anything. 
Perhaps [...]]]></description>
			<content:encoded><![CDATA[<p>UPDATE: It turns out that in WPF, there is an easier way to snap the slider. For integers, simply check the &#8220;IsSnapToTickEnabled&#8221; and set your TickFrequency accordingly. Which means that this behavior is really only useful for Silverlight, which doesn&#8217;t have those properties.</p>
<p>Behaviors are easily the coolest thing that has ever happened to anything. </p>
<p>Perhaps I overstate my case somewhat. But they’re still pretty cool.</p>
<p>To me, a wonderful example is the ability to let designers/developers get some really cool functionality out of the Silverlight or WPF slider.</p>
<p>Now, one might normally think that there is a simple way to make your slider values to snap to an integer or to some incremental number (perhaps base 2 or base 10). Alas, one would be wrong. There have been a couple solutions to this problem (see <a href="http://blog.webjak.net/2009/05/10/silverlight-slider-that-snaps-to-rounded-value-when-dragged/">here</a> and <a href="http://blogs.msdn.com/devdave/archive/2008/06/12/discreteslider-a-simple-control-subclass.aspx">here</a>), but they usually involve creating a new slider subclass with the additional functionality if you really want the interaction to be reusable.</p>
<p>However, behaviors makes all this unnecessary. What is even better is that there is no code difference between WPF and Silverlight on this one. That’s right… this tutorial and the code that goes with it works exactly the same in Silverlight as it does in WPF. </p>
<p><a href="http://www.designersilverlight.com/wp-content/uploads/2009/09/SnappingSlider.cs">SnappingSlider Behavior (SnappingSlider.cs)</a> – Works for Silverlight and WPF</p>
<p><a href='http://www.designersilverlight.com/wp-content/uploads/2009/09/SnappingSliderWPF.zip'>WPF SnappingSlider Behavior (All Project Files)</a></p>
<p><a href='http://www.designersilverlight.com/wp-content/uploads/2009/09/SnappingSliderSilverlight.zip'>Silverlight SnappingSlider Behavior (All Project Files)</a></p>
<p>You can also <a href="http://gallery.expression.microsoft.com/en-us/SnappingSlider">download the behavior here (just the cs file)</a> which would make me happy because it ups my street cred among the Silverlight homies (says the whitest man on earth).</p>
<p>If you want to learn how to create it yourself, let’s get started.</p>
<p>In your project in Blend, right-click on the project and go to “Add New Item…” </p>
<p><a href="http://www.designersilverlight.com/wp-content/uploads/2009/09/clip_image0014.png"><img style="border-bottom: 0px;border-left: 0px;border-top: 0px;border-right: 0px" border="0" alt="clip_image001[4]" src="http://www.designersilverlight.com/wp-content/uploads/2009/09/clip_image0014_thumb.png" width="279" height="81" /></a></p>
<p>Choose “Behavior” from the list and type in the name of the behavior you want to create</p>
<p><a href="http://www.designersilverlight.com/wp-content/uploads/2009/09/clip_image0016.png"><img style="border-bottom: 0px;border-left: 0px;border-top: 0px;border-right: 0px" border="0" alt="clip_image001[6]" src="http://www.designersilverlight.com/wp-content/uploads/2009/09/clip_image0016_thumb.png" width="381" height="176" /></a></p>
<p>This is where Blend is way cooler than Visual Studio… it gives you pretty much all the code and imports all the appropriate references for creating a behavior. So, first change the behavior associated object type to a Slider:</p>
<p><span style="color: blue">public class </span><span style="color: black">SnappingSlider : Behavior&lt;Slider&gt;</span></p>
<p> <a href="http://11011.net/software/vspaste"></a>
<p> And go into the inside the OnAttached method, enter the following code:</p>
<p><span style="color: black">AssociatedObject.ValueChanged +=</span><span style="color: blue">new </span><span style="color: black">System.Windows.RoutedPropertyChangedEventHandler&lt;</span><span style="color: blue">double</span><span style="color: black">&gt;(AssociatedObject_ValueChanged);</span></p>
<p> <a href="http://11011.net/software/vspaste"></a>
<p> Hint to Code Newbies: If you get to the “+=” part and hit the Tab key twice it will add the necessary code.</p>
<p>Inside the AssociatedObject_ValueChanged method, I added the following code: </p>
<p><span style="color: blue">private void</span><span style="color: black">AssociatedObject_ValueChanged(</span><span style="color: blue">object</span><span style="color: black">sender, System.Windows.RoutedPropertyChangedEventArgs&lt;</span><span style="color: blue">double</span><span style="color: black">&gt; e)     <br />{      <br />&#160;&#160; </span><span style="color: green">//Let the slider be equal to the Maximum and Minimum values     <br />&#160;&#160; </span><span style="color: blue">if</span><span style="color: black">((e.NewValue != AssociatedObject.Maximum) &amp;&amp; (e.NewValue != AssociatedObject.Minimum))     <br />&#160;&#160;&#160; {      <br />&#160;&#160;&#160;&#160;&#160;&#160; </span><span style="color: green">//Using the Minimum value as a starting point, only allow values that are      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; //&#160;&#160; a multiple of the SmallChange value. If you want to simply round to       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; //&#160;&#160; integers, set it so that:       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; //&#160;&#160; SmallChange = 1      <br />&#160;&#160;&#160;&#160;&#160;&#160; </span><span style="color: blue">double</span><span style="color: black">calcValue = Math.Floor((e.NewValue &#8211; AssociatedObject.Minimum) / AssociatedObject.SmallChange);     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; calcValue = (calcValue * AssociatedObject.SmallChange) + AssociatedObject.Minimum;      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; AssociatedObject.Value = Math.Round(calcValue);      <br />&#160;&#160;&#160; }      <br />&#160;&#160;&#160; </span><span style="color: blue">else     <br />&#160;&#160;&#160; </span><span style="color: black">{     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span><span style="color: green">//Sometimes it hiccups on me, so I used this to catch those     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span><span style="color: black">AssociatedObject.Value = Math.Round(e.NewValue);     <br />&#160;&#160;&#160; }      <br />}</span></p>
<p> <a href="http://11011.net/software/vspaste"></a><a href="http://11011.net/software/vspaste"></a>
<p>Once you have that code in place, build the project (menu option Project –&gt; Build Project).</p>
<p>Now you should have the behavior available in the “Assets” tab under “Behaviors” (at the bottom of the picture below).</p>
<p><a href="http://www.designersilverlight.com/wp-content/uploads/2009/09/clip_image0018.png"><img style="border-bottom: 0px;border-left: 0px;border-top: 0px;border-right: 0px" border="0" alt="clip_image001[8]" src="http://www.designersilverlight.com/wp-content/uploads/2009/09/clip_image0018_thumb.png" width="349" height="242" /></a></p>
<p>&#160;</p>
<p>Just drag it onto your Slider and set the Minimum, Maximum and SmallChange properties appropriately. Remember that SmallChange is the value is that is acting as your increment controller. </p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.veracitysolutions.com/create-a-snapping-slider-in-blend-using-behaviors-silverlight-3-or-wpf/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Adobe Illustrator To XAML Conversion Options</title>
		<link>http://blogs.veracitysolutions.com/adobe-illustrator-to-xaml-conversion-options/</link>
		<comments>http://blogs.veracitysolutions.com/adobe-illustrator-to-xaml-conversion-options/#comments</comments>
		<pubDate>Tue, 01 Sep 2009 18:53:06 +0000</pubDate>
		<dc:creator>Matthias Shapiro</dc:creator>
				<category><![CDATA[Design]]></category>
		<category><![CDATA[Silverlight]]></category>
		<category><![CDATA[WPF]]></category>
		<category><![CDATA[XAML]]></category>
		<category><![CDATA[Adobe Illustrator]]></category>
		<category><![CDATA[export]]></category>
		<category><![CDATA[Expression Blend]]></category>
		<category><![CDATA[import]]></category>
		<category><![CDATA[Mike Swanson]]></category>
		<category><![CDATA[Path]]></category>
		<category><![CDATA[SVG]]></category>
		<category><![CDATA[vector]]></category>

		<guid isPermaLink="false">http://blogs.veracitysolutions.com/?p=642</guid>
		<description><![CDATA[One of the things that I’ve been doing as I was working on my Florida Crime Rate data visualization was finding vector maps of the US and converting them into XAML. Pretty much everything I found that was free was in SVG format, so I would pull that into Adobe Illustrator and then export into [...]]]></description>
			<content:encoded><![CDATA[<p>One of the things that I’ve been doing as I was working on my <a href="http://blogs.veracitysolutions.com/florida-crime-rates-an-information-visualization-in-silverlight/">Florida Crime Rate data visualization</a> was finding vector maps of the US and converting them into XAML. Pretty much everything I found that was free was in SVG format, so I would pull that into Adobe Illustrator and then export into XAML using <a href="http://www.mikeswanson.com/xamlexport/">Mike Swanson’s really awesome Adobe Illustrator to XAML export plug-in</a>. But I wanted to take a moment and say why I’m still using this plug-in instead of the default Expression Blend Import for Illustrator.</p>
<p>As a case study, let’s look at an SVG file of the US counties. (You can find <a href="http://commons.wikimedia.org/wiki/File:USA_Counties_with_names.svg">a link to the SVG here</a>. Here is <a href="http://www.designersilverlight.com/wp-content/uploads/2009/09/USA_Counties_with_names_AI_Export.xaml">the file converted to XAML</a> if you just want to download that and not mess with any of this other stuff. Special thanks to Nathan Yau of Flowing Data and @SimonRegenbogen for helping me find this.)</p>
<p><a href="http://www.designersilverlight.com/wp-content/uploads/2009/09/clip_image0015.png"><img style="border-right-width: 0px;border-top-width: 0px;border-bottom-width: 0px;border-left-width: 0px" border="0" alt="clip_image001[5]" src="http://www.designersilverlight.com/wp-content/uploads/2009/09/clip_image0015_thumb.png" width="565" height="360" /></a></p>
<p>The SVG is about 1.6 MB, but when I convert it to XAML, it sees a size reduction of about 20-25%.</p>
<p><a href="http://www.designersilverlight.com/wp-content/uploads/2009/09/clip_image001.png"><img style="border-right-width: 0px;border-top-width: 0px;border-bottom-width: 0px;border-left-width: 0px" border="0" alt="clip_image001" src="http://www.designersilverlight.com/wp-content/uploads/2009/09/clip_image001_thumb.png" width="392" height="92" /></a></p>
<p>You’ll notice that the Adobe Illustrator-to-XAML export is about 100 KB smaller than the Expression Blend Illustrator Import. What’s the difference?</p>
<ol>
<li><b>AI-to-XAML preserves path layers and grouping</b> – In the native import version, all the paths are imported into a single Canvas. This makes it really hard to isolate paths and work with them individually. The AI export version groups into separate Canvases so that each state is it’s own canvas. Very handy.</li>
<li><b>AI-to-XAML preserves some metadata</b> – all the paths in the AI-to-XAML version have a comment preceding the path that contains some (not all) of the naming metadata from the SVG file.</li>
<li><b>AI-to-XAML spaces code out better</b> – Here is a sample of the data from the AI-to-XAML version:</li>
<p><a href="http://www.designersilverlight.com/wp-content/uploads/2009/09/clip_image0019.png"><img style="border-bottom: 0px;border-left: 0px;border-top: 0px;border-right: 0px" border="0" alt="clip_image001[9]" src="http://www.designersilverlight.com/wp-content/uploads/2009/09/clip_image0019_thumb.png" width="350" height="120" /></a>      <br />And here is the same path in the native import.</p>
<p><a href="http://www.designersilverlight.com/wp-content/uploads/2009/09/clip_image0017.png"><img style="border-bottom: 0px;border-left: 0px;border-top: 0px;border-right: 0px" border="0" alt="clip_image001[7]" src="http://www.designersilverlight.com/wp-content/uploads/2009/09/clip_image0017_thumb.png" width="383" height="53" /></a></p>
<p>You’ll notice three things: the first is the metadata (already noted). The second is that the export plug-in has spaced the paths to make them easier to read. The third is something you’ll notice if you’ve spent a lot of time working with XAML paths… the point data is spaced out in a way that makes it much more readable.&#160; Overall a much better XAML experience. </p>
<li><b>AI-to-XAML maintains less path data fidelity</b> – The AI-to-XAML converts to 3 decimal places, while the native import converts to 4 decimal places. But this isn’t necessarily a bad thing. Here is a corner of Sacramento County zoomed in 6400%.</li>
<p><a href="http://www.designersilverlight.com/wp-content/uploads/2009/09/clip_image00111.png"><img style="border-bottom: 0px;border-left: 0px;border-top: 0px;border-right: 0px" border="0" alt="clip_image001[11]" src="http://www.designersilverlight.com/wp-content/uploads/2009/09/clip_image00111_thumb.png" width="144" height="90" /></a></p>
<p>Now let’s change the path data by a hundredth of a unit, from X=35.366 to X=35.376</p>
<p><a href="http://www.designersilverlight.com/wp-content/uploads/2009/09/clip_image00115.png"><img style="border-bottom: 0px;border-left: 0px;border-top: 0px;border-right: 0px" border="0" alt="clip_image001[15]" src="http://www.designersilverlight.com/wp-content/uploads/2009/09/clip_image00115_thumb.png" width="145" height="75" /></a></p>
<p>The difference is almost imperceptible… even at this level of magnification. Changing it by a thousandth of a unit is going to make almost no difference that users will be able to see.</p>
</ol>
<p><b>Conclusion:</b> I’m going to continue using Mike Swanson’s Adobe Illustrator to XAML Export plug-in because it is awesome. If you don’t have or can’t afford Adobe Illustrator, the default import isn’t bad, but it is missing a good deal of potentially valuable functionality.</p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.veracitysolutions.com/adobe-illustrator-to-xaml-conversion-options/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Creating a Programmatic Path in Silverlight (or WPF)</title>
		<link>http://blogs.veracitysolutions.com/creating-a-programmatic-path-in-silverlight-or-wpf/</link>
		<comments>http://blogs.veracitysolutions.com/creating-a-programmatic-path-in-silverlight-or-wpf/#comments</comments>
		<pubDate>Thu, 20 Aug 2009 01:59:19 +0000</pubDate>
		<dc:creator>Matthias Shapiro</dc:creator>
				<category><![CDATA[Advanced Tutorial]]></category>
		<category><![CDATA[How To...]]></category>
		<category><![CDATA[Silverlight]]></category>
		<category><![CDATA[WPF]]></category>
		<category><![CDATA[Path]]></category>
		<category><![CDATA[Programmatic Path]]></category>
		<category><![CDATA[Tutorial]]></category>

		<guid isPermaLink="false">http://blogs.veracitysolutions.com/?p=620</guid>
		<description><![CDATA[Download Project Files for Creating a Programmatic Path in Silverlight or WPF 
(Note: The project is in Silverlight, but if you copy and paste the code into a WPF project, it should work without any changes)
Have you ever wanted to create a Path programmatically or create a Path in code behind or dynamically build a [...]]]></description>
			<content:encoded><![CDATA[<p><a href='http://www.designersilverlight.com/wp-content/uploads/2009/08/ProgrammaticPathTutorial.zip'>Download Project Files for Creating a Programmatic Path in Silverlight or WPF</a> </p>
<p>(Note: The project is in Silverlight, but if you copy and paste the code into a WPF project, it should work without any changes)</p>
<p>Have you ever wanted to create a Path programmatically or create a Path in code behind or dynamically build a Path or hand code a Path in Silverlight or WPF? </p>
<p>Yes, I just said the same thing 4 different ways, but I’m trying to cast a wide net for Google to catch. One of the biggest troubles I have when I’m trying to do something new is that I don’t always know the proper terminology, so I try to think of all the ways people might want to ask the question.</p>
<p>I’ve been playing around with a good number of information visualization concepts recently and one thing that I’ve found that I needed was the ability to create a path programmatically. </p>
<p>One way to do that is to tackle and fully grok the Path data code system. (Good guides to it are <a href="http://msdn.microsoft.com/en-us/library/cc189041(VS.95).aspx">here</a> and <a href="http://www.c-sharpcorner.com/UploadFile/mahesh/PathInSL03252009005946AM/PathInSL.aspx">here</a>.) This system is really cool, but (unless I’ve missed something) they cannot be animated. </p>
<p>I wanted to build a path based off a data set, but that means that I have to build it programmatically. I didn’t find a lot of useful stuff on how to do this, so I thought I’d throw some out there.</p>
<p>First, because I’m a XAML guy, I’m going to provide a simple XAML example of a Path that can be animated:</p>
<blockquote><p><span style="color: blue">&lt;</span><span style="color: #a31515">Path </span><span style="color: red">x</span><span style="color: blue">:</span><span style="color: red">Name</span><span style="color: blue">=&quot;MyPath&quot; </span><span style="color: red">Fill</span><span style="color: blue">=&quot;#FFA30000&quot; </span><span style="color: red">Stroke</span><span style="color: blue">=&quot;Black&quot; </span><span style="color: red">Width</span><span style="color: blue">=&quot;100&quot; </span><span style="color: red">Height</span><span style="color: blue">=&quot;100&quot;&gt;     <br />&#160;&#160;&#160; &lt;</span><span style="color: #a31515">Path.Data</span><span style="color: blue">&gt;     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;</span><span style="color: #a31515">PathGeometry </span><span style="color: red">FillRule</span><span style="color: blue">=&quot;EvenOdd&quot;&gt;     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;</span><span style="color: #a31515">PathFigure </span><span style="color: red">IsClosed</span><span style="color: blue">=&quot;True&quot; </span><span style="color: red">StartPoint</span><span style="color: blue">=&quot;0,0&quot;&gt;     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;</span><span style="color: #a31515">LineSegment </span><span style="color: red">Point</span><span style="color: blue">=&quot;0,100&quot;/&gt;     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;</span><span style="color: #a31515">LineSegment </span><span style="color: red">Point</span><span style="color: blue">=&quot;100,100&quot;/&gt;     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;</span><span style="color: #a31515">LineSegment </span><span style="color: red">Point</span><span style="color: blue">=&quot;100,0&quot;/&gt;     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;/</span><span style="color: #a31515">PathFigure</span><span style="color: blue">&gt;     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;/</span><span style="color: #a31515">PathGeometry</span><span style="color: blue">&gt;     <br />&#160;&#160;&#160; &lt;/</span><span style="color: #a31515">Path.Data</span><span style="color: blue">&gt;     <br />&lt;/</span><span style="color: #a31515">Path</span><span style="color: blue">&gt;</span></p>
<p><span style="color: blue"></span> </p></blockquote>
<p>This path is a simple square and looks like this:</p>
<p><a href="http://www.designersilverlight.com/wp-content/uploads/2009/08/clip_image0012.png"><img style="border-bottom: 0px;border-left: 0px;border-top: 0px;border-right: 0px" border="0" alt="clip_image001" src="http://www.designersilverlight.com/wp-content/uploads/2009/08/clip_image001_thumb1.png" width="141" height="133" /></a></p>
<p>Now, let’s assume you want to recreate this programmatically using a collection of points that represent X,Y coordinates. If you’re using an ObservableCollection of Points (like I am) you can use the following method to return an the appropriate path.</p>
<blockquote><p><span style="color: #2b91af">Path </span>createPath(<span style="color: #2b91af">ObservableCollection</span>&lt;<span style="color: #2b91af">Point</span>&gt; rawData)    <br />{    </p>
<p>&#160;&#160;&#160; <span style="color: #2b91af">Path </span>FinalPath = <span style="color: blue">new </span><span style="color: #2b91af">Path</span>();    <br />&#160;&#160;&#160; <span style="color: #2b91af">PathGeometry </span>FinalPathGeometry = <span style="color: blue">new </span><span style="color: #2b91af">PathGeometry</span>();    <br />&#160;&#160;&#160; <span style="color: #2b91af">PathFigure </span>PrimaryFigure = <span style="color: blue">new </span><span style="color: #2b91af">PathFigure</span>();    </p>
<p>&#160;&#160;&#160; <span style="color: green">//if you want the path to be a shape, you want to close the PathFigure     <br />&#160;&#160;&#160; //&#160;&#160; that makes up the Path. If you want it to simply by a line, set      <br />&#160;&#160;&#160; //&#160;&#160; PrimaryFigure.IsClosed = false;      <br />&#160;&#160;&#160; </span>PrimaryFigure.IsClosed = <span style="color: blue">true</span>;    <br />&#160;&#160;&#160; <br />&#160;&#160;&#160; PrimaryFigure.StartPoint = rawData[0];    </p>
<p>&#160;&#160;&#160; <span style="color: #2b91af">PathSegmentCollection </span>LineSegmentCollection = <span style="color: blue">new </span><span style="color: #2b91af">PathSegmentCollection</span>();    </p>
<p>&#160;&#160;&#160; <span style="color: blue">for </span>(<span style="color: blue">int </span>i = 1; i &lt; rawData.Count; i++)    <br />&#160;&#160;&#160; {    <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; <span style="color: #2b91af">LineSegment </span>newSegment = <span style="color: blue">new </span><span style="color: #2b91af">LineSegment</span>();    <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; newSegment.Point = rawData[i];    <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; LineSegmentCollection.Add(newSegment);    <br />&#160;&#160;&#160; }    </p>
<p>&#160;&#160;&#160; PrimaryFigure.Segments = LineSegmentCollection;    <br />&#160;&#160;&#160; FinalPathGeometry.Figures.Add(PrimaryFigure);    <br />&#160;&#160;&#160; FinalPath.Data = FinalPathGeometry;    </p>
<p>&#160;&#160;&#160; <span style="color: blue">return </span>FinalPath;    <br />}</p>
</blockquote>
<p>Once you have the path in place, you can just add it to your layout and it should show up. If you’re still confused, you can download the project that I created this in and walk through the rest of it yourself. </p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.veracitysolutions.com/creating-a-programmatic-path-in-silverlight-or-wpf/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>How To Use a ListView or DataGrid In a ComboBox Drop Down (Without A Line Of Code)</title>
		<link>http://blogs.veracitysolutions.com/how-to-use-a-listview-or-datagrid-in-a-combobox-drop-down-without-a-line-of-code/</link>
		<comments>http://blogs.veracitysolutions.com/how-to-use-a-listview-or-datagrid-in-a-combobox-drop-down-without-a-line-of-code/#comments</comments>
		<pubDate>Thu, 02 Oct 2008 00:30:00 +0000</pubDate>
		<dc:creator>Matthias Shapiro</dc:creator>
				<category><![CDATA[Combobox]]></category>
		<category><![CDATA[How To...]]></category>
		<category><![CDATA[ListView]]></category>
		<category><![CDATA[Styles]]></category>
		<category><![CDATA[Templates]]></category>
		<category><![CDATA[Tutorial]]></category>
		<category><![CDATA[WPF]]></category>

		<guid isPermaLink="false">http://www.designerwpf.com/2008/10/01/how-to-use-a-listview-or-datagrid-in-a-combobox-drop-down-without-a-line-of-code/</guid>
		<description><![CDATA[Super cool new thing I learned today. In WPF, we can make it so that the drop down (popup) on a ComboBox displays the data in a ListView. Because of the fact that I believe the DataGrid will eventually overtake the ListView as the gold standard for data display in WPF, we’ll do it both [...]]]></description>
			<content:encoded><![CDATA[<p>Super cool new thing I learned today. In WPF, we can make it so that the drop down (popup) on a ComboBox displays the data in a ListView. Because of the fact that I believe the DataGrid will eventually overtake the ListView as the gold standard for data display in WPF, we’ll do it both ways.</p>
<p>This tutorial is done entirely in Blend and without a line of code.</p>
<p><strong>Step 0)</strong> (for the DataGrid only)</p>
<p>Go to Code Plex and <a href="http://www.codeplex.com/wpf/Release/ProjectReleases.aspx?ReleaseId=14963">download the WPF Toolkit</a>. Extract to a convenient location.</p>
<p>Right-Click on the References folder in your project tab and click “Add Reference…”</p>
<p><a href="http://blogs.veracitysolutions.com/wp-content/uploads/2008/10/clip-image001.png"><img src="http://blogs.veracitysolutions.com/wp-content/uploads/2008/10/clip-image001-thumb.png" title="clip_image001" style="border-width: 0px; display: inline" alt="clip_image001" border="0" height="85" width="238" /></a></p>
<p>Navigate to the location you extracted the WPFToolkit.dll file, select it and hit OK.<br />
<a href="http://blogs.veracitysolutions.com/wp-content/uploads/2008/10/clip-image0016.png"><img src="http://blogs.veracitysolutions.com/wp-content/uploads/2008/10/clip-image0016-thumb.png" title="clip_image001[6]" style="border-width: 0px; display: inline" alt="clip_image001[6]" border="0" height="205" width="177" /></a></p>
<p>Step 1) Select the ComboBox you wish to change and edit the ControlTemplate by right-clicking and selecting “Edit Control Parts (Template) –&gt; Edit a Copy…”</p>
<p><a href="http://blogs.veracitysolutions.com/wp-content/uploads/2008/10/clip-image0011.png"><img src="http://blogs.veracitysolutions.com/wp-content/uploads/2008/10/clip-image0011-thumb.png" title="clip_image001[1]" style="border: 0px none ; display: inline" alt="clip_image001[1]" border="0" height="55" width="328" /></a></p>
<p>Step 2) Find the ItemsPresenter. This is what would normally display our ItemsSource.</p>
<p><a href="http://blogs.veracitysolutions.com/wp-content/uploads/2008/10/clip-image0013.png"><img src="http://blogs.veracitysolutions.com/wp-content/uploads/2008/10/clip-image0013-thumb.png" title="clip_image001[3]" style="border: 0px none ; display: inline" alt="clip_image001[3]" border="0" height="187" width="252" /></a></p>
<p>We’re going to get rid of it. And the ScrollViewer for good measure.</p>
<p>Step 3) Where the ScrollViewer is, put in a ListView or a DataGrid, whichever one you’re using.</p>
<p><a href="http://blogs.veracitysolutions.com/wp-content/uploads/2008/10/clip-image0015.png"><img src="http://blogs.veracitysolutions.com/wp-content/uploads/2008/10/clip-image0015-thumb.png" title="clip_image001[5]" style="border: 0px none ; display: inline" alt="clip_image001[5]" border="0" height="132" width="255" /></a></p>
<p>Now, go the properties of that ListView or DataGrid and click on the box to the right of “ItemsSource”</p>
<p><a href="http://blogs.veracitysolutions.com/wp-content/uploads/2008/10/clip-image00111.png"><img src="http://blogs.veracitysolutions.com/wp-content/uploads/2008/10/clip-image00111-thumb.png" title="clip_image001[11]" style="border: 0px none ; display: inline" alt="clip_image001[11]" border="0" height="60" width="168" /></a></p>
<p>and, in the resulting menu, select “Template Binding –&gt; ItemsSource”.</p>
<p><a href="http://blogs.veracitysolutions.com/wp-content/uploads/2008/10/clip-image0017.png"><img src="http://blogs.veracitysolutions.com/wp-content/uploads/2008/10/clip-image0017-thumb.png" title="clip_image001[7]" style="border: 0px none ; display: inline" alt="clip_image001[7]" border="0" height="294" width="438" /></a></p>
<p>Set the DataContext of the ListView or DataGrid to the DataContext of the parent ComboBox using the same process.</p>
<p>And… you’re done! Open the ComboBox and you will see that you can select items in the ListView or DataGrid in the ComboBox dropdown and see those items change the selection of the ComboBox.</p>
<p><a href="http://blogs.veracitysolutions.com/wp-content/uploads/2008/10/clip-image00113.png"><img src="http://blogs.veracitysolutions.com/wp-content/uploads/2008/10/clip-image00113-thumb.png" title="clip_image001[13]" style="border: 0px none ; display: inline" alt="clip_image001[13]" border="0" height="193" width="545" /></a></p>
<p>You’ll notice that this is probably not yet an ideal solution. For example, when we select an item, the dropdown doesn’t automatically close. Your best bet is to use the SelectionChanged event to trigger some logic to close the ComboBox dropdown.</p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.veracitysolutions.com/how-to-use-a-listview-or-datagrid-in-a-combobox-drop-down-without-a-line-of-code/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Tip For Finding Resources for a Control in generic.xaml</title>
		<link>http://blogs.veracitysolutions.com/tip-for-finding-resources-for-a-control-in-genericxaml/</link>
		<comments>http://blogs.veracitysolutions.com/tip-for-finding-resources-for-a-control-in-genericxaml/#comments</comments>
		<pubDate>Wed, 27 Aug 2008 00:39:42 +0000</pubDate>
		<dc:creator>Matthias Shapiro</dc:creator>
				<category><![CDATA[Advanced Tutorial]]></category>
		<category><![CDATA[ListView]]></category>
		<category><![CDATA[Templates]]></category>
		<category><![CDATA[WPF]]></category>
		<category><![CDATA[XAML]]></category>

		<guid isPermaLink="false">http://www.designerwpf.com/2008/08/26/tip-for-finding-resources-for-a-control-in-genericxaml/</guid>
		<description><![CDATA[I&#8217;ve recently be working on changing the ControlTemplate of a GridViewColumnHeader in a custom ListView that we&#8217;ve been working on. (The ListView was rewritten for sorting, so that&#8217;s why it had to be custom.)
One of the things we had to do was swap out ControlTemplates so that we could display a caret to indicate ascending [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve recently be working on changing the ControlTemplate of a GridViewColumnHeader in a custom ListView that we&#8217;ve been working on. (The ListView was rewritten for sorting, so that&#8217;s why it had to be custom.)</p>
<p>One of the things we had to do was swap out ControlTemplates so that we could display a caret to indicate ascending or descending lists. We ended up deciding on ControlTemplates over DataTemplates because the DataTemplates would only work for ListViews that had no custom DataTemplates for the headers. We&#8217;re doing all sorts of crazy stuff with our headers and we need to preserve our DataTemplates, so this wasn&#8217;t an option. </p>
<p>In any case, I was having no luck finding the resource when I named it this way:</p>
<blockquote><p><span style="color: blue">&lt;</span><span style="color: #a31515">ControlTemplate </span><span style="color: red">x</span><span style="color: blue">:</span><span style="color: red">Key</span><span style="color: blue">=&quot;MyCustomControlTemplate&quot; <span style="color: red">TargetType</span><span style="color: blue">=&quot;{</span><span style="color: #a31515">x</span><span style="color: blue">:</span><span style="color: #a31515">Type </span><span style="color: red">GridViewColumnHeader</span><span style="color: blue">}&quot;&gt;</span></span></p>
</blockquote>
<p> <a href="http://11011.net/software/vspaste"></a>
<p>I was using the following code to try and find the resource.</p>
<blockquote><p><span style="color: #2b91af">ControlTemplate </span>myNewTemplate = (<span style="color: #2b91af">ControlTemplate</span>)Resources[<span style="color: #a31515">&quot;MyCustomTemplate&quot;</span>];</p>
</blockquote>
<p> <a href="http://11011.net/software/vspaste"></a>
<p>However, we were able to solve the problem by naming the resource this way</p>
<blockquote><p><span style="color: blue">&lt;</span><span style="color: #a31515">ControlTemplate </span><span style="color: red">x</span><span style="color: blue">:</span><span style="color: red">Key</span><span style="color: blue">=&quot;{</span><span style="color: #a31515">ComponentResourceKey </span><span style="color: red">TypeInTargetAssembly</span><span style="color: blue">={</span><span style="color: #a31515">x</span><span style="color: blue">:</span><span style="color: #a31515">Type </span><span style="color: red">local</span><span style="color: blue">:</span><span style="color: red">MyCustomListView</span><span style="color: blue">}, </span><span style="color: red">ResourceId</span><span style="color: blue">=MyCustomControlTemplate}&quot;       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span><span style="color: blue"><span style="color: red">TargetType</span><span style="color: blue">=&quot;{</span><span style="color: #a31515">x</span><span style="color: blue">:</span><span style="color: #a31515">Type </span><span style="color: red">GridViewColumnHeader</span><span style="color: blue">}&quot;&gt;</span></span></p>
<p>   <a href="http://11011.net/software/vspaste"></a></p></blockquote>
<p> <a href="http://11011.net/software/vspaste"></a>
<p>And then using this code to access it.</p>
<blockquote><p><span style="color: #2b91af">ComponentResourceKey </span>myCustomTemplateKey = <span style="color: blue">new </span><span style="color: #2b91af">ComponentResourceKey</span>(<span style="color: blue">typeof</span>(<span style="color: #2b91af">SortableListView</span>), <span style="color: #a31515">&quot;MyCustomTemplate&quot;</span>);      <br /><span style="color: #2b91af">ControlTemplate </span>myNewTemplate = (<span style="color: #2b91af">ControlTemplate</span>)<span style="color: blue">this</span>.TryFindResource(myCustomTemplateKey);</p>
</blockquote>
<p> <a href="http://11011.net/software/vspaste"></a>
<p>Just thought I&#8217;d pass it along.</p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.veracitysolutions.com/tip-for-finding-resources-for-a-control-in-genericxaml/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>How to Assign ColumnHeaderContainerStyle and ColumnHeaderTemplate to a ListView Style</title>
		<link>http://blogs.veracitysolutions.com/how-to-assign-columnheadercontainerstyle-and-columnheadertemplate-to-a-listview-style/</link>
		<comments>http://blogs.veracitysolutions.com/how-to-assign-columnheadercontainerstyle-and-columnheadertemplate-to-a-listview-style/#comments</comments>
		<pubDate>Fri, 15 Aug 2008 23:06:06 +0000</pubDate>
		<dc:creator>Matthias Shapiro</dc:creator>
				<category><![CDATA[How To...]]></category>
		<category><![CDATA[ListView]]></category>
		<category><![CDATA[Styles]]></category>
		<category><![CDATA[Templates]]></category>
		<category><![CDATA[WPF]]></category>
		<category><![CDATA[XAML]]></category>
		<category><![CDATA[columnheadercontainerstyle]]></category>
		<category><![CDATA[columnheadertemplate]]></category>
		<category><![CDATA[GridView]]></category>
		<category><![CDATA[style]]></category>

		<guid isPermaLink="false">http://www.designerwpf.com/2008/08/15/how-to-assign-columnheadercontainerstyle-and-columnheadertemplate-to-a-listview-style/</guid>
		<description><![CDATA[This is just a quick note on creating a ListView style with the appropriate GridView style and template assignments.
Normally, I&#8217;ve been creating listviews that look like this:


&#60;ListView x:Name=&#8221;MyListView&#8221;
               ItemContainerStyle=&#8221;{DynamicResource MyListViewItemContainerStyle}&#8221;&#62;
    &#60;ListView.View&#62;
         &#60;GridView ColumnHeaderContainerStyle=&#8221;{DynamicResource MyListViewHeaderStyle}&#8221;
                         ColumnHeaderTemplate=&#8221;{DynamicResource MyGridColumnHeaderTemplate}&#8221;&#62; 
I did this because I didn&#8217;t know exactly how to assign these styles and templates to the ListView Style. In [...]]]></description>
			<content:encoded><![CDATA[<p>This is just a quick note on creating a ListView style with the appropriate GridView style and template assignments.</p>
<p>Normally, I&#8217;ve been creating listviews that look like this:</p>
<blockquote>
<pre class="code"><span style="color: blue"></span></pre>
<p><span style="color: blue">&lt;</span><span style="color: #a31515">ListView </span><span style="color: red">x</span><span style="color: blue">:</span><span style="color: red">Name</span><span style="color: blue">=&#8221;MyListView&#8221;</span><span style="color: red"><br />
               ItemContainerStyle</span><span style="color: blue">=&#8221;{</span><span style="color: #a31515">DynamicResource </span><span style="color: red">MyListViewItemContainerStyle</span><span style="color: blue">}&#8221;&gt;<br />
    </span><span style="color: blue">&lt;</span><span style="color: #a31515">ListView.View</span><span style="color: blue">&gt;<br />
         </span><span style="color: blue"><span style="color: blue">&lt;</span><span style="color: #a31515">GridView </span><span style="color: red">ColumnHeaderContainerStyle</span><span style="color: blue">=&#8221;{</span><span style="color: #a31515">DynamicResource </span><span style="color: red">MyListViewHeaderStyle</span><span style="color: blue">}&#8221;<br />
                         </span></span><span style="color: blue"><span style="color: red">ColumnHeaderTemplate</span><span style="color: blue">=&#8221;{</span><span style="color: #a31515">DynamicResource </span><span style="color: red">MyGridColumnHeaderTemplate</span><span style="color: blue">}&#8221;&gt;</span></span><span style="color: blue"> </span></p></blockquote>
<p><span style="color: blue"><font color="#000000">I did this because I didn&#8217;t know exactly how to assign these styles and templates to the ListView Style. In the style, ColumnHeaderContainerStyle and ColumnHeaderTemplate are not properties of the ListView, they are properties of the GridView&#8230; which you can&#8217;t create a style for.</font></span></p>
<p><span style="color: blue"><font color="#000000">Instead, you can encapsulate all the information above in the following style.</font></span></p>
<blockquote><p><span style="color: blue">&lt;</span><span style="color: #a31515">Style </span><span style="color: red">x</span><span style="color: blue">:</span><span style="color: red">Key</span><span style="color: blue">=&#8221;CustomListViewStyle&#8221; </span><span style="color: red">TargetType</span><span style="color: blue">=&#8221;{</span><span style="color: #a31515">x</span><span style="color: blue">:</span><span style="color: #a31515">Type </span><span style="color: red">ListView</span><span style="color: blue">}&#8221;&gt;<br />
      &lt;</span><span style="color: #a31515">Setter </span><span style="color: red">Property</span><span style="color: blue">=&#8221;GridView.ColumnHeaderContainerStyle&#8221; </span><span style="color: red">Value</span><span style="color: blue">=&#8221;{</span><span style="color: #a31515">DynamicResource </span><span style="color: red">MyListViewHeaderStyle</span><span style="color: blue">}&#8221; /&gt;<br />
      </span><span style="color: blue">&lt;</span><span style="color: #a31515">Setter </span><span style="color: red">Property</span><span style="color: blue">=&#8221;GridView.ColumnHeaderTemplate&#8221; </span><span style="color: red">Value</span><span style="color: blue">=&#8221;{</span><span style="color: #a31515">DynamicResource </span><span style="color: red">MyGridColumnHeaderTemplate</span><span style="color: blue">}&#8221; /&gt;<br />
      </span><span style="color: blue">&lt;</span><span style="color: #a31515">Setter </span><span style="color: red">Property</span><span style="color: blue">=&#8221;ItemContainerStyle&#8221; </span><span style="color: red">Value</span><span style="color: blue">=&#8221;{</span><span style="color: #a31515">DynamicResource </span><span style="color: red">MyListViewItemContainerStyle</span><span style="color: blue">}&#8221; /&gt;<br />
<span style="color: blue">&lt;/</span><span style="color: #a31515">Style&gt;</span></span></p></blockquote>
<p><a href="http://11011.net/software/vspaste"></a></p>
<p><span style="color: blue"><font color="#000000">Problem solved.</font></span></p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.veracitysolutions.com/how-to-assign-columnheadercontainerstyle-and-columnheadertemplate-to-a-listview-style/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Styling the ScrollViewer</title>
		<link>http://blogs.veracitysolutions.com/styling-the-scrollviewer/</link>
		<comments>http://blogs.veracitysolutions.com/styling-the-scrollviewer/#comments</comments>
		<pubDate>Thu, 07 Aug 2008 23:43:26 +0000</pubDate>
		<dc:creator>Matthias Shapiro</dc:creator>
				<category><![CDATA[Blend]]></category>
		<category><![CDATA[How To...]]></category>
		<category><![CDATA[ScrollViewer]]></category>
		<category><![CDATA[Tutorial]]></category>
		<category><![CDATA[WPF]]></category>
		<category><![CDATA[WPF Designer Guides]]></category>

		<guid isPermaLink="false">http://www.designerwpf.com/2008/08/07/styling-the-scrollviewer/</guid>
		<description><![CDATA[I recently got a comment asking if I could do something on creating a Blend-type ScollViewer styling. The only problem is that the ScrollViewer is a multi-post affair, which I&#8217;ll try to get completed in the next month or so. I&#8217;m going to go ahead and put up the basics here, much like my Styling [...]]]></description>
			<content:encoded><![CDATA[<p>I recently got a comment asking if I could do something on creating a Blend-type ScollViewer styling. The only problem is that the ScrollViewer is a multi-post affair, which I&#8217;ll try to get completed in the next month or so. I&#8217;m going to go ahead and put up the basics here, much like my <a href="http://www.designerwpf.com/2008/02/07/the-wpf-designers-guide-to-styling-the-combobox/">Styling the ComboBox</a> and <a href="http://www.designerwpf.com/2007/12/06/the-wpf-designers-guide-to-styling-the-your-favorite-adjectival-swear-word-here-listview/">Styling the ListView</a> posts.</p>
<p>In the meantime, I&#8217;m making available for download a <a href="http://www.designerwpf.com/wp-content/uploads/2008/08/blendscrolldictionary.xaml">Resource Dictionary with the Blend ScrollViewer</a> style as I&#8217;ve approximated it. (You may have to right-click &#8220;Save As&#8230;&#8221; on that file since IE will do its darndest to open it up.) Just load the resource dictionary into your project and set</p>
<p><span style="color: blue">&lt;</span><span style="color: #a31515">ScrollViewer </span><span style="color: red">Template</span><span style="color: blue">=&#8221;{</span><span style="color: #a31515">DynamicResource </span><span style="color: red">BlendScrollTemplate</span><span style="color: blue">}&#8221; /&gt;</span></p>
<p>Note: This is not the &#8220;real&#8221; Blend styles&#8230; just my rendition/approximation.</p>
<p><a href="http://11011.net/software/vspaste"></a></p>
<p>In the meantime, here&#8217;s the overview for the ScrollViewer. When you look at a template of the ScrollViewer (right-click on the ScrollViewer, got to &#8220;<strong>Edit Control Parts (Template) -&gt; Edit a Copy&#8230;</strong>&#8220;) you should see something like this:</p>
<p><a href="http://www.designerwpf.com/wp-content/uploads/2008/08/clip-image0017.png"><img src="http://www.designerwpf.com/wp-content/uploads/2008/08/clip-image0017-thumb.png" style="border: 0px none " alt="clip_image001[7]" width="255" border="0" height="172" /></a></p>
<p>If you want to change something about the main content area (highlighted below), you&#8217;re probably going after the <strong>PART_ScrollContentPresenter</strong></p>
<p><a href="http://www.designerwpf.com/wp-content/uploads/2008/08/clip-image00111.png"><img src="http://www.designerwpf.com/wp-content/uploads/2008/08/clip-image00111-thumb.png" style="border: 0px none " alt="clip_image001[11]" width="259" border="0" height="146" /></a></p>
<p>If you want to style the corner (highlighted below), look at changing the <strong>Corner Rectangle</strong>.</p>
<p><a href="http://www.designerwpf.com/wp-content/uploads/2008/08/clip-image00115.png"><img src="http://www.designerwpf.com/wp-content/uploads/2008/08/clip-image00115-thumb.png" style="border: 0px none " alt="clip_image001[15]" width="260" border="0" height="144" /></a></p>
<p>If you want to style the <strong>HorizontalScrollBar</strong> and/or the <strong>VerticalScrollBar</strong> (highlighted below), you should right-click on either the <strong>PART_VerticalScrollBar</strong> or the <strong>PART_HorizontalScrollBar</strong> and go to &#8220;<strong>Edit Control Parts (Template) -&gt; Edit a Copy&#8230;</strong>&#8221;</p>
<p><a href="http://www.designerwpf.com/wp-content/uploads/2008/08/clip-image00113.png"><img src="http://www.designerwpf.com/wp-content/uploads/2008/08/clip-image00113-thumb.png" style="border: 0px none " alt="clip_image001[13]" width="262" border="0" height="146" /></a></p>
<p>A point of note: Because of the way Blend works, it can be difficult to visually style a Vertical and Horizontal ScrollBar in the same Template. Don&#8217;t create another template. It&#8217;s a waste of time and will make your resources a pain to navigate. I&#8217;ll go over exactly what to do in a little bit.</p>
<p>The ScrollBar template should look something like this:</p>
<p><a href="http://www.designerwpf.com/wp-content/uploads/2008/08/clip-image0019.png"><img src="http://www.designerwpf.com/wp-content/uploads/2008/08/clip-image0019-thumb.png" style="border: 0px none " alt="clip_image001[9]" width="252" border="0" height="231" /></a></p>
<p>If you want to style the <strong>ScrollBar thumbs</strong> (the bars you would drag to scroll, highlighted below), you&#8217;ll need to change the template for the &#8220;<strong>Thumb</strong>&#8221; in the <strong>PART_Track</strong>. Note: Unless you&#8217;re doing something really complex, you should only need to style the Thumb control one time. You don&#8217;t need different styles for the vertical and the horizontal.</p>
<p><a href="http://www.designerwpf.com/wp-content/uploads/2008/08/clip-image00117.png"><img src="http://www.designerwpf.com/wp-content/uploads/2008/08/clip-image00117-thumb.png" style="border: 0px none " alt="clip_image001[17]" width="258" border="0" height="144" /></a></p>
<p>If you want to style the directional buttons (highlighted below), you will need to change the templates for the first and last &#8220;<strong>RepeatButton</strong>&#8221; controls (the ones that aren&#8217;t in the PART_Track) using the <strong>right-click -&gt; Edit Control Parts (Template) -&gt; Edit Template</strong>. (This template should already be copied into your resources.) Again, unless you&#8217;re doing something complex, you should only need to style this button one time.</p>
<p><a href="http://www.designerwpf.com/wp-content/uploads/2008/08/clip-image00119.png"><img src="http://www.designerwpf.com/wp-content/uploads/2008/08/clip-image00119-thumb.png" style="border: 0px none " alt="clip_image001[19]" width="258" border="0" height="148" /></a></p>
<p>If you want to style the empty area that allows for fast scrolling, you will need to change the style for the two RepeatButtons in the <strong>PART_Track</strong> (<strong>DecreaseRepeatButton</strong> and <strong>IncreaseRepeatButton</strong>)using the <strong>right-click -&gt; Edit Control Parts (Template) -&gt; Edit Template</strong>. You should only need to do this one time and then apply that style/template across the all the instances of this button.</p>
<p><img src="http://www.designerwpf.com/wp-content/uploads/2008/08/clip-image00121-thumb.png" style="border: 0px none " alt="clip_image001[21]" width="258" border="0" height="144" /></p>
<p>Over the next couple weeks, I&#8217;ll try to put up posts going over how to style all of these into the Blend style. I&#8217;ll update this post pointing to the more in-depth tutorials as I go along. Until I get around to doing that, feel free to download the <a href="http://www.designerwpf.com/wp-content/uploads/2008/08/blendscrolldictionary.xaml">ResourceDictionary with the Blend styles</a> in them.</p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.veracitysolutions.com/styling-the-scrollviewer/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Clicking or DoubleClicking on an Item in a ListView</title>
		<link>http://blogs.veracitysolutions.com/clicking-or-doubleclicking-on-an-item-in-a-listview/</link>
		<comments>http://blogs.veracitysolutions.com/clicking-or-doubleclicking-on-an-item-in-a-listview/#comments</comments>
		<pubDate>Tue, 15 Jul 2008 21:58:13 +0000</pubDate>
		<dc:creator>Matthias Shapiro</dc:creator>
				<category><![CDATA[Helpful Links]]></category>
		<category><![CDATA[WPF]]></category>

		<guid isPermaLink="false">http://www.designerwpf.com/2008/07/15/clicking-or-doubleclicking-on-an-item-in-a-listview/</guid>
		<description><![CDATA[This is little more than a pointer to a fantastic post by Mike over at Mike&#8217;s Code Blog, but I figured it was worth passing along. Mike&#8217;s post is focused on finding which item was double clicked, while mine is on determining when the double clicking happened on an item at all.
 I&#8217;ve recently come up against a problem [...]]]></description>
			<content:encoded><![CDATA[<p>This is little more than a pointer to a fantastic post by Mike over at <a href="http://mikescodeblog.blogspot.com/2007/12/wpf-listview-getting-clicked-item.html">Mike&#8217;s Code Blog</a>, but I figured it was worth passing along. Mike&#8217;s post is focused on finding which item was double clicked, while mine is on determining when the double clicking happened on an item at all.</p>
<p> I&#8217;ve recently come up against a problem in which we were attaching a doubleclick event to our listview, only to discover it fires when we did something like click on the scrollbar quickly. Since we only wanted it to fire when we were double clicking on the listview item, we had to come up with some way of figuring out where in the listview the user had clicked.</p>
<p>Mike&#8217;s code made it easy&#8230; I&#8217;m reproducing our permutation of it here:</p>
<p>First, we put our event pointer in the XAML like so:</p>
<p><font size="2" color="#0000ff">&lt;<font size="2" color="#a31515">ListView </font><font size="2" color="#ff0000">MouseDoubleClick</font><font size="2" color="#0000ff">=&#8221;ListViewDoubleClick&#8221;&gt;</font></p>
<p></font></p>
<p>Then we put this in the code behind:<font size="2" color="#000000"><font size="2" color="#0000ff"><font size="2" color="#0000ff"></p>
<p>protected</font><font size="2" color="#000000"> </font><font size="2" color="#0000ff">void</font><font size="2" color="#000000"> ListView_MouseDoubleClick(</font><font size="2" color="#0000ff">object</font><font size="2" color="#000000"> sender, </font><font size="2" color="#2b91af">RoutedEventArgs</font><font size="2"><font color="#000000"> e)<br />
</font>{<br />
<font color="#008000">     </font></font></font></font><font size="2" color="#000000"><font color="#008000">//grab the original element that was doubleclicked on and search from child to parent until<br />
    //you find either a ListViewItem or the top of the tree</font><br />
    <font size="2" color="#2b91af">DependencyObject</font><font size="2" color="#000000"> originalSource = (</font><font size="2" color="#2b91af">DependencyObject</font><font size="2"><font color="#000000">)e.OriginalSource;<br />
    </font></font><font size="2" color="#0000ff">while</font><font size="2"> ((originalSource != </font><font size="2" color="#0000ff">null</font><font size="2">) &amp;&amp; !(originalSource </font><font size="2" color="#0000ff">is</font><font size="2"> </font><font size="2" color="#2b91af">ListViewItem</font><font size="2">))<br />
     {<br />
          originalSource = </font><font size="2" color="#2b91af">VisualTreeHelper</font><font size="2">.GetParent(originalSource);<br />
     }<br />
      <font color="#008000"> //if it didn&#8217;t find a ListViewItem anywhere in the hierarch, it&#8217;s because the user<br />
      //didn&#8217;t click on one. Therefore, if the variable isn&#8217;t null, run the code</font><br />
      <font size="2" color="#0000ff">if</font><font size="2"> (originalSource != </font><font size="2" color="#0000ff">null</font><font size="2">)<br />
      </font></font></font><font size="2" color="#000000"><font size="2"><font size="2">{<br />
         <font color="#008000">//code here<br />
</font>      }<br />
}</font></font></font> </p>
<p>That&#8217;s it!</p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.veracitysolutions.com/clicking-or-doubleclicking-on-an-item-in-a-listview/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How Do I Make a ListView or a ScrollViewer Left Handed?</title>
		<link>http://blogs.veracitysolutions.com/how-do-i-make-a-listview-or-a-scrollviewer-left-handed/</link>
		<comments>http://blogs.veracitysolutions.com/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[ListView]]></category>
		<category><![CDATA[ScrollViewer]]></category>
		<category><![CDATA[Tutorial]]></category>
		<category><![CDATA[WPF]]></category>
		<category><![CDATA[XAML]]></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">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://blogs.veracitysolutions.com/how-do-i-make-a-listview-or-a-scrollviewer-left-handed/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
