<?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; styling</title>
	<atom:link href="http://blogs.veracitysolutions.com/tag/styling/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 ComboBox In Silverlight 3</title>
		<link>http://blogs.veracitysolutions.com/styling-a-combobox-in-silverlight-3/</link>
		<comments>http://blogs.veracitysolutions.com/styling-a-combobox-in-silverlight-3/#comments</comments>
		<pubDate>Tue, 18 Aug 2009 15:24:56 +0000</pubDate>
		<dc:creator>Matthias Shapiro</dc:creator>
				<category><![CDATA[Combobox]]></category>
		<category><![CDATA[Silverlight]]></category>
		<category><![CDATA[Styles]]></category>
		<category><![CDATA[Silverlight 3]]></category>
		<category><![CDATA[styling]]></category>

		<guid isPermaLink="false">http://blogs.veracitysolutions.com/?p=590</guid>
		<description><![CDATA[Download ComboBox Styling Project Files
This post is meant to be a center point for topics related to styling the Silverlight 3 ComboBox. It will go over the basic about ComboBox styling and will also get updated with links to tutorials about common design problems with the ComboBox. 
So, let’s get started…
If you want to change [...]]]></description>
			<content:encoded><![CDATA[<p><a href='http://www.designersilverlight.com/wp-content/uploads/2009/08/comboboxstylingbasics.zip'>Download ComboBox Styling Project Files</a></p>
<p>This post is meant to be a center point for topics related to styling the Silverlight 3 ComboBox. It will go over the basic about ComboBox styling and will also get updated with links to tutorials about common design problems with the ComboBox. </p>
<p>So, let’s get started…</p>
<p>If you want to change the look of the main ComboBox or the ComboBox drop down (popup), </p>
<p><a href="http://www.designersilverlight.com/wp-content/uploads/2009/08/clip-image0016.png"><img style="border-right-width: 0px;border-top-width: 0px;border-bottom-width: 0px;border-left-width: 0px" border="0" alt="clip_image001[6]" src="http://www.designersilverlight.com/wp-content/uploads/2009/08/clip-image0016-thumb.png" width="162" height="50" /></a></p>
<p><a href="http://www.designersilverlight.com/wp-content/uploads/2009/08/clip-image0014.png"><img style="border-right-width: 0px;border-top-width: 0px;border-bottom-width: 0px;border-left-width: 0px" border="0" alt="clip_image001[4]" src="http://www.designersilverlight.com/wp-content/uploads/2009/08/clip-image0014-thumb.png" width="182" height="150" /></a></p>
<p>you’re going to want to change the main template of the ComboBox.</p>
</p>
<p>As an aside, in order to make this as simple as possible, we’re not going to connect out ComboBox to any data… we’re just going to add a bunch of ComboBoxItems to it. To do this, click on the double-arrow at the bottom of the toolbar and type “combo” into the search field. </p>
<p><a href="http://www.designersilverlight.com/wp-content/uploads/2009/08/clip-image00110.png"><img style="border-right-width: 0px;border-top-width: 0px;border-bottom-width: 0px;border-left-width: 0px" border="0" alt="clip_image001[10]" src="http://www.designersilverlight.com/wp-content/uploads/2009/08/clip-image00110-thumb.png" width="339" height="155" /></a> </p>
<p>Click on the ComboBoxItem and draw it into the ComboBox a couple times. This will give your items some weird heights and widths, so change those if that bothers you. We now have enough items to be able to see the drop down for the purposes of styling it.</p>
<p>OK… let’s get started with actually working on the ComboBox template. Right click on the ComboBox and going to “Edit Template –&gt; Edit a Copy…”</p>
<p><a href="http://www.designersilverlight.com/wp-content/uploads/2009/08/clip-image0018.png"><img style="border-right-width: 0px;border-top-width: 0px;border-bottom-width: 0px;border-left-width: 0px" border="0" alt="clip_image001[8]" src="http://www.designersilverlight.com/wp-content/uploads/2009/08/clip-image0018-thumb.png" width="321" height="72" /></a></p>
</p>
<p>This will dump a copy of the default ComboBox style and template into your resources that you can play around with.</p>
<p>Let’s say we want to do something as simple as changing the corners in the main comboBox and the drop down to make them a little more rounded.</p>
<p>When we look at the template, we should see something that looks like this:</p>
<p><a href="http://www.designersilverlight.com/wp-content/uploads/2009/08/clip-image00112.png"><img style="border-right-width: 0px;border-top-width: 0px;border-bottom-width: 0px;border-left-width: 0px" border="0" alt="clip_image001[12]" src="http://www.designersilverlight.com/wp-content/uploads/2009/08/clip-image00112-thumb.png" width="307" height="264" /></a></p>
<p>Let’s start with rounding the corners of the pop-up, since we can do that from right here. On the PopupBorder element, let’s change the CornerRadius to “0,0,16,16”. And let’s change the border color and thickness just cause we wanna. We end up with something like this:</p>
<p><a href="http://www.designersilverlight.com/wp-content/uploads/2009/08/clip-image00116.png"><img style="border-right-width: 0px;border-top-width: 0px;border-bottom-width: 0px;border-left-width: 0px" border="0" alt="clip_image001[16]" src="http://www.designersilverlight.com/wp-content/uploads/2009/08/clip-image00116-thumb.png" width="148" height="224" /></a></p>
<p>Now, lets work on changing the corners on the rest of the ComboBox. As it turns out, most of the visual elements in the ComboBox are in the DropDownToggle ToggleButton and go to ControlTemplate by right clicking on it and going to “Edit Template –&gt; Edit Current”</p>
<p><a href="http://www.designersilverlight.com/wp-content/uploads/2009/08/clip-image00118.png"><img style="border-right-width: 0px;border-top-width: 0px;border-bottom-width: 0px;border-left-width: 0px" border="0" alt="clip_image001[18]" src="http://www.designersilverlight.com/wp-content/uploads/2009/08/clip-image00118-thumb.png" width="323" height="71" /></a></p>
<p>Now, we can see 8 rectangles that make up the design of the ComboBox. If you wanted to simplify the design, you could get rid of them and put something else in, but we’re going to assume for the moment that you just want to change the corners. Go through the rectangles and if RadiusX and RadiusY are 3, change them to 16 an if they are 2, change them to 15.</p>
<p><a href="http://www.designersilverlight.com/wp-content/uploads/2009/08/clip-image00120.png"><img style="border-right-width: 0px;border-top-width: 0px;border-bottom-width: 0px;border-left-width: 0px" border="0" alt="clip_image001[20]" src="http://www.designersilverlight.com/wp-content/uploads/2009/08/clip-image00120-thumb.png" width="198" height="57" /></a>&#160; becomes <a href="http://www.designersilverlight.com/wp-content/uploads/2009/08/clip-image00122.png"><img style="border-right-width: 0px;border-top-width: 0px;border-bottom-width: 0px;border-left-width: 0px" border="0" alt="clip_image001[22]" src="http://www.designersilverlight.com/wp-content/uploads/2009/08/clip-image00122-thumb.png" width="200" height="58" /></a></p>
</p>
<p>And you have something that is… not that attractive, but it is definitely different.</p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.veracitysolutions.com/styling-a-combobox-in-silverlight-3/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Styling A ListView Column Using Blend</title>
		<link>http://blogs.veracitysolutions.com/styling-a-listview-column-using-blend/</link>
		<comments>http://blogs.veracitysolutions.com/styling-a-listview-column-using-blend/#comments</comments>
		<pubDate>Thu, 13 Dec 2007 14:18:09 +0000</pubDate>
		<dc:creator>Matthias Shapiro</dc:creator>
				<category><![CDATA[Blend]]></category>
		<category><![CDATA[How To...]]></category>
		<category><![CDATA[ListView]]></category>
		<category><![CDATA[XAML]]></category>
		<category><![CDATA[Column]]></category>
		<category><![CDATA[ColumnTemplate]]></category>
		<category><![CDATA[DataTemplate]]></category>
		<category><![CDATA[GridViewColumn]]></category>
		<category><![CDATA[styling]]></category>

		<guid isPermaLink="false">http://www.designerwpf.com/2007/12/13/styling-a-listview-column-using-blend/</guid>
		<description><![CDATA[So you&#8217;ve got a listview and you want the columns (not the rows) to look a certain way. (If you are in any way confused, head over here.)
In this post, we&#8217;re going to build a template for a column and style that template so the data in that column is all styled the same way, [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.designerwpf.com/wp-content/uploads/2007/12/edititemtemplate.png" title="EditCopyItemTemplate"></a><a href="http://www.designerwpf.com/wp-content/uploads/2007/12/edititemtemplate2.png" title="Edit Item Template 2"></a><a href="http://www.designerwpf.com/wp-content/uploads/2007/12/celltemplate-example.png" title="CellTemplate Example"></a><a href="http://www.designerwpf.com/wp-content/uploads/2007/12/celltemplatemenu.png" title="CellTemplate Menu"></a>So you&#8217;ve got a listview and you want the columns (not the rows) to look a certain way. (If you are in any way confused, <a href="http://www.designerwpf.com/2007/12/06/the-wpf-designers-guide-to-styling-the-your-favorite-adjectival-swear-word-here-listview/">head over here</a>.)</p>
<p>In this post, we&#8217;re going to build a template for a column and style that template so the data in that column is all styled the same way, but different from the data in the rest of the list view. Kind of like this:</p>
<p><img src="http://www.designerwpf.com/wp-content/uploads/2007/12/celltemplate-example.png" alt="CellTemplate Example" /></p>
<p><strong>If you&#8217;re following from the RSS Feed post</strong>: go to the listview in the main composition and right click on your listivew and go to <em>&#8220;Edit Other Templates -&gt; Edit Generated Item (ItemTemplate) -&gt; Edit a Copy&#8230;&#8221;</em></p>
<p><strong>Not following from the RSS Feed post:</strong> go to the listview in your composition, right click on your listview and co to <em>&#8220;Edit Other Templates -&gt; Edit Generated Item (ItemTempalte) -&gt; Create Empty&#8230;&#8221;</em></p>
<p><img src="http://www.designerwpf.com/wp-content/uploads/2007/12/edititemtemplate2.png" alt="Edit Item Template 2" /></p>
<p> Name it whatever you like (I named mine &#8220;TitleTemplate&#8221;) and hit OK.</p>
<p><span id="more-106"></span><strong>RSS:</strong> If you had a template Blend will create a copy of your original source template with all the bindings in place. Get rid of all the bindings you don&#8217;t want. I think the easiest way is to simply go into the XAML and do this. Right click on any item and click the &#8220;View XAML&#8221; and delete any binding that doesn&#8217;t have &#8220;title&#8221; in it. When we&#8217;re done, your XAML should look like this:</p>
<p><font color="#0000ff">&lt;<font color="#800000">DataTemplate</font> <font color="#ff0000">x:Key</font><font color="#000000">=&#8221;</font>TitleTemplate<font color="#000000">&#8220;</font>&gt;<br />
      &lt;<font color="#800000">StackPanel</font>&gt;<br />
            &lt;<font color="#800000">TextBlock</font> <font color="#ff0000">Text</font><font color="#000000">=&#8221;</font><font color="#b8860b">{Binding Mode=OneWay, XPath=title}</font><font color="#000000">&#8220;</font> /&gt;<br />
      &lt;/<font color="#800000">StackPanel</font>&gt;<br />
&lt;/<font color="#800000">DataTemplate</font>&gt;</font></p>
<p><strong>Not RSS:</strong> Blend will create the basic DataTemplate markup for you and toss you into a DataTemplate editing mode.</p>
<p>From here, you can draw a Grid directly into the composition and a TextBlock directly into the Grid. Reset the Width and Height of the Grid and TextBlock to Auto and reset the Margins to &#8220;0,0,0,0&#8243;. Assign the TextBlock the proper Bindings in order to get it to show the proper data. Your XAML should look something like this.</p>
<p><font color="#0000ff">&lt;</font><font color="#800000">DataTemplate</font><font color="#0000ff"> </font><font color="#ff0000">x:Key</font><font color="#000000">=&#8221;</font><font color="#0000ff">TitleTemplate</font><font color="#000000">&#8220;</font><font color="#0000ff">&gt;<br />
      &lt;</font><font color="#800000">Grid</font><font color="#0000ff">&gt;<br />
            &lt;</font><font color="#800000">TextBlock</font><font color="#0000ff"> </font><font color="#ff0000">Text</font><font color="#000000">=&#8221;</font><font color="#b8860b">{Binding MySpecialBindings}</font><font color="#000000">&#8220;</font><font color="#0000ff"> /&gt;<br />
      &lt;/</font><font color="#800000">Grid</font><font color="#0000ff">&gt;<br />
&lt;/</font><font color="#800000">DataTemplate</font><font color="#0000ff">&gt;</font></p>
<p><datatemplate x:Key="TitleTemplate"></datatemplate><stackpanel></stackpanel><textblock Text="{Binding Mode=OneWay, XPath=title}"></textblock><strong>Note:</strong> If you need to get back to a design view of your DataTemplate, just go the resources tab on the right, expand wherever you saved your template and click on the right hand icon of template you want to edit. For DataTemplates, this icon is unhelpfully blank.</p>
<p><img src="http://www.designerwpf.com/wp-content/uploads/2007/12/selectdatatemplatefromresources.png" alt="Select DataTemplate from Resources" /></p>
<p>From here we can style the TextBlock directly in the DataTemplate using the Properties panel. Bold it, color it, skew it, turn it upsidedown, give it TextTrimming or TextWrapping or whatever we want. When finished, head back to the main composition view.</p>
<p>Click on the listview and, in the Properties section, expand &#8220;<em>Miscellaneous</em>&#8221; and then expand &#8220;<em>View (GridView)</em>&#8221; and click on the &#8220;<em>Columns (Collection)</em>&#8221; button.</p>
<p> <img src="http://www.designerwpf.com/wp-content/uploads/2007/12/view-gridview-columns-menu.png" alt="View GridView" /></p>
<p>Up pops the &#8220;GridViewColumn Collection Editor: Columns&#8221; window (which should be labeled something less obfuscating like &#8220;ListView Column Editor&#8221;).</p>
<p>Here we can create columns to aptly aid our evil schemes. If you&#8217;re following along from my RSS tutorial, we can create three new columns using the &#8220;Add Another Item&#8221; button (which should be labeled &#8220;Add Another Column&#8221;) and give them the following headers using the Header input in the Properties section:</p>
<p>&#8220;Title&#8221;<br />
&#8220;Author&#8221;<br />
&#8220;Description&#8221;<br />
&#8220;Publication Date&#8221;</p>
<p>If we want all our data to look the same with basic text elements and no fancy stuff, we can use DisplayMemberBinding and check out my post on that (coming soon).</p>
<p>However, if we want the special styling applied, we can choose the particular GridViewColumn to be specially styled and apply the template we&#8217;ve created.</p>
<p>(I feel like I&#8217;m writing a choose-your-own-adventure here. &#8220;If you want Johnny to answer the doorbell, turn to page 57. If you want Johnny to escape out the window, turn to page 23.&#8221;)</p>
<p>Anyway.</p>
<p>Click on the GridViewColumn with the &#8220;Title&#8221; header and click the little box to the right of &#8220;CellTemplate&#8221; In the resulting menu click on &#8220;Local Resource&#8221; and select the DataTemplate that we&#8217;ve just created. Click &#8220;OK&#8221;.</p>
<p><img src="http://www.designerwpf.com/wp-content/uploads/2007/12/celltemplatemenu.png" alt="CellTemplate Menu" /></p>
<p>And viola! Our listview shows up all sorts of custom designed happiness.</p>
<p><a href="http://www.designerwpf.com/2007/12/11/listview-faq/">ListView Frequently Asked Questions</a> pertaining to ColumnHeader issues:</p>
<blockquote><p><em>How do I make it so that, instead of cutting off the text in my column when I shorten it, my text displays ellipsis? (Example: &#8220;blahblahb…&#8221;)</em></p></blockquote>
<p>which is closely related to:</p>
<blockquote><p><em>How do I make it so that my text wraps when I shorten my columns?</em></p></blockquote>
<p>So <a href="http://www.designerwpf.com/2007/12/13/ellipsis-and-textwrapping-in-a-listview-column/">I deal with them in the same post here</a>.</p>
<blockquote><p><em>My binding points to an image source. How do I make it so that the image it points to shows up in the column instead of the stupid image source? (coming soon)</em><br />
<em><a href="http://www.designerwpf.com/2007/12/17/how-do-i-center-something-in-my-listview-column/">How do I center something in my ListView column?</a></em> </p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://blogs.veracitysolutions.com/styling-a-listview-column-using-blend/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
