<?xml version="1.0" encoding="UTF-8" standalone="no"?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><rss xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" version="2.0"><channel><title>Martins BIG Blog...</title><description>What a load of BLOG.....</description><managingEditor>noreply@blogger.com (Martin)</managingEditor><pubDate>Thu, 5 Sep 2024 16:03:19 +1000</pubDate><generator>Blogger http://www.blogger.com</generator><openSearch:totalResults xmlns:openSearch="http://a9.com/-/spec/opensearchrss/1.0/">55</openSearch:totalResults><openSearch:startIndex xmlns:openSearch="http://a9.com/-/spec/opensearchrss/1.0/">1</openSearch:startIndex><openSearch:itemsPerPage xmlns:openSearch="http://a9.com/-/spec/opensearchrss/1.0/">25</openSearch:itemsPerPage><link>http://martin-mforme.blogspot.com/</link><language>en-us</language><itunes:explicit>no</itunes:explicit><itunes:subtitle>What a load of BLOG.....</itunes:subtitle><itunes:owner><itunes:email>noreply@blogger.com</itunes:email></itunes:owner><item><title>MIX08 Session: Applications = Designers + Developers for WPF and Silverlight</title><link>http://martin-mforme.blogspot.com/2008/06/mix08-session-applications-designers.html</link><category>MIX08 CT06 Session WPF ListBox</category><author>noreply@blogger.com (Martin)</author><pubDate>Fri, 6 Jun 2008 11:07:00 +1000</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-2158307754372575291.post-2070535695280911145</guid><description>&lt;span style="font-family:verdana;"&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-size:130%;"&gt;&lt;strong&gt;This is a Big Tutorial. So get a JUG of Coffee Handy.&lt;/strong&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:verdana;font-size:85%;"&gt;Last week I reviewed some of the sessions from MIX08.&lt;br /&gt;I was most impressed with the &lt;span style="color:#000000;"&gt;&lt;strong&gt;MIX08 CT06 Session:&lt;/strong&gt; &lt;/span&gt;&lt;span style="color:#000099;"&gt;Applications = Designers + Developers&lt;/span&gt; held by &lt;strong&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_0"&gt;Celso&lt;/span&gt; &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_1"&gt;Gomes&lt;/span&gt;&lt;/strong&gt; and &lt;strong&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_2"&gt;Kirupa&lt;/span&gt; &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_3"&gt;Chinnathambi&lt;/span&gt;&lt;/strong&gt; which dealt with &lt;span style="color:#000000;"&gt;Re-Styling a ListBox.&lt;/span&gt; The &lt;strong&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_6"&gt;FurnitureShowroom&lt;/span&gt;&lt;/strong&gt; example showed how to completely change the style of a &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_7"&gt;ListBox&lt;/span&gt;.&lt;br /&gt;&lt;strong&gt;Here's a link to the Video session&lt;/strong&gt;: &lt;a href="http://sessions.visitmix.com/"&gt;MIX08 CT06 Session: Applications = Designers + Developers&lt;/a&gt;&lt;br /&gt;Have a look at the Video before attempting this tutorial, it will give you a good overview.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:verdana;font-size:85%;"&gt;The following screen shot is from &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_8"&gt;Celso's&lt;/span&gt; and &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_9"&gt;Kirupa's&lt;/span&gt; &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_10"&gt;WPF&lt;/span&gt; application with a completly re-styled ListBox &lt;strong&gt;(Look Ma! "no scroll bars"&lt;/strong&gt;).&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhWrbbFPjoTTjh94djA0PzOYsuFgAC5b_RW6ZWQ5aFz0BcKtawwvDAs1_r3FgNPKNFJuJSbBT7eAIy8eDqvFXG3_9AWTlTuaRApKkpcqGL3U30NPDn2Z6PiMUBzw2OPvjbO1LFI9UhXAlI/s1600-h/furnitureSS_3.jpg"&gt;&lt;span style="font-family:verdana;font-size:85%;"&gt;&lt;img id="BLOGGER_PHOTO_ID_5208569793813794850" style="CURSOR: hand" alt="" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhWrbbFPjoTTjh94djA0PzOYsuFgAC5b_RW6ZWQ5aFz0BcKtawwvDAs1_r3FgNPKNFJuJSbBT7eAIy8eDqvFXG3_9AWTlTuaRApKkpcqGL3U30NPDn2Z6PiMUBzw2OPvjbO1LFI9UhXAlI/s400/furnitureSS_3.jpg" border="0" /&gt;&lt;/span&gt;&lt;/a&gt;&lt;span style="font-family:verdana;font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:verdana;"&gt;Even though the session gave a good overview of how to create a really nice application using WPF and Expression &lt;em&gt;Blend and Design&lt;/em&gt;, I got a bit lost with the Control styling part. I thought that was the most interesting part of the demonstration, but that’s me, I look for the tricky stuff.&lt;br /&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_11"&gt;Celso&lt;/span&gt; had created these styles beforehand so we did not get to see how he did that. But still a fantastic example of WPF power. &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:verdana;"&gt;&lt;span style="font-size:85%;"&gt;&lt;strong&gt;&lt;span style="font-family:lucida grande;"&gt;I thought I would try and replicate what they did using the fabrikam sample data.&lt;br /&gt;&lt;/span&gt;&lt;/strong&gt;I was able to produce a similar example and also pull apart the &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_12"&gt;ListBox&lt;/span&gt; and re-style it.&lt;br /&gt;Here's the low-down on how to re-style a &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_13"&gt;ListBox&lt;/span&gt; to resemble &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_14"&gt;Celso's&lt;/span&gt;. I didn't write any &lt;strong&gt;C#&lt;/strong&gt; code for this example it was all done using Expression Blend.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:verdana;"&gt;&lt;span style="font-size:85%;"&gt;&lt;strong&gt;Pre-requisites first&lt;/strong&gt; : I used the following tools.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;ol&gt;&lt;li&gt;&lt;span style="font-family:verdana;font-size:85%;"&gt;&lt;em&gt;Expression Blend 2&lt;/em&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-family:verdana;font-size:85%;"&gt;&lt;em&gt;Visual Studio 2008&lt;/em&gt; (3.5)&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-family:Verdana;font-size:85%;"&gt;Platform Windows Vista Ultimate &lt;/span&gt;&lt;/li&gt;&lt;/ol&gt;&lt;span style="font-family:verdana;font-size:85%;"&gt;Here's a Link to Expression Blend: &lt;a href="http://www.microsoft.com/expression/products/overview.aspx?key=blend"&gt;Expression Blend 2 Download&lt;/a&gt; &lt;/span&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style="font-family:verdana;font-size:85%;"&gt;A bit of an Overview first.&lt;br /&gt;&lt;/span&gt;&lt;/strong&gt;&lt;span style="font-family:verdana;font-size:85%;"&gt;For most controls, there is appearance and behavior. Consider a button: appearance is the raised area that you can press, and the behavior is the Click event that gets raised in response to a click. Sometimes, there may be a control that provides the behavior that you need but not the appearance that you need. You can use style setters to set property values to affect the look of control. However, to change the structure of a control or to set property values on the components that comprise a control, you need to use a &lt;strong&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_15"&gt;ControlTemplate&lt;/span&gt;&lt;/strong&gt;.&lt;br /&gt;The data and &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_16"&gt;UI&lt;/span&gt; you see in the above form is really a reconstructed &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_17"&gt;ListBox control&lt;/span&gt; with re-styled &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_18"&gt;ListBoxItems&lt;/span&gt;. The &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_19"&gt;scrollbars&lt;/span&gt; have been disabled and re-styled so we still get the same behaviour as a &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_20"&gt;ListBox&lt;/span&gt; but without the look. (&lt;strong&gt;&lt;em&gt;We want the Engine but not the Body&lt;/em&gt;&lt;/strong&gt;)&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:verdana;"&gt;&lt;span style="font-size:85%;"&gt;&lt;strong&gt;Quote&lt;/strong&gt;:&lt;br /&gt;&lt;em&gt;Windows Presentation Foundation (&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_21"&gt;WPF&lt;/span&gt;) styling and &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_22"&gt;templating&lt;/span&gt; refer to a suite of features (styles, templates, triggers, and storyboards) that allow an application, document, or user interface (&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_23"&gt;UI&lt;/span&gt;) designer to create visually compelling applications and to standardize on a particular look for their product.&lt;/em&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:verdana;font-size:85%;"&gt;(&lt;strong&gt;What a &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_24"&gt;Mouthfull&lt;/span&gt;&lt;/strong&gt;); straight out the book, but basically that’s it in a nutshell.&lt;br /&gt;The question is &lt;strong&gt;how?&lt;/strong&gt; Usually something so powerful as the above quote requires time and patients’ to get real handle on, especially when you are designing a unique &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_25"&gt;UI,&lt;/span&gt; you need to understand the technology to do the job right. Well WPF has the power to create any type of UI you can imagine.&lt;br /&gt;But it helps to have &lt;strong&gt;HELP&lt;/strong&gt;.&lt;br /&gt;&lt;strong&gt;OK enough babble lets get to work.&lt;/strong&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:verdana;font-size:85%;"&gt;I am not going to go into the basics of styles and &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_26"&gt;templating&lt;/span&gt;, you can read &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_27"&gt;WPF&lt;/span&gt; &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_28"&gt;SDK&lt;/span&gt; docs for that information. I just want show how to turn your every day &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_29"&gt;WPF&lt;/span&gt; &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_30"&gt;ListBox&lt;/span&gt; into something like &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_31"&gt;Celso's&lt;/span&gt;.&lt;br /&gt;Below is my application using the &lt;strong&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_32"&gt;fabrikam&lt;/span&gt;&lt;/strong&gt; data. You will notice the default &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_33"&gt;ListBox&lt;/span&gt;. Typical &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_34"&gt;ListBox&lt;/span&gt; stuff. Scroll bars and Items one below the other.&lt;br /&gt;&lt;/span&gt;&lt;a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiY4ZQExtjqgGreAidiXdWzN4f6t79TkdkbK42LWE2V1_hZn7RCtknFqN6gTKF5sqjnnfmnL7EOfyGX7EHgy6QRF7ARG3c8o5u3rtc_1U4rmj8Fvcuhjh6UhWVm6L-6ybu0oAA2BE6AK_Y/s1600-h/fabrikam.jpg"&gt;&lt;span style="font-family:verdana;font-size:85%;"&gt;&lt;img id="BLOGGER_PHOTO_ID_5208578242014466098" style="CURSOR: hand" alt="" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiY4ZQExtjqgGreAidiXdWzN4f6t79TkdkbK42LWE2V1_hZn7RCtknFqN6gTKF5sqjnnfmnL7EOfyGX7EHgy6QRF7ARG3c8o5u3rtc_1U4rmj8Fvcuhjh6UhWVm6L-6ybu0oAA2BE6AK_Y/s400/fabrikam.jpg" border="0" /&gt;&lt;/span&gt;&lt;/a&gt;&lt;span style="font-family:verdana;font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:verdana;font-size:85%;"&gt;So to get a &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_35"&gt;UI&lt;/span&gt; like the &lt;strong&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_36"&gt;Furnitureshowroom&lt;/span&gt;&lt;/strong&gt; example we need to change the default style. &lt;/span&gt;&lt;br /&gt;&lt;p&gt;&lt;span style="font-family:verdana;font-size:85%;"&gt;&lt;strong&gt;&lt;em&gt;Go to the end of this tutorial to see the finished product.&lt;/em&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:verdana;font-size:85%;"&gt;In my fabrikam application, we have a &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_37"&gt;ListBox&lt;/span&gt; control that is bound to a list of images and text. I used the &lt;strong&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_38"&gt;fabrikam&lt;/span&gt;&lt;/strong&gt; XML file for my data source and the images that are part of the fabrikam tutorial.&lt;br /&gt;In &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_39"&gt;WPF&lt;/span&gt;, you use a &lt;strong&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_40"&gt;DataTemplate&lt;/span&gt;&lt;/strong&gt; to define the visual representation of data. Basically, what you put into a &lt;strong&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_41"&gt;DataTemplate&lt;/span&gt;&lt;/strong&gt; determines what the data looks like in the rendered application.&lt;br /&gt;So lets give our &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_42"&gt;ListBox&lt;/span&gt; a new &lt;strong&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_43"&gt;DataTemplate&lt;/span&gt;&lt;/strong&gt; so we don't have this list collection look. If you have &lt;strong&gt;Microsoft Expression Blend&lt;/strong&gt; it makes this a whole lot easier. So I will &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_44"&gt;asume&lt;/span&gt; you have it and use that tool to change the &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_45"&gt;XAML&lt;/span&gt;.&lt;br /&gt;Open up &lt;strong&gt;Expression Blend&lt;/strong&gt; and create a new &lt;strong&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_46"&gt;WPF&lt;/span&gt; .&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_47"&gt;exe&lt;/span&gt;&lt;/strong&gt; application named "&lt;strong&gt;CustomListBox"&lt;/strong&gt;.&lt;br /&gt;&lt;strong&gt;Double Click &lt;/strong&gt;the&lt;strong&gt; LayoutRoot&lt;/strong&gt; object in &lt;em&gt;Objects and Timelines&lt;/em&gt; so it is highlighted &lt;strong&gt;yellow. &lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:verdana;font-size:85%;"&gt;&lt;strong&gt;Click&lt;/strong&gt; on the the &lt;em&gt;&lt;strong&gt;Asset &lt;/strong&gt;Library &lt;img id="BLOGGER_PHOTO_ID_5209310091936734770" style="WIDTH: 32px; CURSOR: hand; HEIGHT: 33px" height="28" alt="" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhu5CfcW4f8lpFHgyoUYIWcxHhhhqyt1cXneRZ4mt_JAxMV4jo82OxdA7eUGc1BdWGZdk1lz9dIml3lvyx48-r7JisbBVxZs8wmfkaD3RkB4f_cwvJVKZf_x0CG1-xFTbDyJKdvdT7oF_Y/s400/assetlib.jpg" width="28" border="0" /&gt;&lt;/em&gt; and find the &lt;strong&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_48"&gt;ListBox&lt;/span&gt;&lt;/strong&gt; control. Draw a &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_50"&gt;ListBox&lt;/span&gt; on the area. Its usually drawn inside a Grid container.&lt;br /&gt;Locate some data. You can use the &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_51"&gt;fabrikam&lt;/span&gt; XML file and the images as your data source. You will need to create an images directory in your project and copy the images from the following ZIP file into that directory to map to the fabrikam XML file structure.&lt;br /&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_53"&gt;Here's&lt;/span&gt; a Link to the &lt;strong&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_54"&gt;Fabrikam&lt;/span&gt; data&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:verdana;font-size:85%;"&gt;&lt;a href="http://debbietaylor.com.au/uploads/WPFCustomListData.zip"&gt;Download the fabrikam XML Data and Images&lt;/a&gt;&lt;/span&gt;&lt;span style="font-family:verdana;font-size:85%;"&gt;&lt;br /&gt;Once you have your &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_55"&gt;ListBox&lt;/span&gt; you need to bind your &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_56"&gt;datasource&lt;/span&gt; to it.&lt;br /&gt;Under Projects and in the Data section you will notice the &lt;strong&gt;+XML&lt;/strong&gt; item. If you click that, you can locate your XML data source and attach it to the Project. The new &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_57"&gt;DataSource&lt;/span&gt; can now be bound to your &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_58"&gt;ListBox&lt;/span&gt;. Expand the &lt;strong&gt;+XML&lt;/strong&gt; &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_59"&gt;datasource&lt;/span&gt; &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_60"&gt;untill&lt;/span&gt; you see the &lt;strong&gt;Product Array&lt;/strong&gt; item as the following image shows.&lt;br /&gt;&lt;/span&gt;&lt;a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhN5CfyIidg8oR3w1AAOeo9UYxNhLxxOPliYdyZe5CHrZxkShjwBCWTUrALqaHHDVmM7MfcHiLVt-NIinLVmmVLSTREGuw3o8hXvVOlPIFTKluW69A2x-dCQdXPGQ0CexOWbQUQ5iYBEJ0/s1600-h/ds.jpg"&gt;&lt;span style="font-family:verdana;font-size:85%;"&gt;&lt;img id="BLOGGER_PHOTO_ID_5208630580485935266" style="CURSOR: hand" alt="" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhN5CfyIidg8oR3w1AAOeo9UYxNhLxxOPliYdyZe5CHrZxkShjwBCWTUrALqaHHDVmM7MfcHiLVt-NIinLVmmVLSTREGuw3o8hXvVOlPIFTKluW69A2x-dCQdXPGQ0CexOWbQUQ5iYBEJ0/s400/ds.jpg" border="0" /&gt;&lt;/span&gt;&lt;/a&gt;&lt;span style="font-family:verdana;"&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;strong&gt;Drag&lt;/strong&gt; the Product (Array) item onto your &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_61"&gt;ListBox&lt;/span&gt;. &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_62"&gt;Dont&lt;/span&gt; worry all the fields will follow. A small dialog will be displayed, select &lt;strong&gt;Bind Product to &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_63"&gt;ListBox&lt;/span&gt;&lt;/strong&gt; and Select Field is &lt;strong&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_64"&gt;ItemSource&lt;/span&gt;&lt;/strong&gt; and Click &lt;strong&gt;OK&lt;/strong&gt; and Click &lt;strong&gt;OK&lt;/strong&gt; again to close this form.&lt;br /&gt;&lt;strong&gt;Good your DONE!&lt;/strong&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:verdana;font-size:85%;"&gt;&lt;br /&gt;Now to the good stuff. D&lt;/span&gt;&lt;span style="font-family:verdana;font-size:85%;"&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_65"&gt;ouble&lt;/span&gt; click on the &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_66"&gt;ListBox&lt;/span&gt; control so its is highlighted &lt;strong&gt;yellow&lt;/strong&gt;.&lt;br /&gt;Right click and select the &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_67"&gt;submenus&lt;/span&gt; as the following image shows. You need to get to the &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_68"&gt;ListBoxes&lt;/span&gt; &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_69"&gt;&lt;strong&gt;ItemTemplate&lt;/strong&gt;&lt;/span&gt;.&lt;br /&gt;&lt;/span&gt;&lt;a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjBjnUKKoA2rdOE5PuS-VcwU2bSQJWMfNZaBgEQ-T8T-0Lr2U-X88Pv3h4LYZhoiiXDM7BpvI2tKH_mwKohkFEykN_I3P9Zfp1XPRy__IOoinBbwDeLkXNCbgdQPCQk0b4EBEWP93GqtNQ/s1600-h/Datatemplate.jpg"&gt;&lt;span style="font-family:verdana;font-size:85%;"&gt;&lt;img id="BLOGGER_PHOTO_ID_5208608452814426178" style="CURSOR: hand" alt="" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjBjnUKKoA2rdOE5PuS-VcwU2bSQJWMfNZaBgEQ-T8T-0Lr2U-X88Pv3h4LYZhoiiXDM7BpvI2tKH_mwKohkFEykN_I3P9Zfp1XPRy__IOoinBbwDeLkXNCbgdQPCQk0b4EBEWP93GqtNQ/s400/Datatemplate.jpg" border="0" /&gt;&lt;/span&gt;&lt;/a&gt;&lt;span style="font-family:verdana;font-size:85%;"&gt;&lt;br /&gt;The next image shows the current &lt;strong&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_70"&gt;DataTemplate&lt;/span&gt;&lt;/strong&gt;.&lt;br /&gt;Notice the &lt;strong&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_71"&gt;StackPanel&lt;/span&gt;&lt;/strong&gt; item. It has a group of &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_72"&gt;TextBlock&lt;/span&gt; controls under it.&lt;br /&gt;This is your &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_73"&gt;&lt;strong&gt;DataTemplate&lt;/strong&gt;&lt;/span&gt;.&lt;br /&gt;&lt;/span&gt;&lt;a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiHKz4O0Che9-AN98hhZUyzmOuaJnFiKwn-NyZ9f-uHHtn2q6Y2S_C2TwT1Dn2_fjRoapLk3ad3i3WRTS5Pgg2sYGngnJqOkC5rlY2pu5z8nUX-Lf3bzlRxaplNik5p-voVRFkTm71POx0/s1600-h/StackTemplate.jpg"&gt;&lt;span style="font-family:verdana;font-size:85%;"&gt;&lt;img id="BLOGGER_PHOTO_ID_5208619267542077522" style="CURSOR: hand" alt="" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiHKz4O0Che9-AN98hhZUyzmOuaJnFiKwn-NyZ9f-uHHtn2q6Y2S_C2TwT1Dn2_fjRoapLk3ad3i3WRTS5Pgg2sYGngnJqOkC5rlY2pu5z8nUX-Lf3bzlRxaplNik5p-voVRFkTm71POx0/s400/StackTemplate.jpg" border="0" /&gt;&lt;/span&gt;&lt;/a&gt;&lt;span style="font-family:verdana;font-size:85%;"&gt; &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:verdana;font-size:85%;"&gt;Our data from the &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_77"&gt;fabrikam&lt;/span&gt; sample has real images but you will notice that the default &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_78"&gt;ListBox&lt;/span&gt; shows the text path of the image not the image itself. How about we change that first. &lt;/span&gt;&lt;span style="font-family:verdana;font-size:85%;"&gt;Delete the &lt;strong&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_79"&gt;TextBlock&lt;/span&gt;&lt;/strong&gt; item in the &lt;strong&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_80"&gt;StackPanel&lt;/span&gt;&lt;/strong&gt; that holds the image path details and &lt;strong&gt;replace&lt;/strong&gt; it with an &lt;strong&gt;Image&lt;/strong&gt; control, you find the Image control in the &lt;strong&gt;Asset&lt;/strong&gt; Library. &lt;strong&gt;Next&lt;/strong&gt; we need to bind the Source property of the image control to the Image element in the XML &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_81"&gt;Datasource&lt;/span&gt;.&lt;br /&gt;Your &lt;strong&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_82"&gt;StackPanel&lt;/span&gt;&lt;/strong&gt; should look like the one below. The &lt;strong&gt;Image&lt;/strong&gt; control replaces the &lt;strong&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_83"&gt;TextBlock&lt;/span&gt;&lt;/strong&gt;.&lt;/span&gt;&lt;a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhcWZO1ZSXrftxB4aqNDM4vwKOmFaGhlhiI2Bd6QNRpjFvcUVzIWrPKY5bjG3h2CrB5mVtntKX43mNAv4Z8fKhyr1Q4pZogAo6PzZHhs2TcyEyMerianOKyIxT8O1FwtXLmj2G7JUbseCQ/s1600-h/NewStackPanel.jpg"&gt;&lt;span style="font-family:verdana;font-size:85%;"&gt;&lt;img id="BLOGGER_PHOTO_ID_5208621552464679010" style="CURSOR: hand" alt="" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhcWZO1ZSXrftxB4aqNDM4vwKOmFaGhlhiI2Bd6QNRpjFvcUVzIWrPKY5bjG3h2CrB5mVtntKX43mNAv4Z8fKhyr1Q4pZogAo6PzZHhs2TcyEyMerianOKyIxT8O1FwtXLmj2G7JUbseCQ/s400/NewStackPanel.jpg" border="0" /&gt;&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;span style="font-family:verdana;"&gt;&lt;span style="font-size:85%;"&gt;&lt;strong&gt;Next&lt;/strong&gt; select the Image control and under &lt;strong&gt;Common&lt;/strong&gt; properties click the little &lt;strong&gt;yellow&lt;/strong&gt; icon on the right to bring up the &lt;strong&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_84"&gt;DataBinding&lt;/span&gt;&lt;/strong&gt; Menu.&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj-op_yTkyxMKSSxu4GwbUiWO19HdSCTFJo2TaTL19w0x-OAjCZi9FWOks359lJ7BdY9ZMCQ_NAS-_GgHhvit57vLZD4UK3WqsFQlkDGkn-hGz2pz3i7Qc7CV6QdSoQZFaXrJG6leHu3Fc/s1600-h/imageProps.jpg"&gt;&lt;span style="font-family:verdana;font-size:85%;"&gt;&lt;img id="BLOGGER_PHOTO_ID_5208622235364479090" style="CURSOR: hand" alt="" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj-op_yTkyxMKSSxu4GwbUiWO19HdSCTFJo2TaTL19w0x-OAjCZi9FWOks359lJ7BdY9ZMCQ_NAS-_GgHhvit57vLZD4UK3WqsFQlkDGkn-hGz2pz3i7Qc7CV6QdSoQZFaXrJG6leHu3Fc/s400/imageProps.jpg" border="0" /&gt;&lt;/span&gt;&lt;/a&gt;&lt;span style="font-family:verdana;font-size:85%;"&gt; &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:verdana;"&gt;&lt;span style="font-size:85%;"&gt;&lt;strong&gt;Click&lt;/strong&gt; the &lt;strong&gt;Data Binding&lt;/strong&gt; menu item to display the &lt;strong&gt;Create Data Binding&lt;/strong&gt; form.&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgdYudRmlCHCbep7zUfYc5vLWJntY5-wDrpTJpHXYk9vIZDtHNIwc6wf6J0XoP3kzueaqEMqwh0tK4aYUZWEgmbE-6trWCs4EBf_PsQR2fd3h_tR8TKAJx8a0vMFUVQqu6hV99pdSg7qj4/s1600-h/databinding.jpg"&gt;&lt;span style="font-family:verdana;font-size:85%;"&gt;&lt;img id="BLOGGER_PHOTO_ID_5208622905379377282" style="CURSOR: hand" alt="" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgdYudRmlCHCbep7zUfYc5vLWJntY5-wDrpTJpHXYk9vIZDtHNIwc6wf6J0XoP3kzueaqEMqwh0tK4aYUZWEgmbE-6trWCs4EBf_PsQR2fd3h_tR8TKAJx8a0vMFUVQqu6hV99pdSg7qj4/s400/databinding.jpg" border="0" /&gt;&lt;/span&gt;&lt;/a&gt;&lt;span style="font-family:verdana;font-size:85%;"&gt;&lt;br /&gt;&lt;strong&gt;Click&lt;/strong&gt; the &lt;strong&gt;Image element&lt;/strong&gt; in the &lt;strong&gt;Products Array&lt;/strong&gt; and click &lt;strong&gt;Finish.&lt;/strong&gt;&lt;br /&gt;&lt;/span&gt;&lt;a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgOR6wo7FMQznbp1MqAKa0Kti64n5UmYWP4W9Q8bFKdQ3Rx3yvw1xOoi8OTPuEruJT5sD4kyqBEtaIC8bk01ROviW1C87KRQx4oaZyw-hh8BWKHirZUTeCIiFRe67qUzJtbA5SC5L3dhJg/s1600-h/createdatabind.jpg"&gt;&lt;span style="font-family:verdana;font-size:85%;"&gt;&lt;img id="BLOGGER_PHOTO_ID_5208623364940877970" style="CURSOR: hand" alt="" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgOR6wo7FMQznbp1MqAKa0Kti64n5UmYWP4W9Q8bFKdQ3Rx3yvw1xOoi8OTPuEruJT5sD4kyqBEtaIC8bk01ROviW1C87KRQx4oaZyw-hh8BWKHirZUTeCIiFRe67qUzJtbA5SC5L3dhJg/s400/createdatabind.jpg" border="0" /&gt;&lt;/span&gt;&lt;/a&gt;&lt;span style="font-family:verdana;font-size:85%;"&gt; &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:verdana;font-size:85%;"&gt;&lt;strong&gt;Cool your almost there.&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:verdana;"&gt;&lt;span style="font-size:85%;"&gt;&lt;strong&gt;Test it&lt;/strong&gt;. Select &lt;strong&gt;Control + S&lt;/strong&gt; to save your Project and Press &lt;strong&gt;F5&lt;/strong&gt; to run. &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:verdana;font-size:85%;"&gt;Should see something like the following screen shot.&lt;br /&gt;&lt;/span&gt;&lt;a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgi_F8C9c6Natr2OV-APpPE17ojf39iWCFdSspXlxy-MPItZTuhXYDbLQV52DkF34ap8_5gegN5XQjfmbTFTj57En8pNVUdNz_c00V6kvGtatwNXaFLqg-Jd3YOUDgW1XZISm5_QMeYjrQ/s1600-h/runningapp.jpg"&gt;&lt;span style="font-family:verdana;font-size:85%;"&gt;&lt;img id="BLOGGER_PHOTO_ID_5208638040844128434" style="CURSOR: hand" alt="" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgi_F8C9c6Natr2OV-APpPE17ojf39iWCFdSspXlxy-MPItZTuhXYDbLQV52DkF34ap8_5gegN5XQjfmbTFTj57En8pNVUdNz_c00V6kvGtatwNXaFLqg-Jd3YOUDgW1XZISm5_QMeYjrQ/s400/runningapp.jpg" border="0" /&gt;&lt;/span&gt;&lt;/a&gt;&lt;span style="font-family:verdana;font-size:85%;"&gt;&lt;br /&gt;&lt;strong&gt;But still nothing Like &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_85"&gt;Celso's&lt;/span&gt; style right. &lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style="font-family:Verdana;font-size:85%;"&gt;&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;&lt;span style="font-family:verdana;font-size:85%;"&gt;&lt;em&gt;OK I'll get to the point.&lt;/em&gt; &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:Verdana;font-size:85%;"&gt;We need to create a new &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_86"&gt;&lt;strong&gt;DataTemplate&lt;/strong&gt; to hold our list items&lt;/span&gt;. &lt;/span&gt;&lt;span style="font-family:Verdana;font-size:85%;"&gt;Go to the &lt;strong&gt;Project&lt;/strong&gt; tab and right click on the Project name and select &lt;strong&gt;Add New Item&lt;/strong&gt;. &lt;/span&gt;&lt;span style="font-family:Verdana;font-size:85%;"&gt;We will add a new Window to hold our template. Once the new window is created double click on the &lt;strong&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_87"&gt;LayoutRoot&lt;/span&gt;&lt;/strong&gt; object and &lt;strong&gt;Delete&lt;/strong&gt; it. &lt;strong&gt;Next&lt;/strong&gt; add a new &lt;strong&gt;Canvas&lt;/strong&gt; to the Window object (&lt;em&gt;Canvas's are in the Asset Library&lt;/em&gt;). &lt;/span&gt;&lt;span style="font-family:Verdana;font-size:85%;"&gt;We are going to add &lt;strong&gt;4&lt;/strong&gt; new controls to the &lt;strong&gt;Canvas &lt;/strong&gt;item of the new Window. &lt;/span&gt;&lt;span style="font-family:Verdana;font-size:85%;"&gt;&lt;strong&gt;First&lt;/strong&gt; double click the &lt;strong&gt;Canvas &lt;/strong&gt;item so it is highlighted &lt;strong&gt;yellow&lt;/strong&gt;. Then r&lt;/span&gt;&lt;span style="font-family:Verdana;font-size:85%;"&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_88"&gt;ight&lt;/span&gt; click on it and rename it to &lt;strong&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_89"&gt;NewTemplate&lt;/span&gt;&lt;/strong&gt;. &lt;/span&gt;&lt;span style="font-family:Verdana;font-size:85%;"&gt;While it is still highlighted add &lt;strong&gt;3&lt;/strong&gt; new &lt;strong&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_90"&gt;TextBlocks&lt;/span&gt;&lt;/strong&gt; and &lt;strong&gt;1&lt;/strong&gt; new &lt;strong&gt;Image&lt;/strong&gt; control. &lt;strong&gt;Rename&lt;/strong&gt; the controls to match the following screen shot. &lt;/span&gt;&lt;span style="font-family:Verdana;font-size:85%;"&gt;It should look like the following.&lt;/span&gt;&lt;br /&gt;&lt;a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh7VIPBI5QyYbLTKxZm_V-95w-UNgVY4UdVJTdrb0q_ucyUchsnD8BSTsX8puPRFiemv5K2IEXqI6yAAPHO9L9nt1CUgNVeZ0xLNEeLCj19NvpY02lnc3FxjOBg7JYa2ErV6zhJ_XcD2io/s1600-h/newtemplate.jpg"&gt;&lt;img id="BLOGGER_PHOTO_ID_5208652343085224162" style="CURSOR: hand" alt="" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh7VIPBI5QyYbLTKxZm_V-95w-UNgVY4UdVJTdrb0q_ucyUchsnD8BSTsX8puPRFiemv5K2IEXqI6yAAPHO9L9nt1CUgNVeZ0xLNEeLCj19NvpY02lnc3FxjOBg7JYa2ErV6zhJ_XcD2io/s400/newtemplate.jpg" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:verdana;"&gt;&lt;strong&gt;Next&lt;/strong&gt; right click on the &lt;strong&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_91"&gt;NewTemplate&lt;/span&gt;&lt;/strong&gt; and copy it to the clipboard. Go back to our main Window where the &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_92"&gt;ListBox&lt;/span&gt; is and confirm we are still in the &lt;strong&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_93"&gt;ItemTemplate&lt;/span&gt;&lt;/strong&gt; of the &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_94"&gt;ListBox&lt;/span&gt;. &lt;/span&gt;&lt;span style="font-family:verdana;"&gt;If somehow the breadcrumb has vanished double click on the &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_95"&gt;ListBox&lt;/span&gt; control so its is highlighted &lt;strong&gt;yellow&lt;/strong&gt;. Right click and select the &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_96"&gt;submenus&lt;/span&gt; as the following image shows. You need to get to the &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_97"&gt;ListBoxes&lt;/span&gt; &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_98"&gt;&lt;strong&gt;ItemTemplate&lt;/strong&gt;&lt;/span&gt;.&lt;/span&gt; &lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjBjnUKKoA2rdOE5PuS-VcwU2bSQJWMfNZaBgEQ-T8T-0Lr2U-X88Pv3h4LYZhoiiXDM7BpvI2tKH_mwKohkFEykN_I3P9Zfp1XPRy__IOoinBbwDeLkXNCbgdQPCQk0b4EBEWP93GqtNQ/s1600-h/Datatemplate.jpg"&gt;&lt;span style="font-family:verdana;font-size:85%;"&gt;&lt;img id="BLOGGER_PHOTO_ID_5208608452814426178" style="CURSOR: hand" alt="" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjBjnUKKoA2rdOE5PuS-VcwU2bSQJWMfNZaBgEQ-T8T-0Lr2U-X88Pv3h4LYZhoiiXDM7BpvI2tKH_mwKohkFEykN_I3P9Zfp1XPRy__IOoinBbwDeLkXNCbgdQPCQk0b4EBEWP93GqtNQ/s400/Datatemplate.jpg" border="0" /&gt;&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:verdana;font-size:85%;"&gt;We should by now have an empty &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_99"&gt;ItemTemplate&lt;/span&gt;, you can remove this altogether and replace it with your own. Delete the &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_100"&gt;StackPanel&lt;/span&gt; with all its controls. It will look like the following shot. &lt;strong&gt;Don't&lt;/strong&gt; Delete the &lt;strong&gt;ItemTemplate&lt;/strong&gt; we will want that to hold our &lt;strong&gt;DataTemplate&lt;/strong&gt;. &lt;/span&gt;&lt;a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhWw_6t6BGKBbzQAfAdhsU1TPbXmfiQkLksRE9-DERX1_0R_W2NNvNqFhgcfABsHgQ2nXKrDQMZ1uiCmpE1Yj1gIsbDo82fKl7xha7X8-3tqQVviHyVCYbmP9zQeyeR15et23Y_wvaWy-w/s1600-h/emptystackpan.jpg"&gt;&lt;img id="BLOGGER_PHOTO_ID_5208656217145725170" style="CURSOR: hand" alt="" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhWw_6t6BGKBbzQAfAdhsU1TPbXmfiQkLksRE9-DERX1_0R_W2NNvNqFhgcfABsHgQ2nXKrDQMZ1uiCmpE1Yj1gIsbDo82fKl7xha7X8-3tqQVviHyVCYbmP9zQeyeR15et23Y_wvaWy-w/s400/emptystackpan.jpg" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;span style="font-family:verdana;font-size:85%;"&gt;Now with the &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_101"&gt;&lt;strong&gt;ItemTemplate&lt;/strong&gt;&lt;/span&gt; selected right click and &lt;strong&gt;Paste&lt;/strong&gt; the the &lt;strong&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_102"&gt;NewTemplate&lt;/span&gt;&lt;/strong&gt; we created in the new window into the &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_103"&gt;ItemTemplate&lt;/span&gt;. &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_104"&gt;&lt;strong&gt;Resize&lt;/strong&gt;&lt;/span&gt; the new template to fit in side the layout of your panel. &lt;/span&gt;&lt;span style="font-family:Verdana;font-size:85%;"&gt;Your Objects and &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_105"&gt;Timelines&lt;/span&gt; view should look like the following shot.&lt;br /&gt;&lt;a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjK_NGmFNzY-XLkl0R8u6MjYKzSpG_uyJn6mic-anoGdwa0wBCWrk2mc97wzqdXjad6KkTuh6rg0CAkTQHQaJBc6j0pzB-ymvjXZAibEFZ_MMAaUwPx2GQF-AnipJTTFu1e6c7OgoXXYWk/s1600-h/newitemtemplate.jpg"&gt;&lt;img id="BLOGGER_PHOTO_ID_5208664351813783810" style="CURSOR: hand" alt="" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjK_NGmFNzY-XLkl0R8u6MjYKzSpG_uyJn6mic-anoGdwa0wBCWrk2mc97wzqdXjad6KkTuh6rg0CAkTQHQaJBc6j0pzB-ymvjXZAibEFZ_MMAaUwPx2GQF-AnipJTTFu1e6c7OgoXXYWk/s400/newitemtemplate.jpg" border="0" /&gt;&lt;/a&gt; &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:verdana;font-size:85%;"&gt;Now this where the &lt;strong&gt;fun&lt;/strong&gt; begins. If you run it here you will not see any data because we have not bound the template controls to the &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_106"&gt;datasource&lt;/span&gt;. Remember this is a new &lt;strong&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_107"&gt;DataTemplate&lt;/span&gt;&lt;/strong&gt; we are building, the bindings we had before were lost when we deleted the old &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_108"&gt;stackpanel&lt;/span&gt;. So we have to bind the controls in the &lt;strong&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_109"&gt;NewItemTemplate&lt;/span&gt;&lt;/strong&gt; to our &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_110"&gt;DataSource&lt;/span&gt;.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:Verdana;font-size:85%;"&gt;&lt;em&gt;Its pretty easy.&lt;/em&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:Verdana;"&gt;&lt;strong&gt;Click&lt;/strong&gt; on the &lt;strong&gt;Name&lt;/strong&gt; &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_111"&gt;TextBlock&lt;/span&gt;. Under the Common Properties section in the Properties Editor, locate the &lt;strong&gt;Text&lt;/strong&gt; attribute and click the little &lt;strong&gt;yellow&lt;/strong&gt; icon on the right. Click the &lt;strong&gt;Data Binding&lt;/strong&gt; menu item and the &lt;strong&gt;Create Data Binding&lt;/strong&gt; form will be displayed. Expand the &lt;strong&gt;fields&lt;/strong&gt; tree &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_112"&gt;untill&lt;/span&gt; you see the &lt;strong&gt;Name&lt;/strong&gt; field, click it, and select Finish. Do this for all the &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_113"&gt;TextBlock&lt;/span&gt; controls. With the &lt;strong&gt;Image&lt;/strong&gt; control its the same &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_114"&gt;proceedure&lt;/span&gt; but the binding is done with the &lt;strong&gt;Source&lt;/strong&gt; property.&lt;br /&gt;&lt;img id="BLOGGER_PHOTO_ID_5208622235364479090" style="CURSOR: hand" alt="" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj-op_yTkyxMKSSxu4GwbUiWO19HdSCTFJo2TaTL19w0x-OAjCZi9FWOks359lJ7BdY9ZMCQ_NAS-_GgHhvit57vLZD4UK3WqsFQlkDGkn-hGz2pz3i7Qc7CV6QdSoQZFaXrJG6leHu3Fc/s400/imageProps.jpg" border="0" /&gt; &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:verdana;"&gt;With all the Controls now &lt;strong&gt;bound&lt;/strong&gt; to their &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_115"&gt;&lt;strong&gt;datasource&lt;/strong&gt;&lt;/span&gt; counterparts you can run the application, Press &lt;strong&gt;Control+S&lt;/strong&gt; to &lt;strong&gt;Save&lt;/strong&gt; and &lt;strong&gt;F5&lt;/strong&gt; to &lt;strong&gt;Run&lt;/strong&gt;. It should resemble the following shot&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:verdana;font-size:85%;"&gt;. &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:verdana;font-size:85%;"&gt;I know, it doesn't look much different than the previous one. I just wanted to demonstrate how you can create a new DataTemplate. I'll leave the Bells and Wistles to You.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:verdana;font-size:85%;"&gt;&lt;br /&gt;&lt;a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhyJ0qsgaATKH49PElh35GTbXV-IEvKczHxepAwWqLoX7dh8Jk6bUpkVo0vZ67YjLznjAEOjeM_D87qxpwGZ-uuf8Sr9bPP3xJMX2f7hM0Nua7zz4erUeA1Z7xyHAhfFb31wkXcgoJ0bxY/s1600-h/newListBox.jpg"&gt;&lt;img id="BLOGGER_PHOTO_ID_5208669833518130018" style="CURSOR: hand" alt="" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhyJ0qsgaATKH49PElh35GTbXV-IEvKczHxepAwWqLoX7dh8Jk6bUpkVo0vZ67YjLznjAEOjeM_D87qxpwGZ-uuf8Sr9bPP3xJMX2f7hM0Nua7zz4erUeA1Z7xyHAhfFb31wkXcgoJ0bxY/s400/newListBox.jpg" border="0" /&gt;&lt;/a&gt; &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:verdana;"&gt;&lt;span style="font-size:85%;"&gt;If you scroll you will only see one item at a time, not the list as in the first instance.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:verdana;"&gt;&lt;span style="font-size:85%;"&gt;So we have finished creating a new &lt;strong&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_116"&gt;DataTemplate&lt;/span&gt;&lt;/strong&gt; and assigned it to the &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_117"&gt;ListBoxes&lt;/span&gt; &lt;strong&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_118"&gt;ItemTemplate&lt;/span&gt;&lt;/strong&gt;. A new &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_119"&gt;DynamicResource&lt;/span&gt; named &lt;strong&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_120"&gt;ProductTemplate&lt;/span&gt;&lt;/strong&gt; exists and below is the syntax on the assignment to a &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_121"&gt;ListBox&lt;/span&gt;. &lt;span style="color:#000099;"&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_122"&gt;&lt;strong&gt;Itemtemplate&lt;/strong&gt;&lt;/span&gt;="{&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_123"&gt;DynamicResource&lt;/span&gt; &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_124"&gt;ProductTemplate&lt;/span&gt;}" &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color:#000000;"&gt;&lt;span style="font-family:verdana;"&gt;&lt;span style="font-size:85%;"&gt;&lt;strong&gt;Click&lt;/strong&gt; on the following image to see the &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_125"&gt;DataTemplate&lt;/span&gt; &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_126"&gt;XAML.&lt;br /&gt;&lt;a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhAQAWT-Boxwkp4I2FBLOyzMgk3O9bn2VBCj6NlD9pXD1MBmW7PYlYSWw6n9a2Co73kqZkjB2A78OB84K5yQ9Xvcz7q9lCELH8XjBZA6CxYTa8hyphenhyphenrCUoJBA2oDsuobzySzlUmviivCittY/s1600-h/xamldatatemplate.jpg"&gt;&lt;img id="BLOGGER_PHOTO_ID_5209786810375929186" style="CURSOR: hand" alt="" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhAQAWT-Boxwkp4I2FBLOyzMgk3O9bn2VBCj6NlD9pXD1MBmW7PYlYSWw6n9a2Co73kqZkjB2A78OB84K5yQ9Xvcz7q9lCELH8XjBZA6CxYTa8hyphenhyphenrCUoJBA2oDsuobzySzlUmviivCittY/s400/xamldatatemplate.jpg" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;&lt;strong&gt;Not Finished YET. We now have to create a new&lt;/strong&gt; &lt;strong&gt;&lt;span style="color:#000099;"&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_127"&gt;ItemContainerStyle&lt;/span&gt;&lt;/span&gt;. &lt;/strong&gt;&lt;/span&gt;&lt;span style="font-family:verdana;font-size:85%;"&gt;In &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_128"&gt;WPF&lt;/span&gt;, the &lt;strong&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_129"&gt;ControlTemplate&lt;/span&gt;&lt;/strong&gt; of a control defines the appearance of the control. You can change the structure and appearance of a control by defining a new &lt;strong&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_130"&gt;ControlTemplate&lt;/span&gt;&lt;/strong&gt; for the control. &lt;/span&gt;&lt;span style="font-family:verdana;font-size:85%;"&gt;I am not going to copy the design of the &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_131"&gt;&lt;strong&gt;FurnitureShowRoom&lt;/strong&gt;&lt;/span&gt; but I will try to copy the behaviour. That is, we will create a &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_132"&gt;ControlTemplate&lt;/span&gt; for a &lt;strong&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_133"&gt;TargetType&lt;/span&gt;="{x:Type &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_134"&gt;ListBoxItem&lt;/span&gt;}"&lt;/strong&gt; and also pull apart the &lt;strong&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_135"&gt;ListBox&lt;/span&gt;&lt;/strong&gt; &lt;strong&gt;Vertical&lt;/strong&gt;&lt;strong&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_136"&gt;ScrollBar&lt;/span&gt;&lt;/strong&gt; and extract the bits we need and hide the rest. &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:verdana;font-size:85%;"&gt;&lt;strong&gt;First&lt;/strong&gt; thing to do is get rid of that selection background when we click on a list item. The blue color can be changed to any color you like. But I think we wont need it because we are not going to use the &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_137"&gt;scrollbar&lt;/span&gt; at all. &lt;em&gt;At least not the way you think&lt;/em&gt;.&lt;br /&gt;What we need to do so we don't have the blue background when an item is selected is change the Background color on the &lt;strong&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_138"&gt;IsSelected&lt;/span&gt;&lt;/strong&gt; Trigger property.&lt;br /&gt;To drill down to the &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_139"&gt;&lt;strong&gt;ItemContainerStyle&lt;/strong&gt;&lt;/span&gt; &lt;strong&gt;Click&lt;/strong&gt; on the &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_140"&gt;ListBox&lt;/span&gt; and select the menu items in the screen shot below to get down to that level. &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:verdana;font-size:85%;"&gt;(&lt;strong&gt;TIP&lt;/strong&gt;: To get back to the &lt;strong&gt;ListBox&lt;/strong&gt; root, click the icon &lt;img id="BLOGGER_PHOTO_ID_5209325313402532802" style="CURSOR: hand" alt="" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj6viBxbRijPhiIp8fF1pQw-3IKY-ioWf667Bs9EpXpQ2Hch0etSz9p4MGljfdhf1qBoM9sASN0wWJIPG3IvAxXWiAOhJgHf38hruEn1zyPUy9mdBPe7qaBGuXYRzJz-I0Y4F_Qh9eDBVA/s200/getBack.jpg" border="0" /&gt; in Objects and Timelines).&lt;br /&gt;&lt;br /&gt;&lt;a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgfoj6Sy_gorjko000A-em0aO9H9g8930g4CVk5l5qNVupRlPYy6RN2L14V3s6d0XXorvzbxC7X8ElxNzIDRinDaq4D1JT7-ib3MFVqMiJx5Z7yDJ70ZqkV3aOoFBQ8nqjcTwq4-_K-NLs/s1600-h/itemContainerStyle1.jpg"&gt;&lt;img id="BLOGGER_PHOTO_ID_5208986351109407794" style="CURSOR: hand" alt="" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgfoj6Sy_gorjko000A-em0aO9H9g8930g4CVk5l5qNVupRlPYy6RN2L14V3s6d0XXorvzbxC7X8ElxNzIDRinDaq4D1JT7-ib3MFVqMiJx5Z7yDJ70ZqkV3aOoFBQ8nqjcTwq4-_K-NLs/s400/itemContainerStyle1.jpg" border="0" /&gt;&lt;/a&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:verdana;font-size:85%;"&gt;&lt;strong&gt;Next&lt;/strong&gt; right click on the &lt;strong&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_141"&gt;ItemContainerStyle&lt;/span&gt;&lt;/strong&gt; and select the menu items as the following screen shows.&lt;br /&gt;&lt;a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjkcmsT-YBG13iGZuqEAUJgmDCPjMYfM5Jf_RK7f7qli49fM5AsXhvE-fMAvTUCXrDV3u5wswPqbjB0CDOMQG3RhzfevAFqNLA57erwi0zqKNwRG6PysqSc293PuLwASBC6EdApv9vVMCM/s1600-h/itemContainerStyleFirstBD.jpg"&gt;&lt;img id="BLOGGER_PHOTO_ID_5208988668853233858" style="CURSOR: hand" alt="" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjkcmsT-YBG13iGZuqEAUJgmDCPjMYfM5Jf_RK7f7qli49fM5AsXhvE-fMAvTUCXrDV3u5wswPqbjB0CDOMQG3RhzfevAFqNLA57erwi0zqKNwRG6PysqSc293PuLwASBC6EdApv9vVMCM/s400/itemContainerStyleFirstBD.jpg" border="0" /&gt;&lt;/a&gt; &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:verdana;font-size:85%;"&gt;&lt;strong&gt;Next&lt;/strong&gt; click on the &lt;strong&gt;ContentPresenter&lt;/strong&gt; object in the Template and then click the &lt;strong&gt;IsSelected&lt;/strong&gt; property in the Triggers section. You will see in the &lt;strong&gt;Properties when active&lt;/strong&gt; section displayed and the &lt;strong&gt;&lt;em&gt;Bd.Background = #FF454545&lt;/em&gt;&lt;/strong&gt; property. We need to set this value to either an &lt;strong&gt;opacity&lt;/strong&gt; of 0&lt;strong&gt;%&lt;/strong&gt; or change the value to your background color of choice. If you click on the &lt;strong&gt;&lt;em&gt;Bd.Background&lt;/em&gt;&lt;/strong&gt; property you will see the main properties in the &lt;strong&gt;Properties Editor&lt;/strong&gt; change to reflect the current state. &lt;/span&gt;&lt;span style="font-family:verdana;font-size:85%;"&gt;&lt;a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj8PDVQ2cbamMf9txkXHbjwKLWGGQ3X8to0r7s5R9wGQVCU9WLxvtIGG1h8spB4fO-w3zf6bR2tBEmt-eJCUFPWowY71sIAfqIm_HAoPpLWpbMTUgGg64U0lMSrJxRjiRF2tVM5qFt7tLw/s1600-h/itemContainerStyleBDTrigger.jpg"&gt;&lt;img id="BLOGGER_PHOTO_ID_5208989064070770082" style="CURSOR: hand" alt="" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj8PDVQ2cbamMf9txkXHbjwKLWGGQ3X8to0r7s5R9wGQVCU9WLxvtIGG1h8spB4fO-w3zf6bR2tBEmt-eJCUFPWowY71sIAfqIm_HAoPpLWpbMTUgGg64U0lMSrJxRjiRF2tVM5qFt7tLw/s400/itemContainerStyleBDTrigger.jpg" border="0" /&gt;&lt;/a&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:verdana;font-size:85%;"&gt;&lt;strong&gt;TIP&lt;/strong&gt;: If you want to get to a particular property you can search for it by typing the property name in the &lt;strong&gt;search&lt;/strong&gt; textbox provided, as shown below. This will display the Properties editor where you can modify the values. For now set the &lt;strong&gt;A color&lt;/strong&gt; of the &lt;strong&gt;Background&lt;/strong&gt; color to &lt;strong&gt;0%&lt;/strong&gt;.&lt;/span&gt; &lt;span style="font-size:0;"&gt;&lt;a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhWYSzcDVmDbvegZLbL-ck6hdqFcKSPykjFjDAkiLPr4r2fnoY5iG8OUYDVcuZCo-DO2Ls0se3KLZMbKH_df8wWaIRB4t9qwBStJiHUaDowywYvr4hKWaTrpyJdMULxrT8lT11Q0pq01SQ/s1600-h/BackgndSearch.jpg"&gt;&lt;img id="BLOGGER_PHOTO_ID_5209001388808888434" style="CURSOR: hand" alt="" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhWYSzcDVmDbvegZLbL-ck6hdqFcKSPykjFjDAkiLPr4r2fnoY5iG8OUYDVcuZCo-DO2Ls0se3KLZMbKH_df8wWaIRB4t9qwBStJiHUaDowywYvr4hKWaTrpyJdMULxrT8lT11Q0pq01SQ/s400/BackgndSearch.jpg" border="0" /&gt;&lt;/a&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:Verdana;font-size:85%;"&gt;Press &lt;strong&gt;Control+S&lt;/strong&gt; to and &lt;strong&gt;F5&lt;/strong&gt; to test your changes. you should see no change in the Background of the selected item. If you need to roll back to the original settings keep pressing &lt;strong&gt;Control+Z&lt;/strong&gt; until you get back to the start. &lt;/span&gt;&lt;span style="font-family:Verdana;font-size:85%;"&gt;If you have a neutral background leave it there and get back to the ListBox. &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:Verdana;font-size:85%;"&gt;&lt;strong&gt;TIP&lt;/strong&gt;: To get back to the ListBox root, click the icon &lt;img id="BLOGGER_PHOTO_ID_5209325313402532802" style="CURSOR: hand" alt="" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj6viBxbRijPhiIp8fF1pQw-3IKY-ioWf667Bs9EpXpQ2Hch0etSz9p4MGljfdhf1qBoM9sASN0wWJIPG3IvAxXWiAOhJgHf38hruEn1zyPUy9mdBPe7qaBGuXYRzJz-I0Y4F_Qh9eDBVA/s200/getBack.jpg" border="0" /&gt; in Objects and Timelines.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:Verdana;font-size:85%;"&gt;Open up the &lt;strong&gt;XAML&lt;/strong&gt; code view and search for the new &lt;strong&gt;ControlTemplate&lt;/strong&gt; of TargetType="{x:Type &lt;strong&gt;ListBoxItem&lt;/strong&gt;}, this is your new style for the Selected ListItem. &lt;/span&gt;&lt;span style="font-family:Verdana;font-size:85%;"&gt;The following screen shot shows the XAML that was created from the previous exercise.&lt;br /&gt;&lt;a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhl0KBiPJZdDakYqP8nR_oMbFdHHAmiVbWRGFicY8E1Iiji6JddnKgBuucwaQsxdg0VBV6kA_49E07Rt-MC-raR_NJx1gRHvXTPirheJ5pss2BZK2b5WrytWbaBqNwUC5q0CHC_uxRfldA/s1600-h/XAMLBdRemoved.jpg"&gt;&lt;img id="BLOGGER_PHOTO_ID_5210005736373715234" style="CURSOR: hand" alt="" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhl0KBiPJZdDakYqP8nR_oMbFdHHAmiVbWRGFicY8E1Iiji6JddnKgBuucwaQsxdg0VBV6kA_49E07Rt-MC-raR_NJx1gRHvXTPirheJ5pss2BZK2b5WrytWbaBqNwUC5q0CHC_uxRfldA/s400/XAMLBdRemoved.jpg" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:verdana;font-size:130%;"&gt;&lt;strong&gt;&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;em&gt;&lt;span style="font-family:verdana;"&gt;&lt;strong&gt;At this point you might want to get another Jug of Coffee.&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;/em&gt;&lt;br /&gt;&lt;span style="font-family:Verdana;font-size:85%;"&gt;&lt;strong&gt;Next&lt;/strong&gt; we will grab the &lt;strong&gt;Up&lt;/strong&gt; and &lt;strong&gt;Down&lt;/strong&gt; buttons that a part of the &lt;strong&gt;VerticalScrollBar&lt;/strong&gt; and replace them with our own. Like in the &lt;strong&gt;FurnitureShowRoom&lt;/strong&gt; screen shot&lt;strong&gt;.&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:verdana;font-size:85%;"&gt;We want to re-style the control below so as to use the Commands for the up and down repeatbuttons but be able to locate those buttons any where on our form and not in the scroll bar itself. That means we have to hide the scroll bar and re-style the templates that hold the repeatbuttons. So we will need to drill doen to the PART_Track of vertical scroll bar.&lt;/span&gt;&lt;br /&gt;&lt;a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgnqppLIcVi7aP1WrpoNnZl_PwziMNoVThNBrPcqnC9vKJie686OmTzDe7kyMkyeZkVl3c9iap92yIiqdpVuqO6XpP7hOtJMEqm3lpEdK7_IKjqwdkCF2KRLiQ2nmErhmfcBrErbsvCr1I/s1600-h/Scroll.png"&gt;&lt;img id="BLOGGER_PHOTO_ID_5209664576607452610" style="CURSOR: hand" alt="" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgnqppLIcVi7aP1WrpoNnZl_PwziMNoVThNBrPcqnC9vKJie686OmTzDe7kyMkyeZkVl3c9iap92yIiqdpVuqO6XpP7hOtJMEqm3lpEdK7_IKjqwdkCF2KRLiQ2nmErhmfcBrErbsvCr1I/s400/Scroll.png" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;span style="font-family:Verdana;font-size:85%;"&gt;&lt;strong&gt;First:&lt;/strong&gt; Click on the &lt;strong&gt;ListBox&lt;/strong&gt; object in &lt;em&gt;Objects and Timelines&lt;/em&gt; so it is highlighted. In the &lt;strong&gt;Properties Editor&lt;/strong&gt; type scroll in the &lt;strong&gt;Search&lt;/strong&gt; box. This will display the Layout properties for the Horizontal and Vertical Scroll bars. Select the &lt;strong&gt;HorizontalScrollBarVisibility&lt;/strong&gt; property and &lt;strong&gt;Disable&lt;/strong&gt; it. This will prevent the bottom scroll bar from being displayed.&lt;br /&gt;&lt;a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhfcpZNaayH3q10eLJIikYL6_MJgNEzKU9hp0UgdZ-N-BoANpZaVRYOiQaPcnbO5ADSucOnGOuyUgBwaXaeeabh-ev2kfJI7hhlAUzY3TDDyt6DTpzfuURYHFDc3E3RlKRNO1kEYDSVY0k/s1600-h/scrollbarlayout.jpg"&gt;&lt;img id="BLOGGER_PHOTO_ID_5209009386997565218" style="CURSOR: hand" alt="" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhfcpZNaayH3q10eLJIikYL6_MJgNEzKU9hp0UgdZ-N-BoANpZaVRYOiQaPcnbO5ADSucOnGOuyUgBwaXaeeabh-ev2kfJI7hhlAUzY3TDDyt6DTpzfuURYHFDc3E3RlKRNO1kEYDSVY0k/s400/scrollbarlayout.jpg" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:verdana;font-size:85%;"&gt;&lt;strong&gt;Next:&lt;/strong&gt; We are going to create a new &lt;strong&gt;ControlTemplate&lt;/strong&gt; of TargetType="{x:Type &lt;strong&gt;ListBox&lt;/strong&gt;}" and re-style the ScrollBars particularly the ScrollViewer by creating a &lt;strong&gt;ControlTemplate&lt;/strong&gt; of TargetType="{x:Type &lt;strong&gt;ScrollViewer&lt;/strong&gt;}"&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:verdana;font-size:85%;"&gt;We are going to create a Style resource with a &lt;strong&gt;Key&lt;/strong&gt; named &lt;strong&gt;ListBoxStyleScrollBarModify&lt;/strong&gt;.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:Verdana;font-size:85%;"&gt;&lt;strong&gt;&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:Verdana;font-size:85%;"&gt;&lt;strong&gt;Right&lt;/strong&gt; click on the &lt;strong&gt;ListBox&lt;/strong&gt; control in &lt;em&gt;Objects and Timelines&lt;/em&gt; and follow the menu selection in the screen shot below.&lt;br /&gt;&lt;a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiwB80TmqG-xOLXUfNgkKKDB50AJqqljcaq-U7OjxZwqFD12icX1WPKyarNrHb4Wj6JlFfC2fZZXP5dp-nQoCcN-QSkKPwAhvNxtqDoc0IDe4wIODlflX32Qe-dGenXlE6v2_7O-oril88/s1600-h/newScrollbartemplate.jpg"&gt;&lt;img id="BLOGGER_PHOTO_ID_5209334670212157634" style="CURSOR: hand" alt="" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiwB80TmqG-xOLXUfNgkKKDB50AJqqljcaq-U7OjxZwqFD12icX1WPKyarNrHb4Wj6JlFfC2fZZXP5dp-nQoCcN-QSkKPwAhvNxtqDoc0IDe4wIODlflX32Qe-dGenXlE6v2_7O-oril88/s400/newScrollbartemplate.jpg" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/span&gt;&lt;strong&gt;&lt;span style="font-family:verdana;font-size:85%;"&gt;Type Name the style as follows.&lt;/span&gt;&lt;br /&gt;&lt;/strong&gt;&lt;a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhRYJo0J2Ex-n4BTHmPD_VrQ-mHnLedEKK09ftCafUrJn6SMBcyf8ROdlGkjcGAVbMc0zqZXkdm5APsdrhVjeTl8Jf67t94etgsFbLwrv83X41G0PRxXtuyTSFYW1rtzHcgQ89CT2KMFDc/s1600-h/createstyleres.jpg"&gt;&lt;img id="BLOGGER_PHOTO_ID_5209335516547432578" style="CURSOR: hand" alt="" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhRYJo0J2Ex-n4BTHmPD_VrQ-mHnLedEKK09ftCafUrJn6SMBcyf8ROdlGkjcGAVbMc0zqZXkdm5APsdrhVjeTl8Jf67t94etgsFbLwrv83X41G0PRxXtuyTSFYW1rtzHcgQ89CT2KMFDc/s400/createstyleres.jpg" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;span style="font-family:verdana;font-size:85%;"&gt;Basically what we need to do is set the &lt;strong&gt;ScrollBarBackground&lt;/strong&gt; to &lt;strong&gt;Transparent&lt;/strong&gt;, hide the &lt;strong&gt;Thumb&lt;/strong&gt; and re-style the &lt;strong&gt;RepeatButtons&lt;/strong&gt;. &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:Verdana;font-size:85%;"&gt;With our &lt;strong&gt;ListBoxStyleScrollBarModify&lt;/strong&gt; created lets begin.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:Verdana;font-size:85%;"&gt;&lt;strong&gt;&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:Verdana;font-size:85%;"&gt;&lt;strong&gt;First:&lt;/strong&gt; we will set the &lt;strong&gt;ScrollBarBackground&lt;/strong&gt; to no brush and hide the &lt;strong&gt;Thumb&lt;/strong&gt;.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:Verdana;font-size:85%;"&gt;&lt;strong&gt;Right click&lt;/strong&gt; on &lt;strong&gt;[ScrollViewer] &lt;/strong&gt;and select the following menu items.&lt;br /&gt;&lt;a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhNV44HREMj02mChu36L9ugChQxD5O5g23HCGj6pFJ6DfS6lgXgFlvdN3gOIGQ_7pvRfE8tbL6WVGYRDkqZXLHc55sGF_YuujLuhvNehpKk2mJSNQfoOaA9M4g-CclI6ANAaREAks3WvBw/s1600-h/editScrollPartTemplate.jpg"&gt;&lt;img id="BLOGGER_PHOTO_ID_5209342553390183858" style="CURSOR: hand" alt="" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhNV44HREMj02mChu36L9ugChQxD5O5g23HCGj6pFJ6DfS6lgXgFlvdN3gOIGQ_7pvRfE8tbL6WVGYRDkqZXLHc55sGF_YuujLuhvNehpKk2mJSNQfoOaA9M4g-CclI6ANAaREAks3WvBw/s400/editScrollPartTemplate.jpg" border="0" /&gt;&lt;/a&gt; &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:Verdana;font-size:85%;"&gt;&lt;strong&gt;Click&lt;/strong&gt; &lt;strong&gt;OK&lt;/strong&gt; to the Control Template Resource name &lt;strong&gt;ScrollViewerControlTemplate1&lt;/strong&gt;.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:Verdana;font-size:85%;"&gt;&lt;strong&gt;Now &lt;/strong&gt;we should see a &lt;strong&gt;Grid&lt;/strong&gt; with the&lt;strong&gt; PART_VerticalScrollBar. We &lt;/strong&gt;need to&lt;strong&gt; hide&lt;/strong&gt; the &lt;strong&gt;Background&lt;/strong&gt; of this part&lt;strong&gt;.&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:Verdana;font-size:85%;"&gt;&lt;strong&gt;Next:&lt;/strong&gt; right click on the &lt;strong&gt;"PART_VerticalScrollBar"&lt;/strong&gt; and select the menu items as follows&lt;strong&gt;;&lt;/strong&gt; &lt;/span&gt;&lt;br /&gt;&lt;a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi0_V7FQ0tpvx24p4hndFf-Lo6K5urYK81qErn2vnb6gyy5ateLA5srGMAjMebaYVsN-XDuPjNAjZHHZMn12wbaeKXqTcB0NXsc8Zscd_Nhz4IM61lLgljjIMH28WtyT0FglG69thVae2A/s1600-h/EditPartVertScrollbarTemplate.jpg"&gt;&lt;img id="BLOGGER_PHOTO_ID_5209345254977593698" style="CURSOR: hand" alt="" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi0_V7FQ0tpvx24p4hndFf-Lo6K5urYK81qErn2vnb6gyy5ateLA5srGMAjMebaYVsN-XDuPjNAjZHHZMn12wbaeKXqTcB0NXsc8Zscd_Nhz4IM61lLgljjIMH28WtyT0FglG69thVae2A/s400/EditPartVertScrollbarTemplate.jpg" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;span style="font-family:verdana;font-size:85%;"&gt;Except the &lt;strong&gt;ScrollBarStyle1&lt;/strong&gt; name and press &lt;strong&gt;OK&lt;/strong&gt;.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:verdana;font-size:85%;"&gt;We should now be at the level that makes up the Control Parts.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:Verdana;font-size:85%;"&gt;&lt;strong&gt;&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:Verdana;font-size:85%;"&gt;&lt;strong&gt;Click&lt;/strong&gt; on "&lt;strong&gt;Bg"&lt;/strong&gt; under Template, and in the &lt;strong&gt;&lt;em&gt;Properties Editor&lt;/em&gt;&lt;/strong&gt; locate the &lt;strong&gt;Background&lt;/strong&gt; brush and select &lt;strong&gt;&lt;em&gt;No Brush&lt;/em&gt;&lt;/strong&gt;. This will make it Transparent. You may have to click on the the little icon on the right of Background Brush and select &lt;strong&gt;Reset&lt;/strong&gt; in the context menu, but basically you need to have the Background set to No-Brush.&lt;br /&gt;&lt;a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgzDBEF4Cz0UIeGZiT_lhho7imbrJCPrkINcWETM2jSsFX0BAyhx3knH0Pp9d95az8Ppf9KHE9eBIQrooZZfwigm4k9TABgAUv1lTkNTu5lEJY74KrysglTmqFhS1xZjRO6GSPhCXkblGU/s1600-h/bgNoBrush.jpg"&gt;&lt;img id="BLOGGER_PHOTO_ID_5209677473372943234" style="CURSOR: hand" alt="" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgzDBEF4Cz0UIeGZiT_lhho7imbrJCPrkINcWETM2jSsFX0BAyhx3knH0Pp9d95az8Ppf9KHE9eBIQrooZZfwigm4k9TABgAUv1lTkNTu5lEJY74KrysglTmqFhS1xZjRO6GSPhCXkblGU/s400/bgNoBrush.jpg" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:Verdana;font-size:85%;"&gt;&lt;/span&gt;&lt;span style="font-family:verdana;font-size:85%;"&gt;&lt;strong&gt;Click&lt;/strong&gt; on the &lt;strong&gt;Part_Track&lt;/strong&gt;. &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:verdana;font-size:85%;"&gt;Go to the &lt;strong&gt;Properties Editor &lt;/strong&gt;&lt;/span&gt;&lt;span style="font-family:Verdana;font-size:85%;"&gt;and scroll down untill you find the &lt;strong&gt;Visibility&lt;/strong&gt; property. &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:Verdana;font-size:85%;"&gt;Set it to &lt;strong&gt;Collapsed&lt;/strong&gt;.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:verdana;"&gt;If you run the application now a&lt;/span&gt;&lt;span style="font-family:Verdana;"&gt;&lt;span style="font-family:verdana;"&gt;ll that should be visible are the two &lt;strong&gt;RepeatButton&lt;/strong&gt; controls.&lt;/span&gt; &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:Verdana;font-size:85%;"&gt;&lt;strong&gt;Next:&lt;/strong&gt; right click on the &lt;strong&gt;RepeatButton&lt;/strong&gt; and follow the menu selection below.&lt;br /&gt;&lt;a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg8xfE5heY0l-2q7Aq-3oz8OX73Y2TE6rH9URQQrheBUJwJkiVNjDN48Gj64o7ryZ6hPUcd7LFdG3qfe6gl0ohLNaAbEf8ReJ813XwSBPRBMkPWtHUHHKE6NzIz48Qq7HTF6yBAdrR6ruU/s1600-h/EditRepeatButtonTemplates.jpg"&gt;&lt;img id="BLOGGER_PHOTO_ID_5209349578468178914" style="CURSOR: hand" alt="" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg8xfE5heY0l-2q7Aq-3oz8OX73Y2TE6rH9URQQrheBUJwJkiVNjDN48Gj64o7ryZ6hPUcd7LFdG3qfe6gl0ohLNaAbEf8ReJ813XwSBPRBMkPWtHUHHKE6NzIz48Qq7HTF6yBAdrR6ruU/s400/EditRepeatButtonTemplates.jpg" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;The &lt;strong&gt;Template&lt;/strong&gt; for the RepeatButtons is as follows.&lt;br /&gt;&lt;a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg6JYYiOI9pJrKOx7d1jlDs96REwWc4RuMbExKYbJT59j4HrbMzXlzf9NBkXaXy3V01wk-NXe3ynDf1dyyeRX2hCJD7TdUtBJcFfU13uaOB9JMWm2U8_vaZE9VfbZivqwEbhcdsSyNi6Rc/s1600-h/RepeatButChrome.jpg"&gt;&lt;img id="BLOGGER_PHOTO_ID_5209350074744250066" style="CURSOR: hand" alt="" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg6JYYiOI9pJrKOx7d1jlDs96REwWc4RuMbExKYbJT59j4HrbMzXlzf9NBkXaXy3V01wk-NXe3ynDf1dyyeRX2hCJD7TdUtBJcFfU13uaOB9JMWm2U8_vaZE9VfbZivqwEbhcdsSyNi6Rc/s400/RepeatButChrome.jpg" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;strong&gt;Next:&lt;/strong&gt; Click and delete the default style named "&lt;strong&gt;Chrome"&lt;/strong&gt;. &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:Verdana;font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:verdana;font-size:85%;"&gt;Now there is one problem. We have an empty Template so we can't just add our new Buttons to it, we have to add a container first. So double click on the &lt;strong&gt;Template&lt;/strong&gt; object and select a new &lt;strong&gt;Grid&lt;/strong&gt; control from the &lt;strong&gt;Asset&lt;/strong&gt; library. &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:Verdana;font-size:85%;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:verdana;font-size:85%;"&gt;We will add a &lt;strong&gt;Grid&lt;/strong&gt; to the Template. You can either draw the Grid in the Template or &lt;/span&gt;&lt;span style="font-family:verdana;font-size:85%;"&gt;double click on the &lt;strong&gt;Grid&lt;/strong&gt; control from the Asset library so it is placed inside the &lt;strong&gt;RepeatButton's&lt;/strong&gt; Template.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:Verdana;font-size:85%;"&gt;&lt;strong&gt;&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:verdana;font-size:85%;"&gt;It should look like the following screen shot.&lt;/span&gt;&lt;br /&gt;&lt;a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgb94Qd-KPVbYbcfhqSFiiunAnO_VVUSxpdZfE4EOMOLkQCtfKSC9z4kY5GCM8_mzQuQ9KD4Zh2lpiYm6DUeFyVAiH2cU9ZeSKjLgji7zEM0lx2hvNGvQ4c1Ri9Pk2r3K_jTWGjuacWhGE/s1600-h/RepeatButGrid.jpg"&gt;&lt;img id="BLOGGER_PHOTO_ID_5210017172372533986" style="CURSOR: hand" alt="" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgb94Qd-KPVbYbcfhqSFiiunAnO_VVUSxpdZfE4EOMOLkQCtfKSC9z4kY5GCM8_mzQuQ9KD4Zh2lpiYm6DUeFyVAiH2cU9ZeSKjLgji7zEM0lx2hvNGvQ4c1Ri9Pk2r3K_jTWGjuacWhGE/s400/RepeatButGrid.jpg" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:verdana;font-size:85%;"&gt;&lt;strong&gt;Next&lt;/strong&gt;: I created a &lt;strong&gt;Path&lt;/strong&gt; object to represent my new &lt;strong&gt;RepeatButtons&lt;/strong&gt;.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:verdana;font-size:85%;"&gt;It is basically the &lt;strong&gt;Left Arrow&lt;/strong&gt; from Celso's &lt;strong&gt;FurnitureShowRoom&lt;/strong&gt; sample. &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:verdana;font-size:85%;"&gt;&lt;strong&gt;Click&lt;/strong&gt; on the following image to view the Path XAML.&lt;br /&gt;&lt;a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiJryjHJXRIDRmOQsv79j2wRVOV-9CA0U1DsUDQQ3fde0Z9WqYFM9xD0aIfkWGG7qATByh_lUIDdk_igZk2Um8bTOHkkga180xOaOb671BurIk6VjfJtEUYXbcSfNPJZarn_lgYM3mWvTc/s1600-h/LeftArrow.jpg"&gt;&lt;img id="BLOGGER_PHOTO_ID_5209792137655486338" style="CURSOR: hand" alt="" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiJryjHJXRIDRmOQsv79j2wRVOV-9CA0U1DsUDQQ3fde0Z9WqYFM9xD0aIfkWGG7qATByh_lUIDdk_igZk2Um8bTOHkkga180xOaOb671BurIk6VjfJtEUYXbcSfNPJZarn_lgYM3mWvTc/s400/LeftArrow.jpg" border="0" /&gt;&lt;/a&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:verdana;font-size:85%;"&gt;You can use this to place inside the Grid container.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:verdana;"&gt;&lt;span style="font-size:85%;"&gt;&lt;strong&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:verdana;font-size:85%;"&gt;Let's create a temporary window to hold this piece of XAML.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:verdana;"&gt;&lt;span style="font-size:85%;"&gt;&lt;strong&gt;First:&lt;/strong&gt;&lt;/span&gt; &lt;span style="font-size:85%;"&gt;Select the Project name "&lt;strong&gt;CustomListBox&lt;/strong&gt;" right click and &lt;strong&gt;Add New Item&lt;/strong&gt;.&lt;/span&gt; &lt;span style="font-size:85%;"&gt;We are going to&lt;/span&gt; c&lt;span style="font-size:85%;"&gt;reate a new window and replace the Grid XAML with something like the above image. &lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;grid&gt;&lt;path margin="200.896,176.936,0,213.562" name="arrow_left" stretch="Fill" fill="#4D000000" data="F1 M 200.896,206.27L 246.873,230.438L 246.873,223.46L 207.771,203.641L 207.771,203.438L 246.873,183.836L 246.873,176.936L 200.896,200.837L 200.896,206.27 Z " horizontalalignment="Left" width="45.977"&gt;&lt;/path&gt;&lt;/grid&gt;&lt;span style="font-family:verdana;font-size:85%;"&gt;If you use the above XAML and go to design view you will see an arrow. &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:verdana;font-size:85%;"&gt;This is going to be our new RepeatButton &lt;strong&gt;ControlTemplate&lt;/strong&gt; &lt;strong&gt;Style&lt;/strong&gt;.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:Verdana;font-size:85%;"&gt;&lt;strong&gt;&lt;/strong&gt;&lt;/span&gt;&lt;span style="font-family:Verdana;font-size:85%;"&gt;&lt;strong&gt;Next:&lt;/strong&gt;&lt;/span&gt; &lt;span style="font-family:verdana;font-size:85%;"&gt;With your arrow created and&lt;/span&gt; &lt;span style="font-size:85%;"&gt;&lt;span style="font-family:verdana;"&gt;w&lt;/span&gt;&lt;span style="font-family:verdana;"&gt;&lt;span style="font-family:verdana;"&gt;hile&lt;/span&gt; in design view,&lt;/span&gt;&lt;/span&gt; &lt;strong&gt;c&lt;/strong&gt;&lt;span style="font-family:verdana;font-size:85%;"&gt;&lt;strong&gt;lick&lt;/strong&gt; on the &lt;strong&gt;arrow_left&lt;/strong&gt; object and &lt;strong&gt;Copy&lt;/strong&gt; it to the clipboard (&lt;em&gt;Make sure you don't grab the attached Grid&lt;/em&gt;). &lt;strong&gt;We only need the arrow_left XAML object&lt;/strong&gt;. &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:verdana;font-size:85%;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:verdana;font-size:85%;"&gt;&lt;strong&gt;Next&lt;/strong&gt;: Go back to the RepeatButton &lt;strong&gt;Grid &lt;/strong&gt;in your main form and double click on the Grid under the Template and &lt;strong&gt;Paste&lt;/strong&gt; the arrow into the Grid. &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:verdana;font-size:85%;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:verdana;font-size:85%;"&gt;I do it this way so we are not working in XAML view. Its easier to do this stuff in design view.&lt;br /&gt;It should look like the following screen shot.&lt;br /&gt;&lt;a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhDSTjAOu1Do0gRxcakJj4OnpxFAvrC_3B68Ovyzm8Gh2Xv02FBJsWTX10jjncMrdsSk2p_dGaEBJcK4ab69x8elmplH-aFmUuIR82hzq3VUi_c7pcBrMBZjfx4d0pxglQgp52ojXXYDnY/s1600-h/newrepeatbutton.jpg"&gt;&lt;img id="BLOGGER_PHOTO_ID_5209685014649090994" style="CURSOR: hand" alt="" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhDSTjAOu1Do0gRxcakJj4OnpxFAvrC_3B68Ovyzm8Gh2Xv02FBJsWTX10jjncMrdsSk2p_dGaEBJcK4ab69x8elmplH-aFmUuIR82hzq3VUi_c7pcBrMBZjfx4d0pxglQgp52ojXXYDnY/s400/newrepeatbutton.jpg" border="0" /&gt;&lt;/a&gt; &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:verdana;font-size:85%;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:verdana;font-size:85%;"&gt;Zoom in on the top RepeatButton area by holding down the Control Key and then use your mouse wheel to Zoom in or Out. &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:verdana;font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:verdana;font-size:85%;"&gt;If you can't see the Arrow in the Grid, Zoom out and Right Click on the Arrow and Select &lt;strong&gt;Auto Size/Fill&lt;/strong&gt; from the context menu&lt;strong&gt;.&lt;/strong&gt; &lt;strong&gt;Drag&lt;/strong&gt; it into the Grid if required. But it should be a sub-control in the Grid of the RepeatButton Template.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:verdana;font-size:85%;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:verdana;font-size:85%;"&gt;The following screen shot is what you should see. Our new Arrows are the RepeatButtons. &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:verdana;font-size:85%;"&gt;&lt;a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEifoj8ukGlKvLByp7gFrRrgOkoZVuQvPV5ys0TQ9NlKglrse-heMkWfxpmcPezOtLCLemaFiKo1RajgwkyswmxateV2biVWXYrg7RACGjfu-hV01RW_MrJyPxEdndnQQibJdOoT6pxnIcs/s1600-h/newRepeatStyle1.jpg"&gt;&lt;img id="BLOGGER_PHOTO_ID_5209687517728787538" style="CURSOR: hand" alt="" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEifoj8ukGlKvLByp7gFrRrgOkoZVuQvPV5ys0TQ9NlKglrse-heMkWfxpmcPezOtLCLemaFiKo1RajgwkyswmxateV2biVWXYrg7RACGjfu-hV01RW_MrJyPxEdndnQQibJdOoT6pxnIcs/s400/newRepeatStyle1.jpg" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:verdana;font-size:85%;"&gt;&lt;strong&gt;Next&lt;/strong&gt;: We need to make a few changes. They are both &lt;strong&gt;Left Arrows&lt;/strong&gt;, we need to make one a Right Arrow, and they are still in the wrong location. &lt;strong&gt;Lets fix that NOW&lt;/strong&gt;. &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:verdana;font-size:85%;"&gt;&lt;br /&gt;&lt;strong&gt;Click&lt;/strong&gt; on the RepeatButton as the following screen shot shows.&lt;br /&gt;&lt;a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi7soEhwWOw6a3MGaxafLdMGZGnOHXW2PZYEZZBfmt71j1fdVrR9DzSlIcP8zyPITfv9DbOanTMHh4__9M5_FWLa78u37dSCjs_tvrcjoxjhdcWaefkwxIVzn6d4YhEYAcKllphyY0q0oA/s1600-h/RelocateButton.jpg"&gt;&lt;img id="BLOGGER_PHOTO_ID_5209688493194814674" style="CURSOR: hand" alt="" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi7soEhwWOw6a3MGaxafLdMGZGnOHXW2PZYEZZBfmt71j1fdVrR9DzSlIcP8zyPITfv9DbOanTMHh4__9M5_FWLa78u37dSCjs_tvrcjoxjhdcWaefkwxIVzn6d4YhEYAcKllphyY0q0oA/s400/RelocateButton.jpg" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;The &lt;strong&gt;Arrow&lt;/strong&gt; should now be &lt;strong&gt;hightlighted&lt;/strong&gt; like the one below.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhGYN_A8UnRovj5rHNckMYnut4g8zd_2zelb5-6MXrOi0EspDAJrv93X2XObkvUf9X1w_o1L7mSwDvbxpqlFzWWYcOfLDKcz1GTGh8fCwsHWz-69vVErh3_g8oxpxb0gChIbTCZFzQF0UQ/s1600-h/drage1.jpg"&gt;&lt;img id="BLOGGER_PHOTO_ID_5209690058745838434" style="CURSOR: hand" alt="" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhGYN_A8UnRovj5rHNckMYnut4g8zd_2zelb5-6MXrOi0EspDAJrv93X2XObkvUf9X1w_o1L7mSwDvbxpqlFzWWYcOfLDKcz1GTGh8fCwsHWz-69vVErh3_g8oxpxb0gChIbTCZFzQF0UQ/s400/drage1.jpg" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;span style="font-family:verdana;font-size:85%;"&gt;&lt;strong&gt;Next&lt;/strong&gt;: &lt;strong&gt;Drag&lt;/strong&gt; the Arrow over untill it resembles the following screen shot.&lt;br /&gt;&lt;a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh47ho-QUWDxx72rOAVXxNO0ZGkWXrh5wWio0XAdquNOMbpVnqW5ILsO_UosaEtdGlk3CGazpD5xhN7i9x4EbMdjE_TLNsEnrCI91JVplRWefoiBWDt6QjSHhzSVS5zodUOGbpTNaSCOHI/s1600-h/drage2.jpg"&gt;&lt;img id="BLOGGER_PHOTO_ID_5209690423466516866" style="CURSOR: hand" alt="" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh47ho-QUWDxx72rOAVXxNO0ZGkWXrh5wWio0XAdquNOMbpVnqW5ILsO_UosaEtdGlk3CGazpD5xhN7i9x4EbMdjE_TLNsEnrCI91JVplRWefoiBWDt6QjSHhzSVS5zodUOGbpTNaSCOHI/s400/drage2.jpg" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:verdana;font-size:85%;"&gt;&lt;strong&gt;Next:&lt;/strong&gt; Repeat the proceedure for the &lt;strong&gt;Right&lt;/strong&gt; Arrow. &lt;/span&gt;&lt;span style="font-family:Verdana;font-size:85%;"&gt;&lt;strong&gt;Drag&lt;/strong&gt; it over untill it is lined up on &lt;strong&gt;Top edge&lt;/strong&gt; but about &lt;strong&gt;50mm apart&lt;/strong&gt;.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:Verdana;font-size:85%;"&gt;&lt;strong&gt;Next&lt;/strong&gt;: While the right arrow is still highlighted &lt;strong&gt;Flip&lt;/strong&gt; it Horizontally. The following screen shot shows how.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:verdana;font-size:85%;"&gt;This is only required to display it correctly, it's behaviour is already set. &lt;strong&gt;Right&lt;/strong&gt; &lt;strong&gt;Arrow = Down&lt;/strong&gt; , &lt;strong&gt;Left Arrow = Up&lt;/strong&gt;.&lt;br /&gt;&lt;/span&gt;&lt;a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhIKCZUG_lYIAm8LQSEbfKfd06DDaqsGznjK2SwHF2hyGee1E2ddHh_mlLv0ZTL0I6mxfJP4pgYdrzpgxJOjMnEaaPSS6eBxbDLYa2GeEZcm5T6ySgz-n7begBpCEKBMzUUFfx-OiCqC6g/s1600-h/horizonalFlip.jpg"&gt;&lt;img id="BLOGGER_PHOTO_ID_5209691902632879682" style="CURSOR: hand" alt="" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhIKCZUG_lYIAm8LQSEbfKfd06DDaqsGznjK2SwHF2hyGee1E2ddHh_mlLv0ZTL0I6mxfJP4pgYdrzpgxJOjMnEaaPSS6eBxbDLYa2GeEZcm5T6ySgz-n7begBpCEKBMzUUFfx-OiCqC6g/s400/horizonalFlip.jpg" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:verdana;font-size:85%;"&gt;Before we get to carried away we need to change the cursor to &lt;strong&gt;Hand&lt;/strong&gt; and the &lt;strong&gt;rollover area&lt;/strong&gt; on the Arrow needs to be a larger.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:verdana;font-size:85%;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:verdana;font-size:85%;"&gt;&lt;strong&gt;First: &lt;/strong&gt;Right click on the &lt;strong&gt;RepeatButton&lt;/strong&gt; and select &lt;strong&gt;&lt;em&gt;Edit Control Parts (Template)/Edit Template,&lt;/em&gt;&lt;/strong&gt; then double click on the &lt;strong&gt;Grid&lt;/strong&gt;. &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:verdana;font-size:85%;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:verdana;font-size:85%;"&gt;In the &lt;strong&gt;Properties Editor,&lt;/strong&gt; change the Background on the Grid (&lt;strong&gt;NOT the Arrow&lt;/strong&gt;) but the Grid, to have a Background Brush of Black or some color.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:verdana;font-size:85%;"&gt;With the Background Brush set, change the the &lt;strong&gt;A color&lt;/strong&gt; of the &lt;strong&gt;Background&lt;/strong&gt; to &lt;strong&gt;0%&lt;/strong&gt; opacity. &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:verdana;"&gt;&lt;/span&gt;&lt;span style="font-family:verdana;font-size:85%;"&gt;We need the background to have a 0% opacity otherwise the Arrow may be hidden by the Color.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:Verdana;font-size:85%;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:verdana;"&gt;&lt;span style="font-size:85%;"&gt;&lt;strong&gt;Next&lt;/strong&gt;: Find the &lt;strong&gt;Cursor&lt;/strong&gt; property on the Grid and change it to &lt;strong&gt;Hand&lt;/strong&gt;. &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:verdana;font-size:85%;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:verdana;font-size:85%;"&gt;Now when you &lt;strong&gt;MouseOver&lt;/strong&gt; the Arrow it should respond without being exactly over the Arrow. &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:verdana;font-size:85%;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:verdana;font-size:85%;"&gt;You should only need to do this on &lt;strong&gt;one &lt;/strong&gt;of the Arrow Grids, as the other Grid will inherit the changes.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:verdana;font-size:85%;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:verdana;"&gt;&lt;strong&gt;OK&lt;/strong&gt; Your ready to Roll.&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:verdana;font-size:85%;"&gt;&lt;strong&gt;&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:verdana;font-size:85%;"&gt;&lt;strong&gt;Test it&lt;/strong&gt;: &lt;strong&gt;Control + S&lt;/strong&gt; to &lt;strong&gt;Save&lt;/strong&gt; and &lt;strong&gt;F5&lt;/strong&gt; to &lt;strong&gt;Run&lt;/strong&gt;. &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:verdana;font-size:85%;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:verdana;font-size:85%;"&gt;Your form should resemble the following. &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:verdana;font-size:85%;"&gt;If you click on the Arrow's you should get the same up and down behaviour as the default scrollbar.&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:verdana;"&gt;&lt;br /&gt;&lt;a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh2jW4Oi77YbCZcQ5zjX66BniDMZY1k-kYvAEBZPLweniJXNx8vctOdC_QTAgQAaXm18O3Hc-VcZXagWD5IZnFbU70wk1VqJg2c7w6QiuuYKpIX6SQKSQkoQ-aPgeQESdmIBw2N8VFHbGo/s1600-h/finishedApp.jpg"&gt;&lt;img id="BLOGGER_PHOTO_ID_5210004753830178626" style="CURSOR: hand" alt="" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh2jW4Oi77YbCZcQ5zjX66BniDMZY1k-kYvAEBZPLweniJXNx8vctOdC_QTAgQAaXm18O3Hc-VcZXagWD5IZnFbU70wk1VqJg2c7w6QiuuYKpIX6SQKSQkoQ-aPgeQESdmIBw2N8VFHbGo/s400/finishedApp.jpg" border="0" /&gt;&lt;/a&gt;&lt;span style="font-size:85%;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;&lt;hr /&gt;&lt;br /&gt;&lt;span style="font-family:verdana;"&gt;&lt;strong&gt;Summary&lt;/strong&gt;: &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:verdana;"&gt;We started with a default ListBox, that displayed a typical list view.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:verdana;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:Verdana;"&gt;&lt;strong&gt;XAML &lt;/strong&gt;gave us the flexibility to completly change the UI of the ListBox control.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:Verdana;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:verdana;"&gt;By Creating a new &lt;strong&gt;DataTemplate&lt;/strong&gt; we could display an &lt;strong&gt;Image&lt;/strong&gt; in our list.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:verdana;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:verdana;"&gt;&lt;strong&gt;Then&lt;/strong&gt; we created an&lt;strong&gt; ItemContainerStyle&lt;/strong&gt; to modify the &lt;strong&gt;&lt;em&gt;IsSelected&lt;/em&gt; &lt;/strong&gt;&lt;em&gt;trigger&lt;/em&gt; so we didn't see the default blue background when a list item is selected.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:verdana;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:verdana;"&gt;And finally we created a new &lt;strong&gt;Style&lt;/strong&gt; to override the &lt;strong&gt;ScrollBar&lt;/strong&gt; UI.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:verdana;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:verdana;"&gt;By doing these three tasks we were able to completly change the appearance of the ListBox UI without any C# or VB.Net code.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;hr /&gt;&lt;br /&gt;&lt;p&gt;&lt;/p&gt;&lt;span style="font-family:verdana;font-size:130%;"&gt;&lt;strong&gt;Conclusion:&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:verdana;font-size:85%;"&gt;Expression Design has a Template for the &lt;strong&gt;Fabrikam&lt;/strong&gt; layout. By exporting that template to XAML I added some bells and whistles to the above form and ended up with the following.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhIM4MP_EUthaN-golJHAn0uxO8xH8ifqhuZ3eKmxscfIpEpj1CFRC1BbbCEw9xSivsJl8PaH_0pbBAcQJWryam4uYl_zg4O7kJvCUWzLlRV3zALx-i1M_Yc1gsM_Wr98DEERSoBoTbvxA/s1600-h/FabrikamProducts.png"&gt;&lt;img id="BLOGGER_PHOTO_ID_5210771047965824338" style="CURSOR: hand" alt="" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhIM4MP_EUthaN-golJHAn0uxO8xH8ifqhuZ3eKmxscfIpEpj1CFRC1BbbCEw9xSivsJl8PaH_0pbBAcQJWryam4uYl_zg4O7kJvCUWzLlRV3zALx-i1M_Yc1gsM_Wr98DEERSoBoTbvxA/s400/FabrikamProducts.png" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://blogs.msdn.com/b/expression/archive/2007/03/19/fabrikam-catalog-part-3-special-effects.aspx"&gt;Goto a Fabrikam Product Tutorial&lt;/a&gt;</description><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" height="72" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhWrbbFPjoTTjh94djA0PzOYsuFgAC5b_RW6ZWQ5aFz0BcKtawwvDAs1_r3FgNPKNFJuJSbBT7eAIy8eDqvFXG3_9AWTlTuaRApKkpcqGL3U30NPDn2Z6PiMUBzw2OPvjbO1LFI9UhXAlI/s72-c/furnitureSS_3.jpg" width="72"/><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total></item><item><title>WPF Custom ListBox (Background Removal Style)</title><link>http://martin-mforme.blogspot.com/2008/06/wpf-custom-listbox-background-removal.html</link><author>noreply@blogger.com (Martin)</author><pubDate>Tue, 3 Jun 2008 15:03:00 +1000</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-2158307754372575291.post-8174511401706145410</guid><description>&lt;a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjTrDC8CxlCitvMDKXNEv5WduyrvH_SbVjuwPEHHiW3K6ur5sfCC0HNaMcVIJ4pbO_HNAOKe9tTYT_bA7uk6Wt8QRO8GDOBfmpKIOD3YD_hhCLiSuNTX7KcEa1zXtdsrK6qFNsN-r2Bk1c/s1600-h/ListBoxStyle.png"&gt;&lt;img id="BLOGGER_PHOTO_ID_5207527068249665122" style="CURSOR: hand" height="186" alt="" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjTrDC8CxlCitvMDKXNEv5WduyrvH_SbVjuwPEHHiW3K6ur5sfCC0HNaMcVIJ4pbO_HNAOKe9tTYT_bA7uk6Wt8QRO8GDOBfmpKIOD3YD_hhCLiSuNTX7KcEa1zXtdsrK6qFNsN-r2Bk1c/s400/ListBoxStyle.png" width="539" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;The following Style removes the background selection color from a ListBox in WFP.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:georgia;font-size:85%;"&gt;Assign this style to the ListBoxes ItemContainerStyle property. &lt;/span&gt;&lt;span style="font-family:georgia;"&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:arial;"&gt;eg:. ItemContainerStyle="{DynamicResource ListBoxItemStyleNoBackGround}"&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="font-family:georgia;"&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:arial;"&gt;&lt;span style="font-family:arial;"&gt;Where ListBoxItemStyleNoBackGround is the name you gave the Style.&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;This is usful when you don't want the ListBox to show the default blue background when an item is selected.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjHOenfTOYAbasA-LDSfBYZSOZAA2royUy75Of_5Hrtth0WQew3IILE63wA9rNjFPGBhfMhHFVeluLlywjRp4Ur8kynn0-0xIEOA7mnX6ABtVpmh9eDAPpBuj4NJ6e8VtnLVWxkbdEnlRQ/s1600-h/ListBoxStyle.png"&gt;&lt;/a&gt;&lt;span style="font-family:verdana;font-size:85%;"&gt;&lt;strong&gt;ListBox with default Background Selection.&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;p&gt;&lt;/p&gt;&lt;p align="left"&gt;&lt;a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi47ZrS9wjWE1xx19zy95jcr1bbUbwSy8_KrGa2iptIPEV-RSSt85sIDPtH3jsPAfcGU18bEtVvWGu5_FjJiNH4rEtgYhspaboMNAvMeCvSQu4lEsWMukCWLr-iK2M_mwuL53HbhlUYv0c/s1600-h/ListBoxWithBK.png"&gt;&lt;img id="BLOGGER_PHOTO_ID_5207523353102954034" style="CURSOR: hand" alt="" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi47ZrS9wjWE1xx19zy95jcr1bbUbwSy8_KrGa2iptIPEV-RSSt85sIDPtH3jsPAfcGU18bEtVvWGu5_FjJiNH4rEtgYhspaboMNAvMeCvSQu4lEsWMukCWLr-iK2M_mwuL53HbhlUYv0c/s400/ListBoxWithBK.png" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/p&gt;&lt;div&gt;&lt;strong&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:verdana;"&gt;ListBox with Background Selection hidden.&lt;/span&gt; &lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;&lt;a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgWYHqlYk5_legtcMANNymkDtZXEmCs3n5V6TAjRB9sbWzYbT35y-rczuoooKfSZFy6QXfz-GhjoVtNuleZwoR8a6o47aAvpNoqjbxFk9bYL7mHLVOfHwdvFb83aDk1fk-Ktqvzprdv5h0/s1600-h/listBoxWithoutBK.png"&gt;&lt;img id="BLOGGER_PHOTO_ID_5207525174169087570" style="CURSOR: hand" alt="" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgWYHqlYk5_legtcMANNymkDtZXEmCs3n5V6TAjRB9sbWzYbT35y-rczuoooKfSZFy6QXfz-GhjoVtNuleZwoR8a6o47aAvpNoqjbxFk9bYL7mHLVOfHwdvFb83aDk1fk-Ktqvzprdv5h0/s400/listBoxWithoutBK.png" border="0" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;hr /&gt;&lt;br /&gt;&lt;div&gt;&lt;span style="font-family:arial;font-size:85%;"&gt;For your Regular Expressions needs goto;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;a href="http://regexlib.com/"&gt;http://regexlib.com/&lt;/a&gt;&lt;/div&gt;</description><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" height="72" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjTrDC8CxlCitvMDKXNEv5WduyrvH_SbVjuwPEHHiW3K6ur5sfCC0HNaMcVIJ4pbO_HNAOKe9tTYT_bA7uk6Wt8QRO8GDOBfmpKIOD3YD_hhCLiSuNTX7KcEa1zXtdsrK6qFNsN-r2Bk1c/s72-c/ListBoxStyle.png" width="72"/><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total></item><item><title>WindowsClient.NET</title><link>http://martin-mforme.blogspot.com/2008/04/windowsclientnet.html</link><author>noreply@blogger.com (Martin)</author><pubDate>Fri, 18 Apr 2008 17:14:00 +1000</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-2158307754372575291.post-8018497719981419525</guid><description>&lt;a href="http://windowsclient.net"&gt;WindowsClient.NET&lt;/a&gt;</description><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total></item><item><title>Design Guidelines, Managed code and the .NET Framework with SilverLight</title><link>http://martin-mforme.blogspot.com/2008/04/design-guidelines-managed-code-and-net.html</link><author>noreply@blogger.com (Martin)</author><pubDate>Fri, 18 Apr 2008 17:12:00 +1000</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-2158307754372575291.post-210451114425613878</guid><description>&lt;a href="http://blogs.msdn.com/brada/Default.aspx?p=2"&gt;SilverLight and NET 3.5 stuff&lt;/a&gt;</description><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total></item><item><title>ASP.NET Community</title><link>http://martin-mforme.blogspot.com/2008/04/aspnet-community.html</link><author>noreply@blogger.com (Martin)</author><pubDate>Tue, 8 Apr 2008 11:20:00 +1000</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-2158307754372575291.post-4514548275766631209</guid><description>&lt;a href="http://www.asp.net/community/"&gt;ASP.NET Community&lt;/a&gt;</description><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total></item><item><title>Open Source Web Design</title><link>http://martin-mforme.blogspot.com/2008/04/open-source-web-design.html</link><author>noreply@blogger.com (Martin)</author><pubDate>Tue, 8 Apr 2008 10:50:00 +1000</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-2158307754372575291.post-7302996656401782908</guid><description>&lt;a href="http://www.oswd.org/"&gt;Open Source Web Design &lt;/a&gt;</description><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total></item><item><title>Display Images From the NorthWind Categories Table using LINQ</title><link>http://martin-mforme.blogspot.com/2008/04/display-images-from-northwind.html</link><author>noreply@blogger.com (Martin)</author><pubDate>Sat, 5 Apr 2008 14:42:00 +1100</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-2158307754372575291.post-3371084623312823658</guid><description>&lt;strong&gt;ASP Side;&lt;br /&gt;&lt;/strong&gt;&lt;br /&gt;HttpHandler to return the binary image.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style="color:#3333ff;"&gt;CategoryImages.ashx?CategoryID=1&lt;/span&gt;&lt;br /&gt;&lt;/strong&gt;You can use this call in a &lt;span style="color:#ff0000;"&gt;&lt;strong&gt;src&lt;/strong&gt;&lt;/span&gt;... attribute of the HTML &lt;span style="color:#3333ff;"&gt;&lt;strong&gt;img&lt;/strong&gt;&lt;/span&gt; control or any an ASP.NET Server control that can display images.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Code behind ; &lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:15;"&gt;&lt;strong&gt;&lt;div align="left"&gt;&lt;/strong&gt;&lt;span style="font-size:100%;"&gt;Create a &lt;span style="color:#ff0000;"&gt;HttpHandler Class&lt;/span&gt; called CategoryImages&lt;br /&gt;&lt;br /&gt;Create the &lt;span style="color:#ff0000;"&gt;NorthwinDataContext LINQ to SQL&lt;/span&gt; class and add the Category Table to the DataContext layout. &lt;/span&gt;&lt;/div&gt;&lt;div align="left"&gt;&lt;span style="font-size:100%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:85%;color:#3333ff;"&gt;/************************************************************/&lt;br /&gt;public class CategoryImages: IHttpHandler&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;// Implement the ProcessRequest method&lt;br /&gt;public void ProcessRequest(HttpContext context)&lt;br /&gt;{&lt;br /&gt;HttpRequest req = context.Request;&lt;br /&gt;string categoryID = req.QueryString["CategoryID"].ToString();&lt;br /&gt;// Get information about the specified category&lt;br /&gt;&lt;span style="color:#ff0000;"&gt;NorthwinDataContext db = new NorthwinDataContext();&lt;br /&gt;var category = from c in db.Categories&lt;br /&gt;where Convert.ToInt32(c.CategoryID) == Convert.ToInt32(categoryID)&lt;br /&gt;select c.Picture;&lt;br /&gt;&lt;/span&gt;int len = category.First().Length;&lt;br /&gt;// Output the binary data&lt;br /&gt;// But first we need to strip out the OLE header&lt;br /&gt;int OleHeaderLength = 78;&lt;br /&gt;int strippedImageLength = len - OleHeaderLength;&lt;br /&gt;byte[] imagdata = new byte[strippedImageLength];&lt;br /&gt;Array.Copy(category.First().ToArray(), OleHeaderLength, imagdata, 0, strippedImageLength);&lt;br /&gt;if ((imagdata) != null)&lt;br /&gt;{&lt;br /&gt;MemoryStream m = new MemoryStream(imagdata);&lt;br /&gt;System.Drawing.Image image = System.Drawing.Image.FromStream(m);&lt;br /&gt;image.Save(context.Response.OutputStream, ImageFormat.Jpeg);&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;} &lt;/span&gt;&lt;/div&gt;&lt;div align="left"&gt;&lt;span style="font-size:85%;color:#3333ff;"&gt;/*************************************************************/&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;</description><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">2</thr:total></item><item><title>LINQ to SQL</title><link>http://martin-mforme.blogspot.com/2008/04/linq-to-sql.html</link><author>noreply@blogger.com (Martin)</author><pubDate>Sat, 5 Apr 2008 10:28:00 +1100</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-2158307754372575291.post-7431739325821633927</guid><description>&lt;a href="http://weblogs.asp.net/scottgu/archive/2007/09/07/linq-to-sql-part-9-using-a-custom-linq-expression-with-the-lt-asp-linqdatasource-gt-control.aspx"&gt;http://weblogs.asp.net/scottgu/archive/2007/09/07/linq-to-sql-part-9-using-a-custom-linq-expression-with-the-lt-asp-linqdatasource-gt-control.aspx&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://michaelholmandersen.dk/category/ASPNET.aspx"&gt;LINQ to SQL visualizer plug-in&lt;/a&gt;</description><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total></item><item><title>ASP.NET Podcast</title><link>http://martin-mforme.blogspot.com/2008/04/aspnet-podcast.html</link><author>noreply@blogger.com (Martin)</author><pubDate>Sat, 5 Apr 2008 09:37:00 +1100</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-2158307754372575291.post-3722479132044401567</guid><description>&lt;a href="http://aspnetpodcast.com/CS11/search/SearchResults.aspx?u=2100&amp;amp;o=DateDescending&amp;amp;PageIndex=2"&gt;http://aspnetpodcast.com/CS11/search/SearchResults.aspx?u=2100&amp;amp;o=DateDescending&amp;amp;PageIndex=2&lt;/a&gt;</description><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total></item><item><title>Using the osql Utility</title><link>http://martin-mforme.blogspot.com/2008/04/using-osql-utility.html</link><author>noreply@blogger.com (Martin)</author><pubDate>Sat, 5 Apr 2008 08:36:00 +1100</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-2158307754372575291.post-8731076833367453485</guid><description>&lt;a href="http://technet.microsoft.com/en-us/library/aa213090(SQL.80).aspx"&gt;http://technet.microsoft.com/en-us/library/aa213090(SQL.80).aspx&lt;/a&gt;</description><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total></item><item><title>SQL Server 2000 Sample Database Files</title><link>http://martin-mforme.blogspot.com/2008/04/sql-server-2000-sample-database-files.html</link><author>noreply@blogger.com (Martin)</author><pubDate>Sat, 5 Apr 2008 08:32:00 +1100</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-2158307754372575291.post-1738038927110919980</guid><description>Updated SQL Server 2000 Sample Database Files&lt;br /&gt;December 15, 2004&lt;br /&gt;© Copyright Microsoft Corporation, 2004. All rights reserved.&lt;br /&gt; The SQL Server documentation team cannot answer technical support questions, but welcomes your suggestions and comments about this readme documentation. You can quickly and directly send e-mail feedback using the link below. Please send feedback in English.To submit written feedback about this document, click here:  &lt;a href="mailto:sqldocfb@microsoft.com?subject=SQL%20Server%202000%20Sample%20Database%20Scripts%20readme%20file&amp;amp;body=---Please%20type%20comments%20here,%20leaving%20the%20subject%20line%20in%20place.---"&gt;Submit feedback&lt;/a&gt;.&lt;br /&gt;&lt;a name="_introduction_d3jb"&gt;&lt;/a&gt;Introduction&lt;br /&gt;The Microsoft® SQL Server™ 2000 Sample Database Files include:&lt;br /&gt;·                     New versions of two scripts included with SQL Server 2000:&lt;br /&gt;·                                 Instpubs.sql creates the pubs sample database.&lt;br /&gt;·                                 Instnwnd.sql creates the Northwind sample database.&lt;br /&gt;·                     Pre-built database files that can be attached to an instance of SQL Server 2000:&lt;br /&gt;·                                 Pubs.mdf and pubs_log.ldf are the data and log files for the pubs sample database.&lt;br /&gt;·                                 Northwind.mdf and northwind.ldf are the data and log files for the Northwind sample database.&lt;br /&gt;These copies of the scripts or database files are the same as the versions included with SQL Server 2000, except for these changes:&lt;br /&gt;·                     The script for creating pubs, instpubs.sql, has been modified to install pubs and all of the pubs data in one step. The original version of instpubs.sql included in SQL Server 2000 does not load in some of the pubs data, and customers were required to run batch jobs to install some of the larger data values.&lt;br /&gt;·                     The scripts have been brought into compliance with recent Microsoft samples security guidelines. Instpubs.sql no longer creates a “guest” user and no longer grants rights to “guest” or “public”. All dates that are used to populate the databases now express the full four-digit year, such as 1992.&lt;br /&gt;·                     The pre-built database files include all of the changes incorporated in the new script files.&lt;br /&gt;SQL Server 2000 Desktop Engine (MSDE 2000) customers can also use these copies of the files to install pubs and Northwind.&lt;br /&gt;Note   If the instance of SQL Server 2000 was installed with a case-sensitive collation, always type pubs in all lowercase letters, and Northwind with an initial capital "N" followed by lowercase letters. Sample applications and the code samples in SQL Server Books Online might not work correctly if the database names are not created exactly as shown in the examples.&lt;br /&gt;&lt;a name="_sample_script_prerequisites_cuy1"&gt;&lt;/a&gt;Sample Files Prerequisites&lt;br /&gt;The user attaching the pre-built database files must be a member of the SQL Server sysadmin or dbcreator fixed server roles.&lt;br /&gt;The user running the SQL Server 2000 Sample Database Scripts must be a member of the SQL Server sysadmin or dbcreator fixed server roles, or have been granted CREATE DATABASE permissions.&lt;br /&gt;The files can be used with the following versions of SQL Server 2000:&lt;br /&gt;·                     SQL Server 2000 Service Pack 3 (SP3) or later.&lt;br /&gt;·                     SQL Server 2000 Desktop Engine (MSDE 2000) SP3 or later.&lt;br /&gt;·                     SQL Server 2000 Desktop Engine (MSDE 2000) Release A.&lt;br /&gt;&lt;a name="_downloading_and_extracting_the_scripts_"&gt;&lt;/a&gt;Downloading and Extracting the Files&lt;br /&gt;The SQL Server 2000 Sample Database Files are available as an installation file, SQL2000SampleDb.msi, which can be downloaded by following the instructions on the download &lt;a href="http://go.microsoft.com/fwlink/?LinkId=24758" target="_blank"&gt;website&lt;/a&gt;.&lt;br /&gt;After downloading SQL2000SampleDb.msi, extract the sample database files by double-clicking SQL2000SampleDb.msi. SQL2000SampleDb.msi extracts the database scripts and this readme file into this folder by default:&lt;br /&gt;C:\SQL Server 2000 Sample Databases&lt;br /&gt;&lt;a name="_installing_the_sample_databases_238p"&gt;&lt;/a&gt;Installing the Sample Databases&lt;br /&gt;To install the sample databases&lt;br /&gt;1.              Either run a script to build a sample database, or attach the pre-built database files for that database.&lt;br /&gt;2.              To grant another person access to the sample database, you must grant permissions on the database objects to that person.&lt;br /&gt;SQL Server 2000 customers can perform these tasks using either the osql utility or the two graphical utilities SQL Query Analyzer and SQL Enterprise Manager. MSDE 2000 includes only the osql command prompt utility.&lt;br /&gt;Caution   Instpubs.sql drops any existing version of the pubs sample database and Instnwnd.sql drops any existing copy of the Northwind sample database before creating the new copies of the database.&lt;br /&gt;Attaching the Pre-built Files by Using Enterprise Manager&lt;br /&gt;To attach the pre-built files by using SQL Query Analyzer:&lt;br /&gt;1.              From the Start menu, point to All Programs, point to Microsoft SQL Server, and then click the Enterprise Manager icon.&lt;br /&gt;2.              Right-click Databases and select All Tasks/Attach Database.&lt;br /&gt;3.              Either enter C:\SQL Server 2000 Sample Databases\northwind.mdf or C:\SQL Server 2000 Sample Databases\pubs.mdf as the MDF file of database to attach, or click Browse (…) to search for the file to attach.&lt;br /&gt;4.              Click Verify to ensure the selected MDF file is correct.&lt;br /&gt;5.              Specify Northwind or pubs in Attach as.&lt;br /&gt;6.              Specify the database owner.&lt;br /&gt;7.              Click OK.&lt;br /&gt;Attaching the Pre-built Files by Using osql&lt;br /&gt;To attach the pre-built files by using osql:&lt;br /&gt;1.              Open a command prompt window.&lt;br /&gt;2.              From the command prompt, use the cd command to navigate to the folder containing the SQL Server 2000 Sample Database Scripts: cd c:\SQL Server 2000 Sample Databases&lt;br /&gt;3.              Run osql using the -Q switch to execute sp_attach_db to attach either the pubs or Northwind pre-built database files. Here are some examples:&lt;br /&gt;Note   Enter the osql commands on one line in the command prompt window. These examples split the commands across two or three lines to make the examples easier to read.&lt;br /&gt;·                     To attach the Northwind database to a default instance on the same computer: ·                            osql -E -Q "EXEC sp_attach_db N'Northwind', N'c:\SQL Server 2000 Sample Databases\northwind.mdf'"&lt;br /&gt;·                     To attach the pubs database to a default instance on a different computer: ·                            osql -E -S ComputerName -Q "EXEC sp_attach_db N'pubs', N'c:\SQL Server 2000 Sample Databases\pubs.mdf'"&lt;br /&gt;·                     To attach the Northwind database to a named instance: ·                            osql -E -S ComputerName/InstanceName·                             -Q "EXEC sp_attach_db N'Northwind', N'c:\SQL Server 2000 Sample Databases\northwind.mdf'"&lt;br /&gt;Running the Scripts Using SQL Query Analyzer&lt;br /&gt;To run the scripts using SQL Query Analyzer:&lt;br /&gt;1.              From the Start menu, point to All Programs, point to Microsoft SQL Server, and then click the Query Analyzer icon.&lt;br /&gt;2.              Connect to the instance of SQL Server 2000 on which you want to create the sample database.&lt;br /&gt;3.              On the File menu, click Open, and navigate to the c:\SQL Server 2000 Sample Databases folder. Select either Instpubs.sql or Instnwnd.sql.&lt;br /&gt;4.              On the toolbar, click Execute Query.&lt;br /&gt;Running the Scripts Using osql&lt;br /&gt;To run the scripts using osql:&lt;br /&gt;1.              Open a command prompt window.&lt;br /&gt;2.              From the command prompt, use the cd command to navigate to the folder containing the SQL Server 2000 Sample Database Scripts:&lt;br /&gt;3.              cd c:\SQL Server 2000 Sample Databases&lt;br /&gt;4.              Run osql specifying either Instpubs.sql or Instnwnd.sql as the input file. Here are some examples:&lt;br /&gt;·                            To install the Northwind database on a default instance on the same computer: osql -E -i instnwnd.sql&lt;br /&gt;·                            To install the pubs database on a default instance on a different computer: osql -E -S ComputerName -i instpubs.sql&lt;br /&gt;·                            To install the Northwind database on a named instance: osql -E -S ComputerName/InstanceName -i instnwnd.sql&lt;br /&gt;Assigning Permissions&lt;br /&gt;The logon you use when creating or attaching a database becomes the owner of the sample database, and of all the objects within the database. That login and any login in the sysadmin fixed server role will have permission to access the data and objects in the sample database. All other logins must be granted permissions before they can access the sample data and objects.&lt;br /&gt;Granting a Login Access to a Database&lt;br /&gt;You can grant access to the sample databases using Enterprise Manager or the sp_grantdbaccess system stored procedure. Only a database user that is a member of at least one of the following roles can grant access to a database: the sysadmin fixed server role, the db_accessadmin fixed database role, or the db_owner fixed database role.&lt;br /&gt;To grant access using Enterprise Manager:&lt;br /&gt;1.              Expand the server group and then expand the server.&lt;br /&gt;2.              Expand Databases and select the sample database.&lt;br /&gt;3.              Right-click Users, and then click New Database User.&lt;br /&gt;4.              Complete the Database User Properties form.&lt;br /&gt;To grant access using sp_grantdbaccess&lt;br /&gt;Having connected to the server with either osql or SQL Query Analyzer, you can use sp_grantdbaccess to enable a domain user to access the database. For example, the following commands grant access to pubs to a domain user named Hamid:USE pubs;GOsp_grantdbaccess 'CORPORATE\hamid', 'hamid';GO&lt;br /&gt;For more information about granting logins access to a database, see the following topics in SQL Server Books Online:&lt;br /&gt;&lt;a href="http://go.microsoft.com/fwlink/?LinkId=24755" target="_blank"&gt;Granting a Windows User or Group Access to a Database&lt;/a&gt;&lt;br /&gt;&lt;a href="http://go.microsoft.com/fwlink/?LinkId=24756" target="_blank"&gt;Granting a SQL Server Login Access to a Database&lt;/a&gt;&lt;br /&gt;Granting User Accounts Permissions&lt;br /&gt;Once a login has been associated with a user account in the sample database, you must grant that user account permissions to access database objects. Only a database user that is a member of at least one of the following roles can grant access to database objects: the sysadmin fixed server role, the db_accessadmin fixed database role, or the db_owner fixed database role.&lt;br /&gt;To grant account permissions using Enterprise Manager&lt;br /&gt;1.              Expand the server group and then expand the server.&lt;br /&gt;2.              Expand Databases and select the sample database.&lt;br /&gt;3.              Expand the category for type of object, such as stored procedures or views.&lt;br /&gt;4.              Right-click the object, point to All Tasks, and then click Manage Permissions.&lt;br /&gt;To grant account permissions using the GRANT statement&lt;br /&gt;In either osql or SQL Query Analyzer you can use the GRANT statement to grant permissions on database objects. First execute a USE &lt;database_name&gt; statement.&lt;br /&gt;To grant execute permission on a stored procedure, use the following statement:GRANT EXECUTE ON [dbo].[database_object_name]              TO [database_user_account];GO&lt;br /&gt;To grant data read and modification permissions, use the following statement:GRANT  SELECT , INSERT , DELETE , UPDATE       ON [dbo].[database_object_name]       TO [database_user_account];GO&lt;br /&gt;For more information about granting permissions in a database, see the following topic in SQL Server Books Online:&lt;br /&gt;&lt;a href="http://go.microsoft.com/fwlink/?LinkId=24757" target="_blank"&gt;Granting Permissions&lt;/a&gt;</description><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total></item><item><title>NVIDIA Direct3D SDK</title><link>http://martin-mforme.blogspot.com/2008/03/nvidia-direct3d-sdk.html</link><author>noreply@blogger.com (Martin)</author><pubDate>Thu, 27 Mar 2008 10:38:00 +1100</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-2158307754372575291.post-2906799149262473007</guid><description>&lt;a href="http://developer.download.nvidia.com/SDK/10/direct3d/samples.html"&gt;NVIDIA Direct3D SDK&lt;/a&gt;</description><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total></item><item><title>BizTalk Utilities</title><link>http://martin-mforme.blogspot.com/2008/03/biztalk-utilities.html</link><author>noreply@blogger.com (Martin)</author><pubDate>Mon, 3 Mar 2008 10:21:00 +1100</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-2158307754372575291.post-2091052273120882004</guid><description>&lt;a href="http://www.topxml.com/biztalkutilities/tutorial/"&gt;BizTalk Utilities&lt;/a&gt;</description><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">1</thr:total></item><item><title>IIS 6.0 Documentation (IIS 6.0)</title><link>http://martin-mforme.blogspot.com/2008/03/iis-60-documentation-iis-60.html</link><author>noreply@blogger.com (Martin)</author><pubDate>Mon, 3 Mar 2008 09:07:00 +1100</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-2158307754372575291.post-3292633106266359916</guid><description>&lt;a href="http://www.microsoft.com/technet/prodtechnol/WindowsServer2003/Library/IIS/d0e9cfb6-16f1-40a9-b077-33b66cad1a05.mspx?mfr=true"&gt;IIS 6.0 Documentation (IIS 6.0)&lt;/a&gt;</description><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total></item><item><title>Windows Core Networking APIs and technologies such as Winsock, TCP/IP stack, WFP, IPsec, IPv6, WSK, WinINet, Http.sys, WinHttp, QoS, and System.Net</title><link>http://martin-mforme.blogspot.com/2008/03/windows-core-networking-apis-and.html</link><author>noreply@blogger.com (Martin)</author><pubDate>Mon, 3 Mar 2008 09:05:00 +1100</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-2158307754372575291.post-8420033533623266032</guid><description>&lt;a href="http://blogs.msdn.com/wndp/archive/tags/Http.sys/default.aspx"&gt;Windows Core Networking APIs&lt;/a&gt;</description><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total></item><item><title>XML in the .NET Framework</title><link>http://martin-mforme.blogspot.com/2008/01/xml-in-net-framework.html</link><author>noreply@blogger.com (Martin)</author><pubDate>Fri, 11 Jan 2008 10:10:00 +1100</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-2158307754372575291.post-4057664960061005269</guid><description>Extensible Markup Language (XML) is a meta-markup language that provides a format for describing structured data. XML enables a new generation of Web-based data viewing and manipulation applications. XML is the universal language for data on the Web. XML gives developers the power to deliver structured data from a wide variety of applications to the desktop for local computation and presentation. &lt;br /&gt;&lt;br /&gt;&lt;a href="http://samples.gotdotnet.com/quickstart/howto/doc/Xml/OverviewofXML.aspx"&gt;XML in the .NET Framework&lt;/a&gt;</description><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total></item><item><title>ASP.NET Tracing</title><link>http://martin-mforme.blogspot.com/2008/01/how-to-view-aspnet-trace-information.html</link><author>noreply@blogger.com (Martin)</author><pubDate>Tue, 8 Jan 2008 15:46:00 +1100</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-2158307754372575291.post-6771884834089091720</guid><description>ASP.NET enables you to view diagnostic information about a request for an ASP.NET page. Tracing also enables you to write debug statements directly in your code without having to remove them from your application when it is deployed to production servers. You can write variables or structures in a page, assert whether a condition is met, or simply trace through the execution path of your page or application. You can view tracing information appended to the end of a page, or in a separate trace viewer, or both. &lt;br /&gt;&lt;br /&gt;The topics in this section describe how tracing works, how to manage tracing, and how to integrate ASP.NET tracing with .NET system diagnostics.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://msdn2.microsoft.com/en-us/library/y13fw6we.aspx"&gt;ASP.NET Tracing&lt;/a&gt;&lt;br /&gt;&lt;a href="http://samples.gotdotnet.com/quickstart/aspplus/doc/tracelogapp.aspx"&gt;Application-level Trace Logging&lt;/a&gt;&lt;br /&gt;&lt;a href="http://msdn2.microsoft.com/en-us/library/aa528768.aspx"&gt;diagnostics Element&lt;/a&gt;</description><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total></item><item><title>TopXML</title><link>http://martin-mforme.blogspot.com/2008/01/topxml.html</link><author>noreply@blogger.com (Martin)</author><pubDate>Thu, 3 Jan 2008 13:45:00 +1100</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-2158307754372575291.post-8228421136611929514</guid><description>General XML Tutorials&lt;br /&gt;&lt;br /&gt;&lt;a href="http://q.sitelevelsearch.com/query-ask.go?crid=43a71af3012a4ba5&amp;amp;query=xsd&amp;amp;slice_title=&amp;amp;page=1&amp;amp;sp=1"&gt;Top XML&lt;/a&gt;</description><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total></item><item><title>XML Schema Part 0: Primer Second Edition</title><link>http://martin-mforme.blogspot.com/2008/01/xml-schema-part-0-primer-second-edition.html</link><author>noreply@blogger.com (Martin)</author><pubDate>Thu, 3 Jan 2008 09:50:00 +1100</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-2158307754372575291.post-5458196997406715639</guid><description>XML Schema Part 0: Primer is a non-normative document intended to provide an easily readable description of the XML Schema facilities, and is oriented towards quickly understanding how to create schemas using the XML Schema language. &lt;a href="http://www.w3.org/TR/2004/REC-xmlschema-1-20041028/structures.html"&gt;XML Schema Part 1: Structures&lt;/a&gt; and &lt;a href="http://www.w3.org/TR/2004/REC-xmlschema-2-20041028/datatypes.html"&gt;XML Schema Part 2: Datatypes&lt;/a&gt; provide the complete normative description of the XML Schema language. This primer describes the language features through numerous examples which are complemented by extensive references to the normative texts.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.w3.org/TR/xmlschema-0/#PO"&gt;XML Schema Part 0: Primer Second Edition&lt;/a&gt;</description><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total></item><item><title>JSON (JavaScript Object Notation)</title><link>http://martin-mforme.blogspot.com/2007/12/json-javascript-object-notation.html</link><author>noreply@blogger.com (Martin)</author><pubDate>Fri, 21 Dec 2007 10:35:00 +1100</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-2158307754372575291.post-5322783775914697740</guid><description>&lt;strong&gt;Introduction to JSON&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;JSON is a lightweight data-interchange format. It is particularly useful because it can be 'decoded' easily by web page JavaScript into object form.&lt;br /&gt;AJAX-based web pages use XmlHttpRequest to receive data from a server in response to a user action. While the returned data is normally in XML format, it can also be returned in JSON string format and processed more easily in JavaScript.&lt;br /&gt;Many applications may store information in XML format. However they may want to send data to a client using JSON.&lt;br /&gt;To achieve this, they must convert their XML data into JSON format.&lt;br /&gt;JSON Site: &lt;a href="http://www.json.org/"&gt;JSON&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.phdcc.com/xml2json.htm"&gt;How to convert XML to JSON in ASP.NET C#&lt;/a&gt;&lt;br /&gt;&lt;a href="http://aspnetpodcast.com/CS11/blogs/asp.net_podcast/archive/2006/12/27/asp-net-podcast-show-80-json-data-format.aspx"&gt;ASP.NET Podcast on JSON&lt;/a&gt;</description><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total></item><item><title>.NET Framework 3.0</title><link>http://martin-mforme.blogspot.com/2007/12/net-framework-30.html</link><author>noreply@blogger.com (Martin)</author><pubDate>Thu, 20 Dec 2007 14:08:00 +1100</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-2158307754372575291.post-3096980359412259752</guid><description>&lt;span style="font-size:85%;"&gt;When speaking to developers about WinFX one question that repeatedly comes up is, “WinFX sounds great, but what happens to .NET?” .NET Framework has become one of the most successful developer platforms in the world.&lt;br /&gt;The .NET Framework has always been at the core of WinFX, but the WinFX brand didn’t convey this. The WinFX brand helped us introduce the incredible innovations in terms of Windows Presentation Foundation (WPF), Windows Communication Foundation (WCF), Windows Workflow Foundation (WF) and the newly christened Windows CardSpace (WCS) formerly known under the codename “InfoCard.” The brand also created an unnatural discontinuity between previous versions of our framework and the current version.&lt;br /&gt;With this in mind we have decided to rename WinFX to the .NET Framework 3.0. .NET Framework 3.0 aptly identifies the technology for exactly what it is – the next version of our developer framework.&lt;br /&gt;The change is in name only and will not affect the technologies being delivered as part of the product. The .NET Framework 3.0 is still comprised of the existing .NET Framework 2.0 components, including ASP.NET, WinForms, ADO.NET, additional base class libraries and the CLR, as well as new developer-focused innovative technologies in WPF, WCF, WF and WCS.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;The .NET Framework 3.0 will still ship with Windows Vista, and will be available down-level for Windows XP and Windows Server 2003 as planned. This change doesn’t affect in any way the ship schedules of either Windows Vista or the .NET Framework 3.0 itself.&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;a href="http://dotnetslackers.com/articles/csharp/Csharp_3_0_An_Introduction.aspx"&gt;C# 3.0: An Introduction&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;p align="left"&gt;&lt;a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjLOk9VBeFqMj8Gd0N-uDj0bCkI1oIk_qBVkHxqCORvC63ftGaXaiS2uiwZSXYco_UZtWAFPLtHyVLutZJQDrbq8zScPjZRLfLHCOh9dCc0MeLyXL5Uzhz2uFd7LNx9oImDG61Ry80rk_g/s1600-h/untitled.PNG"&gt;&lt;img id="BLOGGER_PHOTO_ID_5145887623608455858" style="DISPLAY: block; MARGIN: 0px auto 10px; CURSOR: hand; TEXT-ALIGN: center" alt="" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjLOk9VBeFqMj8Gd0N-uDj0bCkI1oIk_qBVkHxqCORvC63ftGaXaiS2uiwZSXYco_UZtWAFPLtHyVLutZJQDrbq8zScPjZRLfLHCOh9dCc0MeLyXL5Uzhz2uFd7LNx9oImDG61Ry80rk_g/s400/untitled.PNG" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;h3 class="post-title entry-title"&gt;.NET 3.5&lt;/h3&gt;&lt;span style="font-size:85%;"&gt;With the release of .&lt;strong&gt;NET 3.5&lt;/strong&gt; is Language Integrated Query (&lt;strong&gt;LINQ&lt;/strong&gt;). &lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;&lt;strong&gt;LINQ&lt;/strong&gt; essentially is the composition of many standard query operators that allow you to work with data in a more intuitive way &lt;strong&gt;regardless&lt;/strong&gt; of the &lt;strong&gt;data source&lt;/strong&gt;.&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;You can &lt;strong&gt;query in-memory collections&lt;/strong&gt;, &lt;strong&gt;Relational Data&lt;/strong&gt; and &lt;strong&gt;XML&lt;/strong&gt;.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;For an introduction to &lt;strong&gt;LINQ&lt;/strong&gt; goto : &lt;/span&gt;&lt;a href="http://www.deitel.com/ResourceCenters/Programming/.NET3.5/LINQ/tabid/2617/Default.aspx"&gt;&lt;span style="font-size:85%;"&gt;.NET 3.5 LINQ&lt;/span&gt;&lt;/a&gt;</description><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" height="72" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjLOk9VBeFqMj8Gd0N-uDj0bCkI1oIk_qBVkHxqCORvC63ftGaXaiS2uiwZSXYco_UZtWAFPLtHyVLutZJQDrbq8zScPjZRLfLHCOh9dCc0MeLyXL5Uzhz2uFd7LNx9oImDG61Ry80rk_g/s72-c/untitled.PNG" width="72"/><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total></item><item><title>XSLT - Simple HTML Table</title><link>http://martin-mforme.blogspot.com/2007/12/xslt-simple-html-table.html</link><author>noreply@blogger.com (Martin)</author><pubDate>Wed, 19 Dec 2007 12:38:00 +1100</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-2158307754372575291.post-5635385080829924852</guid><description>&lt;strong&gt;In this example we will convert a simple XML file to HTML&lt;/strong&gt;&lt;br /&gt;&lt;a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgRO4TRR5sT_5NBdwtDjzE3N-sslZgzpc15mn1bOQTu9umVc-bcxtFJo90vDt_8TAcYbdSMeVQOCfcnqZhcj9paWRmWBmMQm0PWHt1ahATpZEtanILZmEL1iThTobMroAIMLVN4S6n7lYs/s1600-h/xml.PNG"&gt;&lt;img id="BLOGGER_PHOTO_ID_5145494427942441602" style="FLOAT: left; MARGIN: 0px 10px 10px 0px; CURSOR: hand" alt="" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgRO4TRR5sT_5NBdwtDjzE3N-sslZgzpc15mn1bOQTu9umVc-bcxtFJo90vDt_8TAcYbdSMeVQOCfcnqZhcj9paWRmWBmMQm0PWHt1ahATpZEtanILZmEL1iThTobMroAIMLVN4S6n7lYs/s400/xml.PNG" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style="font-family:verdana;font-size:85%;"&gt;&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style="font-family:verdana;font-size:85%;"&gt;The HTML output&lt;/span&gt;&lt;br /&gt;&lt;/strong&gt;&lt;span style="font-size:85%;"&gt;The goal is to generate the HTML output shown below using the XML document as the source of the information.&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhkbSfoZ8dpUwy408JZ0j8JEJxB6wf7FDWEwg8N-Fp7CP-9MeUvevqBuwsfNLmTl-zZkWYsi7H-fjOD2nqH18lrumqC7Fc7vBZemzbqq4EeVsQjSfFxImj8vBGykluIzrIndhj3juTgZh8/s1600-h/html.PNG"&gt;&lt;img id="BLOGGER_PHOTO_ID_5145494140179632754" style="FLOAT: left; MARGIN: 0px 10px 10px 0px; CURSOR: hand" alt="" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhkbSfoZ8dpUwy408JZ0j8JEJxB6wf7FDWEwg8N-Fp7CP-9MeUvevqBuwsfNLmTl-zZkWYsi7H-fjOD2nqH18lrumqC7Fc7vBZemzbqq4EeVsQjSfFxImj8vBGykluIzrIndhj3juTgZh8/s400/html.PNG" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;/strong&gt;&lt;br /&gt;&lt;span style="font-family:verdana;"&gt;&lt;span style="font-size:85%;"&gt;&lt;strong&gt;XSLT&lt;/strong&gt; will help us to do this.&lt;br /&gt;&lt;strong&gt;Add this line to your XML file.&lt;/strong&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiyAKuAbOHVDTCVuCH0tIIKyVBSqb7Fb7z0P4H1vGQTz1sTvgdezWMvYSuWvANzer5YwZk4brr0NznQq4l6HIfGI9Iw_0MkY9qYVCvIzTuIFv_aAENDRf0J_knjbd6RgBibq8cIuc0h0_8/s1600-h/xslentry.PNG"&gt;&lt;img id="BLOGGER_PHOTO_ID_5145496841714061986" style="CURSOR: hand" alt="" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiyAKuAbOHVDTCVuCH0tIIKyVBSqb7Fb7z0P4H1vGQTz1sTvgdezWMvYSuWvANzer5YwZk4brr0NznQq4l6HIfGI9Iw_0MkY9qYVCvIzTuIFv_aAENDRf0J_knjbd6RgBibq8cIuc0h0_8/s400/xslentry.PNG" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;Here's the &lt;em&gt;people.xsl&lt;/em&gt; &lt;strong&gt;(XSL) &lt;/strong&gt;file that produces the &lt;strong&gt;HTML&lt;/strong&gt;.&lt;br /&gt;Every XSL file needs to specify the &lt;strong&gt;XSL namespace&lt;/strong&gt; so that the parser knows which version of XSLT to use.&lt;br /&gt;&lt;/span&gt;&lt;img id="BLOGGER_PHOTO_ID_5145495922591060626" style="FLOAT: left; MARGIN: 0px 10px 10px 0px; CURSOR: hand" alt="" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgT1BEEWkZxUsAbhxZjcaTo-YPfskMYCnkJ0FFbISEbKn9h9QecYo3hpk5VqwFWhMo7n9EsSLoePhT6V9P1cbLMRMtDRQLXK15118pDlH8MnSdRiKTAi9YC52QUigWSpZp_YUvIJXHWd90/s400/xsl.PNG" border="0" /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style="font-family:verdana;font-size:85%;"&gt;Here's a break down of the XSL file.&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;The namespace prefix &lt;strong&gt;xsl&lt;/strong&gt;: is used in the rest of the XSL file to identify XSL processing&lt;/span&gt; statements. &lt;span style="font-size:85%;"&gt;If a statement isn't prefixed with xsl:, then it's simply copied to the output without being processed&lt;/span&gt;. &lt;span style="font-size:85%;"&gt;This is the way to add HTML statements to the output.&lt;/span&gt; &lt;span style="font-size:85%;"&gt;When we are working with XSLT, the context for a query is the node in the source XML document currently being processed. So in the template xsl:template match="/", we are in the context of the root of the XML document. This isn't the PEOPLE element, it's the whole document, above the PEOPLE element.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:verdana;"&gt;When you're &lt;strong&gt;debugging XSL&lt;/strong&gt;, the first question you should ask is, "What context is being processed?".&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:verdana;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;The backslashes are not part of the syntax.&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;a href="file://xsl:template%20match=/"&gt;&lt;\xsl:template match="/"\&gt;&lt;/a&gt; &lt;span style="font-family:courier new;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;Before processing can begin, the part of the XML document with the information to be copied to the output must be selected with a XPath expression. The selected section of the document is called a node and is normally selected with the match operator. If the entire document is to be selected, match the root node using match="/". Another approach is to match the document element (the element that includes the entire document). In our example, the document element can be selected using match="PEOPLE". (If you use this alternative approach, don't include PEOPLE in the 'for-each' selection below.)&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:courier new;"&gt;The backslashes are not part of the syntax.&lt;br /&gt;&lt;/span&gt;&lt;strong&gt;&lt;\xsl:for-each select="PEOPLE/PERSON"\&gt;&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;strong&gt;&lt;/strong&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;The expression &lt;strong&gt;xsl:for-each&lt;/strong&gt; finds all &lt;strong&gt;'PERSON'&lt;/strong&gt; elements in the 'PEOPLE' element context using the &lt;strong&gt;XPath&lt;/strong&gt; expression 'PEOPLE/PERSON'. If the selected node contains all elements in the root, all of the 'PEOPLE' elements will be selected. Since we want to include all 'PERSON' elements in our output document, we have used this expression.&lt;br /&gt;The 'for-each' expression is a loop that processes the same instructions for these elements. &lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:courier new;"&gt;The backslashes are not part of the syntax.&lt;br /&gt;&lt;/span&gt;&lt;strong&gt;&lt;\xsl:value-of select="NAME"/\&gt; &lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;&lt;strong&gt;&lt;\xsl:value-of select="ADDRESS" /\&gt;&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;&lt;strong&gt;&lt;\xsl:value-of select="TEL" /\&gt; etc...&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;When the &lt;strong&gt;xsl:for-each&lt;/strong&gt; expression has selected a 'PERSON' element, the &lt;strong&gt;xsl:value-of&lt;/strong&gt; expression extracts and copies to the output file the value stored in the selected element. In this case, the value stored in the 'NAME' element is copied to the output. This call is made for each value you are extracting.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;This will produce the html required that can then be displayed in the clients browser.&lt;/span&gt;</description><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" height="72" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgRO4TRR5sT_5NBdwtDjzE3N-sslZgzpc15mn1bOQTu9umVc-bcxtFJo90vDt_8TAcYbdSMeVQOCfcnqZhcj9paWRmWBmMQm0PWHt1ahATpZEtanILZmEL1iThTobMroAIMLVN4S6n7lYs/s72-c/xml.PNG" width="72"/><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total></item><item><title>AJAX .Net Wrapper</title><link>http://martin-mforme.blogspot.com/2007/12/ajax-net-wrapper.html</link><author>noreply@blogger.com (Martin)</author><pubDate>Tue, 18 Dec 2007 15:55:00 +1100</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-2158307754372575291.post-7469291852565818482</guid><description>&lt;strong&gt;Asynchronous JavaScript and XML (AJAX) &lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;&lt;/strong&gt;&lt;br /&gt;&lt;a href="http://www.adaptivepath.com/ideas/essays/archives/000385.php"&gt;&lt;br /&gt;Ajax: A New Approach to Web Applications&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Download the Ajax DLL from:&lt;br /&gt;&lt;a href="http://ajax.schwarz-interactive.de/CSharpSample/"&gt;Ajax.NET&lt;/a&gt;&lt;br /&gt;Add the &lt;strong&gt;Ajax.dll &lt;/strong&gt;reference to your application.&lt;br /&gt;Add the &lt;strong&gt;using Ajax; &lt;/strong&gt;namespace to your page.&lt;br /&gt;Add the &lt;strong&gt;httpHandler &lt;/strong&gt;to your web.config.&lt;br /&gt;&lt;br /&gt;&lt;a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhBvFsjzTuSo0i5ZtO3sCRRRy5aIGVLUjlcnlXhcEA2lWt24PXOcsKSUb2EzDnMlkazxhrNLNa5eraMUYbtfSPoSQ0ElvDYXpIeqxXWR1n2NxfikwHFEbufkYrASY6_figvyYx7F4zWh3k/s1600-h/handler.PNG"&gt;&lt;img id="BLOGGER_PHOTO_ID_5145180345574019650" style="FLOAT: left; MARGIN: 0px 10px 10px 0px; WIDTH: 299px; CURSOR: hand; HEIGHT: 60px" height="90" alt="" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhBvFsjzTuSo0i5ZtO3sCRRRy5aIGVLUjlcnlXhcEA2lWt24PXOcsKSUb2EzDnMlkazxhrNLNa5eraMUYbtfSPoSQ0ElvDYXpIeqxXWR1n2NxfikwHFEbufkYrASY6_figvyYx7F4zWh3k/s320/handler.PNG" width="366" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Sample Code to try.&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;Ajax can return custom classes. All that is required is that the class be marked with the Serializable attribute. Given the following class:&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;[Serializable()]&lt;/strong&gt;&lt;br /&gt;public class User&lt;br /&gt;{&lt;br /&gt;&lt;span style="font-size:85%;"&gt;private int _userId;&lt;br /&gt;private string _firstName;&lt;br /&gt;private string _lastName;&lt;br /&gt;public int userId{ get { return _userId; } }&lt;br /&gt;public string FirstName{ get { return _firstName; } }&lt;br /&gt;public string LastName{ get { return _lastName; } }&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;public User(int _userId, string _firstName, string _lastName)&lt;br /&gt;{&lt;br /&gt;&lt;span style="font-size:85%;"&gt;this._userId = _userId;&lt;br /&gt;this._firstName = _firstName;&lt;br /&gt;this._lastName = _lastName;&lt;br /&gt;&lt;/span&gt;}&lt;br /&gt;public User(){}&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;[AjaxMethod()]&lt;br /&gt;&lt;/strong&gt;public static User GetUser(int userId)&lt;br /&gt;{&lt;br /&gt;&lt;span style="font-size:85%;"&gt;// The &lt;strong&gt;userId&lt;/strong&gt; would normally be a value to use in a DB call.&lt;br /&gt;&lt;/span&gt;return &lt;span style="color:#3366ff;"&gt;&lt;strong&gt;new&lt;/strong&gt;&lt;/span&gt; User(userId,"Elvis", "Costello");&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;We would register the GetUser proxy via a call to the &lt;strong&gt;&lt;span style="font-size:85%;"&gt;RegisterTypeForAjax&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;private void &lt;strong&gt;Page_Load&lt;/strong&gt;(object sender, EventArgs e)&lt;br /&gt;{&lt;br /&gt;&lt;span style="font-size:85%;"&gt;Ajax.Utility.RegisterTypeForAjax(typeof(&lt;strong&gt;User&lt;/strong&gt;), this.Page);&lt;/span&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;Allowing us to asynchronously call the &lt;strong&gt;GetUser &lt;/strong&gt;in client-side code with code such as:&lt;br /&gt;&lt;br /&gt;&lt;a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh7B9fHxD-_NtzhNfkULJaRsUP0qUsx7WROz8WQCFw4OWvJvgdcrhLTQ8ubGXKu89vtWh7yBSMnzQ5Td1DNPjQyYVNEBmJit2OjbNsW5FjyaQaEKQiUmAY2_AuITKL1P0xmQdMFzj7a950/s1600-h/script1.PNG"&gt;&lt;img id="BLOGGER_PHOTO_ID_5145175114303853106" style="FLOAT: left; MARGIN: 0px 10px 10px 0px; CURSOR: hand" alt="" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh7B9fHxD-_NtzhNfkULJaRsUP0qUsx7WROz8WQCFw4OWvJvgdcrhLTQ8ubGXKu89vtWh7yBSMnzQ5Td1DNPjQyYVNEBmJit2OjbNsW5FjyaQaEKQiUmAY2_AuITKL1P0xmQdMFzj7a950/s320/script1.PNG" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;The value returned in the response is actually an object which exposes the same properties as a server-side object (FirstName, LastName and UserId).</description><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" height="72" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhBvFsjzTuSo0i5ZtO3sCRRRy5aIGVLUjlcnlXhcEA2lWt24PXOcsKSUb2EzDnMlkazxhrNLNa5eraMUYbtfSPoSQ0ElvDYXpIeqxXWR1n2NxfikwHFEbufkYrASY6_figvyYx7F4zWh3k/s72-c/handler.PNG" width="72"/><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total></item><item><title>Remote Desktop</title><link>http://martin-mforme.blogspot.com/2007/12/remote-desktop.html</link><author>noreply@blogger.com (Martin)</author><pubDate>Tue, 18 Dec 2007 15:52:00 +1100</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-2158307754372575291.post-4551930509532527619</guid><description>mstsc.exe</description><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total></item><item><title>Make your Site OffLine in IIS</title><link>http://martin-mforme.blogspot.com/2007/12/make-your-site-offline-in-iis.html</link><author>noreply@blogger.com (Martin)</author><pubDate>Tue, 18 Dec 2007 15:42:00 +1100</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-2158307754372575291.post-6502719573682530716</guid><description>Add the following file &lt;strong&gt;app_offline.htm &lt;/strong&gt;in the physical directory of your internet site and when the url for the site is requested the &lt;strong&gt;app_offline.htm&lt;/strong&gt; file will be loaded instead of your default page.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;HTM Contents can be any thing you want. &lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;Sample contents.&lt;br /&gt;This application is currently offline. To enable the application, remove the app_offline.htm file from the application root directory.</description><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total></item></channel></rss>