<?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; ScrollViewer</title>
	<atom:link href="http://blogs.veracitysolutions.com/category/scrollviewer/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>Styling a Silverlight ScrollViewer (to Look Like a Mac ScrollViewer)</title>
		<link>http://blogs.veracitysolutions.com/styling-a-silverlight-scrollviewer-to-look-like-a-mac-scrollviewer/</link>
		<comments>http://blogs.veracitysolutions.com/styling-a-silverlight-scrollviewer-to-look-like-a-mac-scrollviewer/#comments</comments>
		<pubDate>Wed, 27 Aug 2008 04:04:47 +0000</pubDate>
		<dc:creator>Matthias Shapiro</dc:creator>
				<category><![CDATA[ScrollViewer]]></category>
		<category><![CDATA[Silverlight]]></category>
		<category><![CDATA[Styles]]></category>
		<category><![CDATA[Templates]]></category>
		<category><![CDATA[Tutorial]]></category>
		<category><![CDATA[XAML]]></category>

		<guid isPermaLink="false">http://www.designerwpf.com/2008/08/26/styling-a-silverlight-scrollviewer-to-look-like-a-mac-scrollviewer/</guid>
		<description><![CDATA[Update: Project files for the Silverlight Mac ScrollViewer have been uploaded.
 Just because we&#8217;re working in Microsoft technologies doesn&#8217;t mean we can&#8217;t throw a bone to our Mac friends. After all, they are the people we love, our cousins and our neighbors, and that irritating guy who is dating our daughter and can&#8217;t seem to shut up [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Update:</strong> Project files for the <a href="http://www.designerwpf.com/wp-content/uploads/2008/09/macscrollviewer.zip" title="Silverlight Mac ScrollViewer">Silverlight Mac ScrollViewer have been uploaded</a>.</p>
<p> Just because we&#8217;re working in Microsoft technologies doesn&#8217;t mean we can&#8217;t throw a bone to our Mac friends. After all, they are the people we love, our cousins and our neighbors, and that irritating guy who is dating our daughter and can&#8217;t seem to shut up about how awesome his Mac is even though he&#8217;ll be long out of his program in musical costume design before he ever pays off his laptop &#8230;</p>
<p>Issues? I don&#8217;t have issues. Why do you ask?</p>
<p>Anyway, since Silverlight is a semi-ubiquitous technology, it would be nice if we could cater to all platforms and not make anyone feel left out. And nothing makes people feel more left out than when they expect their application to work one way and it doesn&#8217;t.</p>
<p>So, here&#8217;s a picture of what we&#8217;re going for.</p>
<p><a href="http://www.designerwpf.com/wp-content/uploads/2008/08/clip-image0012.png"><img border="0" width="181" src="http://www.designerwpf.com/wp-content/uploads/2008/08/clip-image001-thumb1.png" alt="clip_image001" height="156" style="border: 0px" /></a></p>
<p>As far as I&#8217;m concerned (and therefore as far as this tutorial is concerned) the important stuff is to make sure that the incremental buttons (the arrow buttons in the bottom right) are in the right place. We can deal with the color later.</p>
<p>OK, so let create our ScrollViewer (I&#8217;ll be using Blend exclusively for this). I tossed a button in it and made it small so we can see both of the ScrollBars.</p>
<p><a href="http://www.designerwpf.com/wp-content/uploads/2008/08/clip-image0014.png"><img border="0" width="213" src="http://www.designerwpf.com/wp-content/uploads/2008/08/clip-image0014-thumb.png" alt="clip_image001[4]" height="160" style="border: 0px" /></a></p>
<p>Right click on the ScrollViewer in the &#8220;Objects and Timeline&#8221; section and go down to &#8220;Edit Control Parts (Template) -&gt; Edit a Copy&#8230;&#8221;</p>
<p><a href="http://www.designerwpf.com/wp-content/uploads/2008/08/clip-image0016.png"><img border="0" width="330" src="http://www.designerwpf.com/wp-content/uploads/2008/08/clip-image0016-thumb.png" alt="clip_image001[6]" height="101" style="border: 0px" /></a></p>
<p>You should have something that looks like this:</p>
<p><a href="http://www.designerwpf.com/wp-content/uploads/2008/08/clip-image0018.png"><img border="0" width="249" src="http://www.designerwpf.com/wp-content/uploads/2008/08/clip-image0018-thumb.png" alt="clip_image001[8]" height="149" style="border: 0px" /></a></p>
<p>Let&#8217;s do the VerticalScrollBar first. Right click on it and go to &#8220;Edit Control Parts (Template) -&gt; Edit a Copy&#8230;&#8221; Name it something memorable and you should get something like this:</p>
<p><a href="http://www.designerwpf.com/wp-content/uploads/2008/08/clip-image001121.png"><img border="0" width="254" src="http://www.designerwpf.com/wp-content/uploads/2008/08/clip-image00112-thumb1.png" alt="clip_image001[12]" height="252" style="border: 0px" /></a></p>
<p>This is actually easier than it looks. The unnamed rectangles and the path lay down the basic visual backbone for the ScrollBar and the rest of it runs like this:<br />
<a href="http://www.designerwpf.com/wp-content/uploads/2008/08/clip-image001141.png"><img border="0" width="45" src="http://www.designerwpf.com/wp-content/uploads/2008/08/clip-image00114-thumb1.png" alt="clip_image001[14]" height="37" style="border: 0px" /></a><br />
VerticalSmallDecrease &#8211; The up button<br />
VerticalLargeDecrease &#8211; The space between the up button and the VerticalThumb<br />
<a href="http://www.designerwpf.com/wp-content/uploads/2008/08/clip-image00116.png"><img border="0" width="45" src="http://www.designerwpf.com/wp-content/uploads/2008/08/clip-image00116-thumb1.png" alt="clip_image001[16]" height="104" style="border: 0px" /></a><br />
VerticalThumb &#8211; The interface element that allows the dragging interaction of the scrollbar<br />
VerticalLargeIncrease &#8211; The space between the down button and the VerticalThumb<br />
<a href="http://www.designerwpf.com/wp-content/uploads/2008/08/clip-image001181.png"><img border="0" width="46" src="http://www.designerwpf.com/wp-content/uploads/2008/08/clip-image00118-thumb1.png" alt="clip_image001[18]" height="30" style="border: 0px" /></a><br />
VerticalSmallIncrease &#8211; The down button</p>
<p>The horizontal root in this template is strikingly similar.</p>
<p>So, let&#8217;s start by moving the VerticalSmallDecrease button down to the bottom above the VerticalSmallIncrease button. The magic here will happen in the VerticalRoot grid. (I highly recommend the Design/XAML split view for this one.) In the design view, our grid looks like this:</p>
<p><a href="http://www.designerwpf.com/wp-content/uploads/2008/08/clip-image001201.png"><img border="0" width="103" src="http://www.designerwpf.com/wp-content/uploads/2008/08/clip-image00120-thumb1.png" alt="clip_image001[20]" height="277" style="border: 0px" /></a></p>
<p>Ugly. However, in the XAML, it looks like this:</p>
<p><span style="color: blue">&lt;</span><span style="color: #a31515">Grid.RowDefinitions</span><span style="color: blue">&gt;<br />
      &lt;</span><span style="color: #a31515">RowDefinition </span><span style="color: red">Height</span><span style="color: blue">=&#8221;Auto&#8221;/&gt;<br />
</span>      <span style="color: blue">&lt;</span><span style="color: #a31515">RowDefinition </span><span style="color: red">Height</span><span style="color: blue">=&#8221;Auto&#8221;/&gt;<br />
      &lt;</span><span style="color: #a31515">RowDefinition </span><span style="color: red">Height</span><span style="color: blue">=&#8221;Auto&#8221;/&gt;<br />
      &lt;</span><span style="color: #a31515">RowDefinition </span><span style="color: red">Height</span><span style="color: blue">=&#8221;*&#8221;/&gt;<br />
      &lt;</span><span style="color: #a31515">RowDefinition </span><span style="color: red">Height</span><span style="color: blue">=&#8221;Auto&#8221;/&gt;<br />
&lt;/</span><span style="color: #a31515">Grid.RowDefinitions</span><span style="color: blue">&gt;<br />
&lt;</span><span style="color: #a31515">Grid.ColumnDefinitions</span><span style="color: blue">&gt;<br />
      &lt;</span><span style="color: #a31515">ColumnDefinition</span><span style="color: blue">/&gt;<br />
      &lt;</span><span style="color: #a31515">ColumnDefinition</span><span style="color: blue">/&gt;<br />
&lt;/</span><span style="color: #a31515">Grid.ColumnDefinitions</span><span style="color: blue">&gt;</span></p>
<p><a href="http://11011.net/software/vspaste"></a></p>
<p>Much easier. For the purposes of maintaining a coherent structure, drag the VerticalSmallDecrease in Objects and Timeline pane until it is between the VerticalSmallIncrease and the VerticalLargeIncrease. Next, change the third RowDefinition to &#8220;*&#8221;. You can do this in the XAML or by clicking on the &#8220;Auto&#8221; icon<a href="http://www.designerwpf.com/wp-content/uploads/2008/08/image.png"><img border="0" width="19" src="http://www.designerwpf.com/wp-content/uploads/2008/08/image-thumb.png" alt="image" height="18" style="border: 0px" /></a> until it becomes a &#8220;*&#8221; icon. <a href="http://www.designerwpf.com/wp-content/uploads/2008/08/image1.png"><img border="0" width="22" src="http://www.designerwpf.com/wp-content/uploads/2008/08/image-thumb1.png" alt="image" height="19" style="border: 0px" /></a> Change the fourth RowDefinition from &#8220;*&#8221; to &#8220;Auto&#8221;. When you do this, it won&#8217;t immediately act like an &#8220;Auto&#8221;. This is because Blend gives it an automatic &#8220;MinHeight&#8221; of whatever the current Height is. You can change that in the XAML (easiest move) or you can highlight that row by clicking just below the &#8220;Auto&#8221; icon until the row highlights in a semitransparent gray like so.</p>
<p><a href="http://www.designerwpf.com/wp-content/uploads/2008/08/clip-image001281.png"><img border="0" width="90" src="http://www.designerwpf.com/wp-content/uploads/2008/08/clip-image00128-thumb1.png" alt="clip_image001[28]" height="82" style="border: 0px" /></a></p>
<p>You may need to zoom in to do this. Once highlighted, the properties of the Row will show up in the Properties tab on the right. Change the MinHeight to 0.</p>
<p><a href="http://www.designerwpf.com/wp-content/uploads/2008/08/clip-image00132.png"><img border="0" width="286" src="http://www.designerwpf.com/wp-content/uploads/2008/08/clip-image00132-thumb.png" alt="clip_image001[32]" height="128" style="border: 0px" /></a></p>
<p>Now we&#8217;ll need to change the Grid.Row properties of almost everything. Click on the items in the Objects and Timeline and change the Row property in the Layout section of the Properties tab like so:</p>
<p>VerticalLargeDecrease -&gt; Row = 0<br />
VerticalThumb -&gt; Row = 1<br />
VerticalLargeIncrease -&gt; Row = 2<br />
VerticalSmallDecrease -&gt; Row = 3<br />
VerticalSmallIncrease -&gt; Row = 4</p>
<p>You&#8217;re done. With the Vertical part of the ScrollBar at least. You can do the same thing with the Horizontal part of it. Just move around the buttons, change the ColumnDefinitions and update the Column assignments. My best recommendation is to go back to the ScrollViewer template and assign your new ScrollBar template to the HorizontalScrollBar and then go back to editing the template from there.</p>
<p><a href="http://www.designerwpf.com/wp-content/uploads/2008/08/clip-image00134.png"><img border="0" width="447" src="http://www.designerwpf.com/wp-content/uploads/2008/08/clip-image00134-thumb.png" alt="clip_image001[34]" height="118" style="border: 0px" /></a></p>
<h2>Later on&#8230;</h2>
<p>After a bunch of color tweaking, I have a scroll viewer in silverlight that looks like this:</p>
<p><a href="http://www.designerwpf.com/wp-content/uploads/2008/08/clip-image00136.png"><img border="0" width="44" src="http://www.designerwpf.com/wp-content/uploads/2008/08/clip-image00136-thumb.png" alt="clip_image001[36]" height="246" style="border: 0px" /></a></p>
<p>I&#8217;m feeling OK with it. I&#8217;ve embedded what I have at this point below.</p>
<p><iframe scrolling="no" frameBorder="0" src="http://silverlight.services.live.com/invoke/77530/MacScrollViewer/iframe.html" style="width: 400px; height: 300px"></iframe></p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.veracitysolutions.com/styling-a-silverlight-scrollviewer-to-look-like-a-mac-scrollviewer/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>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>
