<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Building Better Software - One Line At A Time</title><link>http://blogs.msdn.com/permanenttan/default.aspx</link><description /><dc:language>en</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>How to convert a Visual Studio 2010 Branch back to a Folder</title><link>http://blogs.msdn.com/permanenttan/archive/2009/11/20/how-to-convert-a-visual-studio-2010-branch-back-to-a-folder.aspx</link><pubDate>Fri, 20 Nov 2009 14:59:19 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9926227</guid><dc:creator>PermanentTan</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.msdn.com/permanenttan/comments/9926227.aspx</comments><wfw:commentRss>http://blogs.msdn.com/permanenttan/commentrss.aspx?PostID=9926227</wfw:commentRss><description>&lt;p&gt;Visual Studio 2010 extends the concept of a folder as a “first-class” branch and introduces the tools to convert folders to first-class branches to enable exciting new Branch Visualization and Tracking Changes features. For reference, please see &lt;a title="http://blogs.msdn.com/hakane/archive/2009/05/19/enable-branch-visualization-in-upgraded-team-projects-tfs-2010-beta1.aspx" href="http://blogs.msdn.com/hakane/archive/2009/05/19/enable-branch-visualization-in-upgraded-team-projects-tfs-2010-beta1.aspx"&gt;http://blogs.msdn.com/hakane/archive/2009/05/19/enable-branch-visualization-in-upgraded-team-projects-tfs-2010-beta1.aspx&lt;/a&gt; and &lt;a title="http://msdn.microsoft.com/en-us/library/ms181423(VS.100).aspx" href="http://msdn.microsoft.com/en-us/library/ms181423(VS.100).aspx"&gt;http://msdn.microsoft.com/en-us/library/ms181423(VS.100).aspx&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;Source Control Explorer context menu and toolbar have the button to convert a folder to a branch but not one for converting a branch back to a folder. You can find that functionality from the main menu under File &amp;gt; Source Control &amp;gt; Branching and Merging. Note that Reparent is also available there.&lt;/p&gt;  &lt;p&gt;Enjoy.&lt;/p&gt;  &lt;p&gt;-Tan&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9926227" width="1" height="1"&gt;</description></item><item><title>Go to Changeset for Visual Studio 2010</title><link>http://blogs.msdn.com/permanenttan/archive/2009/11/20/go-to-changeset-for-visual-studio-2010.aspx</link><pubDate>Fri, 20 Nov 2009 13:42:42 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9926187</guid><dc:creator>PermanentTan</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.msdn.com/permanenttan/comments/9926187.aspx</comments><wfw:commentRss>http://blogs.msdn.com/permanenttan/commentrss.aspx?PostID=9926187</wfw:commentRss><description>&lt;p&gt;In previous versions of Visual Studio, hitting Ctrl+G from Source Control Explorer brings up the Find Changeset dialog. In VS 2010, Ctrl+G brings up the new Go to Changeset dialog which lets you quickly enter a changeset number and get the changeset details.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/permanenttan/WindowsLiveWriter/GotoChangesetforVisualStudio2010_7A80/image_2.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/permanenttan/WindowsLiveWriter/GotoChangesetforVisualStudio2010_7A80/image_thumb.png" width="244" height="100" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;In this dialog, you can also hit Ctrl+G again to bring up the Find Changeset dialog. So effectively from Source Control Explorer, one Ctrl+G for “Go to Changeset” and twice for “Find Changeset”.&lt;/p&gt;  &lt;p&gt;Enjoy.&lt;/p&gt;  &lt;p&gt;-Tan&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9926187" width="1" height="1"&gt;</description></item><item><title>WPF TreeView Memory Consumption and Performance</title><link>http://blogs.msdn.com/permanenttan/archive/2009/11/20/wpf-treeview-memory-consumption-and-performance.aspx</link><pubDate>Fri, 20 Nov 2009 13:29:05 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9926178</guid><dc:creator>PermanentTan</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.msdn.com/permanenttan/comments/9926178.aspx</comments><wfw:commentRss>http://blogs.msdn.com/permanenttan/commentrss.aspx?PostID=9926178</wfw:commentRss><description>&lt;p&gt;One very simple thing you can do that can significantly reduce the memory consumption and drastically improve performance of a WPF TreeView is to set the following two properties. In XAML, you would do:&lt;/p&gt;  &lt;p&gt;&lt;font size="2" face="Courier New"&gt;&amp;lt;TreeView x:Name=”myTreeView”&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font size="2" face="Courier New"&gt;&lt;strong&gt;&lt;em&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; VirtualizingStackPanel.IsVirtualizing=&amp;quot;True&amp;quot;&lt;/em&gt;&lt;/strong&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font size="2" face="Courier New"&gt;&lt;em&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;strong&gt;VirtualizingStackPanel.VirtualizationMode=&amp;quot;Recycling&amp;quot;&lt;/strong&gt;&lt;/em&gt; /&amp;gt;&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;In a simple test of a data-bound TreeView containing just 5000 items, turning on stack panel virtualization reduces the memory overhead from over 110MB to about 2MB. Additionally, the control also gets a performance boost in items’ expand/collapse, selection, scrolling, and general navigation.&lt;/p&gt;  &lt;p&gt;The WPF ListView also support these properties but, unlike the TreeView, its VirtualizingStackPanel.IsVirtualizing is already default to True.&lt;/p&gt;  &lt;p&gt;Enjoy.&lt;/p&gt;  &lt;p&gt;-Tan&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9926178" width="1" height="1"&gt;</description></item><item><title>Data Bind Using Only Code Behind</title><link>http://blogs.msdn.com/permanenttan/archive/2009/06/21/data-bind-using-only-code-behind.aspx</link><pubDate>Mon, 22 Jun 2009 00:54:04 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9796330</guid><dc:creator>PermanentTan</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.msdn.com/permanenttan/comments/9796330.aspx</comments><wfw:commentRss>http://blogs.msdn.com/permanenttan/commentrss.aspx?PostID=9796330</wfw:commentRss><description>&lt;p&gt;We are all familiar with the use of WPF Binding in XAML. For example, the following lines bind the caption of a Button (variableCaptionButton) to the text of a TextBox (sourceText).&lt;/p&gt;  &lt;p&gt;&lt;font face="Courier New"&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font face="Courier New"&gt;&amp;lt;TextBox x:Name=&amp;quot;sourceText&amp;quot; Grid.Row=&amp;quot;0&amp;quot; /&amp;gt;      &lt;br /&gt;&amp;lt;Button x:Name=&amp;quot;variableCaptionButton&amp;quot; Grid.Row=&amp;quot;1&amp;quot; Content=&amp;quot;{Binding ElementName=sourceText, Path=Text}&amp;quot;/&amp;gt;&lt;/font&gt; &lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;Have there been times when you need to dynamically build or add UI elements from code behind and have a need to also create bindings among those dynamically created UI elements? &lt;/p&gt;  &lt;p&gt;Creating binding using only code behind is easy.&lt;/p&gt;  &lt;p&gt;Here is the code behind to accomplish the same binding shown in the above XAML code.&lt;/p&gt;  &lt;p&gt;&lt;font face="Courier New"&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font face="Courier New"&gt;Binding binding = new Binding(&amp;quot;Text&amp;quot;);      &lt;br /&gt;binding.Source = sourceText;       &lt;br /&gt;variableCaptionButton.SetBinding(Button.ContentProperty, binding);&lt;/font&gt; &lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;The Binding instance defines the data source (the “sourceText” TextBox), and which data source property (the “Text” property). SetBinding() connects a binding source to the receiving property on the target element (“variableCaptionButton” button).&lt;/p&gt;  &lt;p&gt;Additionally, you can also define a value converter and parameter via the properties, Binding.Converter and Binding.ConverterParameter, respectively.&lt;/p&gt;  &lt;p&gt;That’s it!&lt;/p&gt;  &lt;p&gt;-Tan&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9796330" width="1" height="1"&gt;</description></item><item><title>Array as a WPF ConverterParameter</title><link>http://blogs.msdn.com/permanenttan/archive/2009/06/19/array-as-a-wpf-converterparameter.aspx</link><pubDate>Fri, 19 Jun 2009 07:31:09 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9779136</guid><dc:creator>PermanentTan</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.msdn.com/permanenttan/comments/9779136.aspx</comments><wfw:commentRss>http://blogs.msdn.com/permanenttan/commentrss.aspx?PostID=9779136</wfw:commentRss><description>&lt;p&gt;A WPF value converter accepts a value and an optional parameter. The parameter can be specified in the XAML binding as a string like the following:&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&lt;font face="Courier New"&gt;&amp;lt;TextBlock Background=”{Binding Path=myElement, Converter={StatisResource MyConverter}, ConverterParameter=myParameterText}” /&amp;gt;&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;Instead of one string, what if you want to pass an array of strings as a converter parameter? What about an array of brushes?&lt;/p&gt;  &lt;p&gt;The trick is to specify the binding in its own XAML tag and use Binding.ConverterParameter and Array. Here is an example of how to pass an array of Strings and an array of Brushes into a value converter. Note the uses of Binding, Binding.ConverterParameter, and Array.&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&lt;font face="Courier New"&gt;&amp;lt;Window x:Class=&amp;quot;ConverterParameters.Window1&amp;quot;      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; xmlns=&amp;quot;&lt;/font&gt;&lt;a href="http://schemas.microsoft.com/winfx/2006/xaml/presentation&amp;quot;"&gt;&lt;font face="Courier New"&gt;http://schemas.microsoft.com/winfx/2006/xaml/presentation&amp;quot;&lt;/font&gt;&lt;/a&gt;     &lt;br /&gt;&lt;font face="Courier New"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; xmlns:x=&amp;quot;&lt;/font&gt;&lt;a href="http://schemas.microsoft.com/winfx/2006/xaml&amp;quot;"&gt;&lt;font face="Courier New"&gt;http://schemas.microsoft.com/winfx/2006/xaml&amp;quot;&lt;/font&gt;&lt;/a&gt;     &lt;br /&gt;&lt;font face="Courier New"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; xmlns:mscor=&amp;quot;clr-namespace:System;assembly=mscorlib&amp;quot;      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; xmlns:local=&amp;quot;clr-namespace:ConverterParameters&amp;quot;       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; WindowStartupLocation=&amp;quot;CenterScreen&amp;quot;       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; Title=&amp;quot;Array as ConverterParameter&amp;quot; Height=&amp;quot;100&amp;quot; Width=&amp;quot;300&amp;quot;&amp;gt;       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; &amp;lt;Window.Resources&amp;gt;       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;local:IntToStringMux x:Key=&amp;quot;IntToStringMux&amp;quot;/&amp;gt;       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;local:IntToBrushMux x:Key=&amp;quot;IntToBrushMux&amp;quot;/&amp;gt;       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; &amp;lt;/Window.Resources&amp;gt;       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; &amp;lt;Grid&amp;gt;       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;Grid.RowDefinitions&amp;gt;       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;RowDefinition Height=&amp;quot;*&amp;quot; /&amp;gt;       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;RowDefinition Height=&amp;quot;Auto&amp;quot; /&amp;gt;       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;/Grid.RowDefinitions&amp;gt; &lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font face="Courier New"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;TextBlock Grid.Row=&amp;quot;0&amp;quot; HorizontalAlignment=&amp;quot;Stretch&amp;quot; VerticalAlignment=&amp;quot;Center&amp;quot; TextAlignment=&amp;quot;Center&amp;quot;&amp;gt;      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;TextBlock.Text&amp;gt;       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;Binding ElementName=&amp;quot;mySelector&amp;quot; Path=&amp;quot;SelectedIndex&amp;quot; Converter=&amp;quot;{StaticResource IntToStringMux}&amp;quot;&amp;gt;       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;Binding.ConverterParameter&amp;gt;       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;x:Array Type=&amp;quot;mscor:String&amp;quot;&amp;gt;       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;mscor:String&amp;gt;A selected&amp;lt;/mscor:String&amp;gt;       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;mscor:String&amp;gt;B selected&amp;lt;/mscor:String&amp;gt;       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;mscor:String&amp;gt;C selected&amp;lt;/mscor:String&amp;gt;       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;mscor:String&amp;gt;D selected&amp;lt;/mscor:String&amp;gt;       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;/x:Array&amp;gt;       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;/Binding.ConverterParameter&amp;gt;       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;/Binding&amp;gt;       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;/TextBlock.Text&amp;gt;       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;TextBlock.Background&amp;gt;       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;Binding ElementName=&amp;quot;mySelector&amp;quot; Path=&amp;quot;SelectedIndex&amp;quot; Converter=&amp;quot;{StaticResource IntToBrushMux}&amp;quot;&amp;gt;       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;Binding.ConverterParameter&amp;gt;       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;x:Array Type=&amp;quot;Brush&amp;quot;&amp;gt;       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;SolidColorBrush Color=&amp;quot;LawnGreen&amp;quot;/&amp;gt;       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;SolidColorBrush Color=&amp;quot;LightSkyBlue&amp;quot;/&amp;gt;       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;SolidColorBrush Color=&amp;quot;LightCoral&amp;quot;/&amp;gt;       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;/x:Array&amp;gt;       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;/Binding.ConverterParameter&amp;gt;       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;/Binding&amp;gt;       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;/TextBlock.Background&amp;gt;       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;/TextBlock&amp;gt; &lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font face="Courier New"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;ComboBox x:Name=&amp;quot;mySelector&amp;quot; Grid.Row=&amp;quot;1&amp;quot; SelectedIndex=&amp;quot;0&amp;quot;&amp;gt;      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;ComboBox.Items&amp;gt;       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;ComboBoxItem&amp;gt;Item A&amp;lt;/ComboBoxItem&amp;gt;       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;ComboBoxItem&amp;gt;Item B&amp;lt;/ComboBoxItem&amp;gt;       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;ComboBoxItem&amp;gt;Item C&amp;lt;/ComboBoxItem&amp;gt;       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;ComboBoxItem&amp;gt;Item D&amp;lt;/ComboBoxItem&amp;gt;       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;/ComboBox.Items&amp;gt;       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;/ComboBox&amp;gt;       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; &amp;lt;/Grid&amp;gt;       &lt;br /&gt;&amp;lt;/Window&amp;gt;&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;For completeness, the implementations for the IntToStringMux and IntToBrushMux converters are also included below.&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&lt;font face="Courier New"&gt;[ValueConversion(typeof(int), typeof(String))]      &lt;br /&gt;public class IntToStringMux : IValueConverter       &lt;br /&gt;{       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; {       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; String result = String.Empty;       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; int itemIndex = 0;       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; String[] itemDescriptions = parameter as String[]; &lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font face="Courier New"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; if (value != null &amp;amp;&amp;amp; value.GetType() == typeof(int))      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; {       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; itemIndex = (int)value;       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; } &lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font face="Courier New"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; if (itemDescriptions != null &amp;amp;&amp;amp; itemIndex &amp;lt; itemDescriptions.Length)      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; {       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; result = itemDescriptions[itemIndex];       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; } &lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font face="Courier New"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; return result;      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; } &lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font face="Courier New"&gt;&amp;#160;&amp;#160;&amp;#160; public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; {       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; throw new NotImplementedException();       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; }       &lt;br /&gt;} &lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font face="Courier New"&gt;[ValueConversion(typeof(int), typeof(Brush))]      &lt;br /&gt;public class IntToBrushMux : IValueConverter       &lt;br /&gt;{       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; {       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; Brush result = Brushes.Red;       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; int itemIndex = 0;       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; Brush[] brushes = parameter as Brush[]; &lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font face="Courier New"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; if (value != null &amp;amp;&amp;amp; value.GetType() == typeof(int))      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; {       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; itemIndex = (int)value;       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; } &lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font face="Courier New"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; if (brushes != null &amp;amp;&amp;amp; itemIndex &amp;lt; brushes.Length)      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; {       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; result = brushes[itemIndex];       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; } &lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font face="Courier New"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; return result;      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; } &lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font face="Courier New"&gt;&amp;#160;&amp;#160;&amp;#160; public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; {       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; throw new NotImplementedException();       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; }       &lt;br /&gt;}&lt;/font&gt; &lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;That’s it!&lt;/p&gt;  &lt;p&gt;Hope this helps. -Tan&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9779136" width="1" height="1"&gt;</description></item><item><title>Setting Initial Focus in XAML</title><link>http://blogs.msdn.com/permanenttan/archive/2009/06/11/setting-initial-focus-in-xaml.aspx</link><pubDate>Thu, 11 Jun 2009 16:34:13 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9726536</guid><dc:creator>PermanentTan</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.msdn.com/permanenttan/comments/9726536.aspx</comments><wfw:commentRss>http://blogs.msdn.com/permanenttan/commentrss.aspx?PostID=9726536</wfw:commentRss><description>&lt;p&gt;Last time we looked at a tricky problem of setting the initial focus to a specific item in a populated WPF ListView. Most of the time, however, we just want to set the initial focus to a control (like a TextBox or a Button) in our UI. There are a couple of ways to accomplish this.&lt;/p&gt;  &lt;ol&gt;   &lt;li&gt;Hook the Window’s Loaded event and set the focus to the desired control in the code-behind handler &lt;/li&gt;    &lt;li&gt;Use FocusManager.FocusedElement &lt;/li&gt; &lt;/ol&gt;  &lt;p&gt;The second solution is easier and can all be done in XAML. For example:&lt;/p&gt;  &lt;p&gt;&lt;font size="2" face="Courier New"&gt;&amp;lt;Window …&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font size="2" face="Courier New"&gt;&amp;#160;&amp;#160;&amp;#160; FocusManager.FocusedElement=&amp;quot;{Binding ElementName=myTextBox}&amp;quot;&amp;gt;&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font size="2" face="Courier New"&gt;&amp;#160;&amp;#160;&amp;#160; …&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font size="2" face="Courier New"&gt;&amp;#160;&amp;#160;&amp;#160; &amp;lt;TextBox x:Name=”myTextBox”/&amp;gt;&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font size="2" face="Courier New"&gt;&amp;lt;/Window&amp;gt;&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;Hope this helps. -Tan&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9726536" width="1" height="1"&gt;</description></item><item><title>Setting the Initial Focus to a ListView item</title><link>http://blogs.msdn.com/permanenttan/archive/2009/04/29/setting-the-initial-focus-to-a-listview-item.aspx</link><pubDate>Wed, 29 Apr 2009 20:03:42 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9576088</guid><dc:creator>PermanentTan</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/permanenttan/comments/9576088.aspx</comments><wfw:commentRss>http://blogs.msdn.com/permanenttan/commentrss.aspx?PostID=9576088</wfw:commentRss><description>&lt;p&gt;This blog describes the steps needed to set the initial keyboard focus to an item in a WPF ListView. The items in the list can be static or data bound. The trick is to access the ListViewItem associated with an item and then set keyboard focus to it.&lt;/p&gt;  &lt;p&gt;The following are snippets of the code behind for a dialog with a ListView named myListView and selecting and setting the initial focus to the last item in the list.&lt;/p&gt;  &lt;h2&gt;Sample Code to Populate the ListView&lt;/h2&gt;  &lt;p&gt;&lt;font face="vera"&gt;The for loop populates the list view with some sample items. Note the call to FocusAndSelectItem().&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;public Window1()   &lt;br /&gt;{    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; InitializeComponent(); &lt;/p&gt;  &lt;p&gt;&lt;font face="Courier New"&gt;&amp;#160;&amp;#160;&amp;#160; // Add the items     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; int itemCount = 50;      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; for (int i = 0; i &amp;lt; itemCount; i++)      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; {      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; ListViewItem item = new ListViewItem();      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; item.Content = String.Format(CultureInfo.CurrentCulture, &amp;quot;Item {0}&amp;quot;, i);      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; myListView.Items.Add(item);      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; } &lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font face="Courier New"&gt;&amp;#160;&amp;#160;&amp;#160; // Focus and select the last item     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; FocusAndSelectItem(itemCount - 1);      &lt;br /&gt;}&lt;/font&gt;&lt;/p&gt;  &lt;h2&gt;Setting Focus to a ListViewItem&lt;/h2&gt;  &lt;p&gt;&lt;font face="vera"&gt;Because the list view and its items may not even be visible when they are created, the code cannot just access the list view item and immediately sets keyboard focus to it. We actually have to defer the focus setting by calling Dispatcher.BeginInvoke() to call back when the application has completed all its initial work and has reached the idle state. FocusAndSelectItem() does this.&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;In the actual method to set the keyboard focus TryFocusAndSelectItem(), note that we need to ensure that the list view item is visible by calling ScrollIntoView() before setting focus to it.&lt;/p&gt;  &lt;p&gt;   &lt;p&gt;&lt;font face="Courier New"&gt;/// &amp;lt;summary&amp;gt;       &lt;br /&gt;/// Request the focus to be set on the specified list view item        &lt;br /&gt;/// &amp;lt;/summary&amp;gt;        &lt;br /&gt;/// &amp;lt;param name=&amp;quot;itemIndex&amp;quot;&amp;gt;index of item to receive the initial focus&amp;lt;/param&amp;gt;        &lt;br /&gt;private void FocusAndSelectItem(int itemIndex)        &lt;br /&gt;{        &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; Dispatcher.BeginInvoke(new FocusAndSelectItemDelegate(TryFocusAndSelectItem), DispatcherPriority.ApplicationIdle, itemIndex);        &lt;br /&gt;} &lt;/font&gt;&lt;/p&gt;    &lt;p&gt;&lt;font face="Courier New"&gt;/// &amp;lt;summary&amp;gt;       &lt;br /&gt;/// Make sure a list view item is within the visible area of the list view        &lt;br /&gt;/// and then select and set focus to it.        &lt;br /&gt;/// &amp;lt;/summary&amp;gt;        &lt;br /&gt;/// &amp;lt;param name=&amp;quot;itemIndex&amp;quot;&amp;gt;index of item&amp;lt;/param&amp;gt;        &lt;br /&gt;private void TryFocusAndSelectItem(int itemIndex)        &lt;br /&gt;{        &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; ListViewItem lvi = myListView.Items.GetItemAt(itemIndex) as ListViewItem;        &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; if (lvi != null)        &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; {        &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; myListView.ScrollIntoView(lvi);        &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; lvi.IsSelected = true;        &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; Keyboard.Focus(lvi);        &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; }        &lt;br /&gt;} &lt;/font&gt;&lt;/p&gt;    &lt;p&gt;&lt;font face="Courier New"&gt;private delegate void FocusAndSelectItemDelegate(int itemIndex); &lt;/font&gt;&lt;/p&gt; &lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;That’s it. Hope this helps.&lt;/p&gt;  &lt;p&gt;-Tan &lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9576088" width="1" height="1"&gt;</description></item><item><title>WPF ListView with Check Boxes and No Clipping</title><link>http://blogs.msdn.com/permanenttan/archive/2009/01/19/wpf-listview-with-check-boxes-and-no-clipping.aspx</link><pubDate>Mon, 19 Jan 2009 23:17:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9340683</guid><dc:creator>PermanentTan</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.msdn.com/permanenttan/comments/9340683.aspx</comments><wfw:commentRss>http://blogs.msdn.com/permanenttan/commentrss.aspx?PostID=9340683</wfw:commentRss><description>&amp;#160; &lt;ul style="margin-top: 0in; margin-bottom: 0in; margin-left: 0.02in; direction: ltr; unicode-bidi: embed"&gt;   &lt;p style="font-size: 18pt; margin: 0in; font-family: calibri"&gt;WPF ListView with Check Boxes and No Clipping&lt;/p&gt;    &lt;p style="font-size: 11pt; margin: 0in; font-family: calibri" mce_keep="true"&gt;&amp;#160;&lt;/p&gt;    &lt;p style="font-size: 11pt; margin: 0in; font-family: calibri"&gt;Do you need a simple data-bound WPF ListView with check boxed items without text trimming ellipsis and without header columns? I very often do. In this blog, I would like to share with you a simple way to build this control that I call CheckBoxListView.&lt;/p&gt;    &lt;p style="font-size: 11pt; margin: 0in; font-family: calibri" mce_keep="true"&gt;&amp;#160;&lt;/p&gt;    &lt;p style="font-size: 18pt; margin: 0in; font-family: calibri"&gt;What We Want&lt;/p&gt;    &lt;ul style="margin-top: 0in; margin-bottom: 0in; margin-left: 0.375in; direction: ltr; unicode-bidi: embed" type="circle"&gt;     &lt;li style="margin-top: 0px; margin-bottom: 0px; vertical-align: middle"&gt;&lt;span style="font-size: 11pt; font-family: calibri"&gt;Data-bound WPF ListView with a check box at the beginning of each item&lt;/span&gt; &lt;/li&gt;      &lt;li style="margin-top: 0px; margin-bottom: 0px; vertical-align: middle"&gt;&lt;span style="font-size: 11pt; font-family: calibri"&gt;No column header&lt;/span&gt; &lt;/li&gt;      &lt;li style="margin-top: 0px; margin-bottom: 0px; vertical-align: middle"&gt;&lt;span style="font-size: 11pt; font-family: calibri"&gt;Item text not clipped and no text-trimming ellipsis &lt;/span&gt;&lt;/li&gt;      &lt;li style="margin-top: 0px; margin-bottom: 0px; vertical-align: middle"&gt;&lt;span style="font-size: 11pt; font-family: calibri"&gt;Horizontal scrollbar to automatically sized to show the widest item&lt;/span&gt;&lt;/li&gt;   &lt;/ul&gt;    &lt;p style="font-size: 11pt; margin: 0in; font-family: calibri" mce_keep="true"&gt;&amp;#160;&lt;/p&gt;    &lt;p style="font-size: 11pt; margin: 0in; font-family: calibri" mce_keep="true"&gt;&amp;#160;&lt;a href="http://blogs.msdn.com/blogfiles/permanenttan/WindowsLiveWriter/WPFListViewwithCheckBoxesandNoClipping_E297/image_6.png"&gt;&lt;img title="image" style="border-right: 0px; border-top: 0px; display: inline; border-left: 0px; border-bottom: 0px" height="204" alt="image" src="http://blogs.msdn.com/blogfiles/permanenttan/WindowsLiveWriter/WPFListViewwithCheckBoxesandNoClipping_E297/image_thumb_2.png" width="354" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;    &lt;p style="font-size: 11pt; margin: 0in; font-family: calibri" mce_keep="true"&gt;&amp;#160;&lt;/p&gt;    &lt;p style="margin: 0in"&gt;&lt;a href="http://blogs.msdn.com/blogfiles/permanenttan/WindowsLiveWriter/WPFListViewwithCheckBoxesandNoClipping_E297/image_8.png"&gt;&lt;img title="image" style="border-right: 0px; border-top: 0px; display: inline; border-left: 0px; border-bottom: 0px" height="204" alt="image" src="http://blogs.msdn.com/blogfiles/permanenttan/WindowsLiveWriter/WPFListViewwithCheckBoxesandNoClipping_E297/image_thumb_3.png" width="354" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;    &lt;p style="font-size: 11pt; margin: 0in; font-family: calibri" mce_keep="true"&gt;&amp;#160;&lt;/p&gt;    &lt;p style="font-size: 11pt; margin: 0in; font-family: calibri" mce_keep="true"&gt;&amp;#160;&lt;/p&gt;    &lt;p style="font-size: 18pt; margin: 0in; font-family: calibri"&gt;What We Don't Want&lt;/p&gt;    &lt;p style="margin: 0in"&gt;&amp;#160;&lt;/p&gt;    &lt;p style="font-size: 11pt; margin: 0in; font-family: calibri" mce_keep="true"&gt;&amp;#160;&lt;a href="http://blogs.msdn.com/blogfiles/permanenttan/WindowsLiveWriter/WPFListViewwithCheckBoxesandNoClipping_E297/image_10.png"&gt;&lt;img title="image" style="border-right: 0px; border-top: 0px; display: inline; border-left: 0px; border-bottom: 0px" height="154" alt="image" src="http://blogs.msdn.com/blogfiles/permanenttan/WindowsLiveWriter/WPFListViewwithCheckBoxesandNoClipping_E297/image_thumb_4.png" width="267" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;    &lt;p style="font-size: 11pt; margin: 0in; font-family: calibri" mce_keep="true"&gt;&amp;#160;&lt;/p&gt;    &lt;p style="font-size: 11pt; margin: 0in; font-family: calibri" mce_keep="true"&gt;&amp;#160;&lt;/p&gt;    &lt;p style="font-size: 18pt; margin: 0in; font-family: calibri"&gt;What We Need to Do&lt;/p&gt;    &lt;ul style="margin-top: 0in; margin-bottom: 0in; margin-left: 0.375in; direction: ltr; unicode-bidi: embed" type="circle"&gt;     &lt;li style="margin-top: 0px; margin-bottom: 0px; vertical-align: middle"&gt;&lt;span style="font-size: 14pt; font-family: calibri"&gt;Add the Check Boxes&lt;/span&gt;         &lt;ul style="margin-top: 0in; margin-bottom: 0in; margin-left: 0.375in; direction: ltr; unicode-bidi: embed" type="disc"&gt;         &lt;li style="margin-top: 0px; margin-bottom: 0px; vertical-align: middle"&gt;&lt;span style="font-size: 11pt; font-family: calibri"&gt;To add the check box to each list view item, we must first override the ListView.View to be a GridView and create two GridViewColumns: one for the check box and the other for the item text.&lt;/span&gt; &lt;/li&gt;          &lt;li style="margin-top: 0px; margin-bottom: 0px; vertical-align: middle"&gt;&lt;span style="font-size: 11pt; font-family: calibri"&gt;Here the XAML code for our ListView:&lt;/span&gt;&lt;/li&gt;       &lt;/ul&gt;     &lt;/li&gt;   &lt;/ul&gt;    &lt;p style="font-size: 11pt; margin: 0in 0in 0in 0.75in; font-family: calibri" mce_keep="true"&gt;&amp;#160;&lt;/p&gt;    &lt;p style="font-size: 9pt; margin: 0in 0in 0in 0.75in; font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&amp;lt;ListView Name=&amp;quot;myListView&amp;quot;&amp;gt;&lt;/p&gt;    &lt;p style="font-size: 9pt; margin: 0in 0in 0in 0.75in; font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&amp;lt;ListView.View&amp;gt;&lt;/p&gt;    &lt;p style="font-size: 9pt; margin: 0in 0in 0in 0.75in; font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&amp;lt;GridView&amp;gt;&lt;/p&gt;    &lt;p style="font-size: 9pt; margin: 0in 0in 0in 0.75in; font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&amp;lt;GridView.ColumnHeaderContainerStyle&amp;gt;&lt;/p&gt;    &lt;p style="font-size: 9pt; margin: 0in 0in 0in 0.75in; font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&amp;lt;Style TargetType=&amp;quot;{x:Type GridViewColumnHeader}&amp;quot;&amp;gt;&lt;/p&gt;    &lt;p style="font-size: 9pt; margin: 0in 0in 0in 0.75in; font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&amp;lt;Setter Property=&amp;quot;Visibility&amp;quot;&lt;/p&gt;    &lt;p style="font-size: 9pt; margin: 0in 0in 0in 0.75in; font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;Value=&amp;quot;Collapsed&amp;quot;/&amp;gt;&lt;/p&gt;    &lt;p style="font-size: 9pt; margin: 0in 0in 0in 0.75in; font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&amp;lt;/Style&amp;gt;&lt;/p&gt;    &lt;p style="font-size: 9pt; margin: 0in 0in 0in 0.75in; font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&amp;lt;/GridView.ColumnHeaderContainerStyle&amp;gt;&lt;/p&gt;    &lt;p style="font-size: 9pt; margin: 0in 0in 0in 0.75in; font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;span style="background: yellow; mso-highlight: yellow"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&amp;lt;GridViewColumn&amp;gt;&lt;/span&gt;&lt;/p&gt;    &lt;p style="font-size: 9pt; margin: 0in 0in 0in 0.75in; font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;span style="background: yellow; mso-highlight: yellow"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&amp;lt;GridViewColumn.CellTemplate&amp;gt;&lt;/span&gt;&lt;/p&gt;    &lt;p style="font-size: 9pt; margin: 0in 0in 0in 0.75in; font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;span style="background: yellow; mso-highlight: yellow"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&amp;lt;DataTemplate&amp;gt;&lt;/span&gt;&lt;/p&gt;    &lt;p style="font-size: 9pt; margin: 0in 0in 0in 0.75in; font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;span style="background: yellow; mso-highlight: yellow"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&amp;lt;CheckBox Margin=&amp;quot;0&amp;quot;&lt;/span&gt;&lt;/p&gt;    &lt;p style="font-size: 9pt; margin: 0in 0in 0in 0.75in; font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;span style="background: yellow; mso-highlight: yellow"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;VerticalAlignment=&amp;quot;Center&amp;quot;&lt;/span&gt;&lt;/p&gt;    &lt;p style="font-size: 9pt; margin: 0in 0in 0in 0.75in; font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;span style="background: yellow; mso-highlight: yellow"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;IsChecked=&amp;quot;{Binding IsChecked}&amp;quot;/&amp;gt;&lt;/span&gt;&lt;/p&gt;    &lt;p style="font-size: 9pt; margin: 0in 0in 0in 0.75in; font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;span style="background: yellow; mso-highlight: yellow"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&amp;lt;/DataTemplate&amp;gt;&lt;/span&gt;&lt;/p&gt;    &lt;p style="font-size: 9pt; margin: 0in 0in 0in 0.75in; font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;span style="background: yellow; mso-highlight: yellow"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&amp;lt;/GridViewColumn.CellTemplate&amp;gt;&lt;/span&gt;&lt;/p&gt;    &lt;p style="font-size: 9pt; margin: 0in 0in 0in 0.75in; font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;span style="background: yellow; mso-highlight: yellow"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&amp;lt;/GridViewColumn&amp;gt;&lt;/span&gt;&lt;/p&gt;    &lt;p style="font-size: 9pt; margin: 0in 0in 0in 0.75in; font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;span style="background: lime; mso-highlight: lime"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&amp;lt;GridViewColumn&amp;gt;&lt;/span&gt;&lt;/p&gt;    &lt;p style="font-size: 9pt; margin: 0in 0in 0in 0.75in; font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;span style="background: lime; mso-highlight: lime"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&amp;lt;GridViewColumn.CellTemplate&amp;gt;&lt;/span&gt;&lt;/p&gt;    &lt;p style="font-size: 9pt; margin: 0in 0in 0in 0.75in; font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;span style="background: lime; mso-highlight: lime"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&amp;lt;DataTemplate&amp;gt;&lt;/span&gt;&lt;/p&gt;    &lt;p style="font-size: 9pt; margin: 0in 0in 0in 0.75in; font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;span style="background: lime; mso-highlight: lime"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&amp;lt;TextBlock Margin=&amp;quot;0&amp;quot;&lt;/span&gt;&lt;/p&gt;    &lt;p style="font-size: 9pt; margin: 0in 0in 0in 0.75in; font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;span style="background: lime; mso-highlight: lime"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;Text=&amp;quot;{Binding Text}&amp;quot;&lt;/span&gt;&lt;/p&gt;    &lt;p style="font-size: 9pt; margin: 0in 0in 0in 0.75in; font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;span style="background: lime; mso-highlight: lime"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;/span&gt;&lt;span style="background: fuchsia; mso-highlight: fuchsia"&gt;Loaded=&amp;quot;TextBlock_Loaded&amp;quot;&lt;/span&gt;&lt;span style="background: lime; mso-highlight: lime"&gt;/&amp;gt;&lt;/span&gt;&lt;/p&gt;    &lt;p style="font-size: 9pt; margin: 0in 0in 0in 0.75in; font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;span style="background: lime; mso-highlight: lime"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&amp;lt;/DataTemplate&amp;gt;&lt;/span&gt;&lt;/p&gt;    &lt;p style="font-size: 9pt; margin: 0in 0in 0in 0.75in; font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;span style="background: lime; mso-highlight: lime"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&amp;lt;/GridViewColumn.CellTemplate&amp;gt;&lt;/span&gt;&lt;/p&gt;    &lt;p style="font-size: 9pt; margin: 0in 0in 0in 0.75in; font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;span style="background: lime; mso-highlight: lime"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&amp;lt;/GridViewColumn&amp;gt;&lt;/span&gt;&lt;/p&gt;    &lt;p style="font-size: 9pt; margin: 0in 0in 0in 0.75in; font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&amp;lt;/GridView&amp;gt;&lt;/p&gt;    &lt;p style="font-size: 9pt; margin: 0in 0in 0in 0.75in; font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&amp;lt;/ListView.View&amp;gt;&lt;/p&gt;    &lt;p style="font-size: 9pt; margin: 0in 0in 0in 0.75in; font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&amp;lt;/ListView&amp;gt;&lt;/p&gt;    &lt;p style="font-size: 11pt; margin: 0in 0in 0in 0.75in; font-family: calibri" mce_keep="true"&gt;&amp;#160;&lt;/p&gt;    &lt;ul style="margin-top: 0in; margin-bottom: 0in; margin-left: 0.375in; direction: ltr; unicode-bidi: embed" type="circle"&gt;     &lt;li style="margin-top: 0px; margin-bottom: 0px; vertical-align: middle"&gt;&lt;span style="font-size: 14pt; font-family: calibri"&gt;Hide the Column Headers&lt;/span&gt;         &lt;ul style="margin-top: 0in; margin-bottom: 0in; margin-left: 0.375in; direction: ltr; unicode-bidi: embed" type="disc"&gt;         &lt;li style="margin-top: 0px; margin-bottom: 0px; vertical-align: middle"&gt;&lt;span style="font-size: 11pt; font-family: calibri"&gt;To hide the column headers, we need to collapse the GridViewColumnHeader.&lt;/span&gt;&lt;/li&gt;       &lt;/ul&gt;     &lt;/li&gt;   &lt;/ul&gt;    &lt;p style="font-size: 11pt; margin: 0in 0in 0in 0.75in; font-family: calibri" mce_keep="true"&gt;&amp;#160;&lt;/p&gt;    &lt;p style="font-size: 9pt; margin: 0in 0in 0in 0.75in; font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&amp;lt;ListView Name=&amp;quot;myListView&amp;quot;&amp;gt;&lt;/p&gt;    &lt;p style="font-size: 9pt; margin: 0in 0in 0in 0.75in; font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&amp;lt;ListView.View&amp;gt;&lt;/p&gt;    &lt;p style="font-size: 9pt; margin: 0in 0in 0in 0.75in; font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&amp;lt;GridView&amp;gt;&lt;/p&gt;    &lt;p style="font-size: 9pt; margin: 0in 0in 0in 0.75in; font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;span style="background: lime; mso-highlight: lime"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&amp;lt;GridView.ColumnHeaderContainerStyle&amp;gt;&lt;/span&gt;&lt;/p&gt;    &lt;p style="font-size: 9pt; margin: 0in 0in 0in 0.75in; font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;span style="background: lime; mso-highlight: lime"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&amp;lt;Style TargetType=&amp;quot;{x:Type GridViewColumnHeader}&amp;quot;&amp;gt;&lt;/span&gt;&lt;/p&gt;    &lt;p style="font-size: 9pt; margin: 0in 0in 0in 0.75in; font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;span style="background: lime; mso-highlight: lime"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&amp;lt;Setter Property=&amp;quot;Visibility&amp;quot;&lt;/span&gt;&lt;/p&gt;    &lt;p style="font-size: 9pt; margin: 0in 0in 0in 0.75in; font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;span style="background: lime; mso-highlight: lime"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;Value=&amp;quot;Collapsed&amp;quot;/&amp;gt;&lt;/span&gt;&lt;/p&gt;    &lt;p style="font-size: 9pt; margin: 0in 0in 0in 0.75in; font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;span style="background: lime; mso-highlight: lime"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&amp;lt;/Style&amp;gt;&lt;/span&gt;&lt;/p&gt;    &lt;p style="font-size: 9pt; margin: 0in 0in 0in 0.75in; font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;span style="background: lime; mso-highlight: lime"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&amp;lt;/GridView.ColumnHeaderContainerStyle&amp;gt;&lt;/span&gt;&lt;/p&gt;    &lt;p style="font-size: 9pt; margin: 0in 0in 0in 0.75in; font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&amp;lt;GridViewColumn&amp;gt;&lt;/p&gt;    &lt;p style="font-size: 9pt; margin: 0in 0in 0in 0.75in; font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;...&lt;/p&gt;    &lt;p style="font-size: 9pt; margin: 0in 0in 0in 0.75in; font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&amp;lt;/GridViewColumn&amp;gt;&lt;/p&gt;    &lt;p style="font-size: 9pt; margin: 0in 0in 0in 0.75in; font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&amp;lt;GridViewColumn&amp;gt;&lt;/p&gt;    &lt;p style="font-size: 9pt; margin: 0in 0in 0in 0.75in; font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;...&lt;/p&gt;    &lt;p style="font-size: 9pt; margin: 0in 0in 0in 0.75in; font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&amp;lt;/GridViewColumn&amp;gt;&lt;/p&gt;    &lt;p style="font-size: 9pt; margin: 0in 0in 0in 0.75in; font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&amp;lt;/GridView&amp;gt;&lt;/p&gt;    &lt;p style="font-size: 9pt; margin: 0in 0in 0in 0.75in; font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&amp;lt;/ListView.View&amp;gt;&lt;/p&gt;    &lt;p style="font-size: 9pt; margin: 0in 0in 0in 0.75in; font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&amp;lt;/ListView&amp;gt;&lt;/p&gt;    &lt;p style="font-size: 14pt; margin: 0in 0in 0in 0.375in; font-family: calibri" mce_keep="true"&gt;&amp;#160;&lt;/p&gt;    &lt;ul style="margin-top: 0in; margin-bottom: 0in; margin-left: 0.375in; direction: ltr; unicode-bidi: embed" type="circle"&gt;     &lt;li style="margin-top: 0px; margin-bottom: 0px; vertical-align: middle"&gt;&lt;span style="font-size: 14pt; font-family: calibri"&gt;Resize the Column Header to the Widest Item&lt;/span&gt;         &lt;ul style="margin-top: 0in; margin-bottom: 0in; margin-left: 0.375in; direction: ltr; unicode-bidi: embed" type="disc"&gt;         &lt;li style="margin-top: 0px; margin-bottom: 0px; vertical-align: middle"&gt;&lt;span style="font-size: 11pt; font-family: calibri"&gt;In the code-behind, implement the TextBlock Loaded event handler. In this handler, measure the text and resize the (invisible) header column to the widest rendered item. If the widest item is wider than the available width, the list view automatically shows a horizontal scrollbar&lt;/span&gt; &lt;/li&gt;          &lt;li style="margin-top: 0px; margin-bottom: 0px; vertical-align: middle"&gt;&lt;span style="font-size: 11pt; font-family: calibri"&gt;Since we hook the TextBlock Loaded event, &lt;/span&gt;&lt;span style="font-size: 11pt; font-family: calibri; text-decoration: underline"&gt;only rendered&lt;/span&gt;&lt;span style="font-size: 11pt; font-family: calibri"&gt; ListViewItems will be called. This is an important optimization! So if you a have list of 100,000 items and then you grab the scrollbar thumb and quickly scroll from top to bottom, only a small subset of the items is rendered and consequently measured - Not all 100,000 items! As more items come into view, the header column will be resized to the widest item to appropriately show it.&lt;/span&gt;&lt;/li&gt;       &lt;/ul&gt;     &lt;/li&gt;   &lt;/ul&gt;    &lt;p style="font-size: 11pt; margin: 0in 0in 0in 0.75in; font-family: calibri" mce_keep="true"&gt;&amp;#160;&lt;/p&gt;    &lt;p style="font-size: 9pt; margin: 0in 0in 0in 0.75in; font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;private void TextBlock_Loaded(object sender, RoutedEventArgs e)&lt;/p&gt;    &lt;p style="font-size: 9pt; margin: 0in 0in 0in 0.75in; font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;{&lt;/p&gt;    &lt;p style="font-size: 9pt; margin: 0in 0in 0in 0.75in; font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;GridView gridView = myListView.View as GridView;&lt;/p&gt;    &lt;p style="font-size: 9pt; margin: 0in 0in 0in 0.75in; font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;if (gridView != null &amp;amp;&amp;amp; gridView.Columns.Count &amp;gt;= 2)&lt;/p&gt;    &lt;p style="font-size: 9pt; margin: 0in 0in 0in 0.75in; font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;{&lt;/p&gt;    &lt;p style="font-size: 9pt; margin: 0in 0in 0in 0.75in; font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;span style="background: yellow; mso-highlight: yellow"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;// Calculate the item's desired text width and increase the&lt;/span&gt;&lt;/p&gt;    &lt;p style="font-size: 9pt; margin: 0in 0in 0in 0.75in; font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;span style="background: yellow; mso-highlight: yellow"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;// text column's width to match the widest text&lt;/span&gt;&lt;/p&gt;    &lt;p style="font-size: 9pt; margin: 0in 0in 0in 0.75in; font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;span style="background: yellow; mso-highlight: yellow"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;TextBlock tb = (TextBlock)sender;&lt;/span&gt;&lt;/p&gt;    &lt;p style="font-size: 9pt; margin: 0in 0in 0in 0.75in; font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;span style="background: yellow; mso-highlight: yellow"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;tb.Measure(new Size(Double.MaxValue, Double.MaxValue));&lt;/span&gt;&lt;/p&gt;    &lt;p style="font-size: 9pt; margin: 0in 0in 0in 0.75in; font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;span style="background: yellow; mso-highlight: yellow"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;double newWidth = tb.DesiredSize.Width;&lt;/span&gt;&lt;/p&gt;    &lt;p style="font-size: 9pt; margin: 0in 0in 0in 0.75in; font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;span style="background: yellow; mso-highlight: yellow"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;GridViewColumnCollection columns = gridView.Columns;&lt;/span&gt;&lt;/p&gt;    &lt;p style="font-size: 9pt; margin: 0in 0in 0in 0.75in; font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;span style="background: yellow; mso-highlight: yellow"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;if (newWidth &amp;gt; columns[1].Width ||&lt;/span&gt;&lt;/p&gt;    &lt;p style="font-size: 9pt; margin: 0in 0in 0in 0.75in; font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;span style="background: yellow; mso-highlight: yellow"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;double.IsNaN(columns[1].Width))&lt;/span&gt;&lt;/p&gt;    &lt;p style="font-size: 9pt; margin: 0in 0in 0in 0.75in; font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;span style="background: yellow; mso-highlight: yellow"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;{&lt;/span&gt;&lt;/p&gt;    &lt;p style="font-size: 9pt; margin: 0in 0in 0in 0.75in; font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;span style="background: yellow; mso-highlight: yellow"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;columns[1].Width = newWidth;&lt;/span&gt;&lt;/p&gt;    &lt;p style="font-size: 9pt; margin: 0in 0in 0in 0.75in; font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;span style="background: yellow; mso-highlight: yellow"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;}&lt;/span&gt;&lt;/p&gt;    &lt;p style="font-size: 9pt; margin: 0in 0in 0in 0.75in; font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;}&lt;/p&gt;    &lt;p style="font-size: 9pt; margin: 0in 0in 0in 0.75in; font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;}&lt;/p&gt;    &lt;p style="font-size: 11pt; margin: 0in 0in 0in 0.75in; font-family: calibri" mce_keep="true"&gt;&amp;#160;&lt;/p&gt;    &lt;ul style="margin-top: 0in; margin-bottom: 0in; margin-left: 0.375in; direction: ltr; unicode-bidi: embed" type="circle"&gt;     &lt;li style="margin-top: 0px; margin-bottom: 0px; vertical-align: middle"&gt;&lt;span style="font-size: 14pt; font-family: calibri"&gt;Remove the Item Cell Padding for Good Looks&lt;/span&gt;         &lt;ul style="margin-top: 0in; margin-bottom: 0in; margin-left: 0.375in; direction: ltr; unicode-bidi: embed" type="disc"&gt;         &lt;li style="margin-top: 0px; margin-bottom: 0px; vertical-align: middle"&gt;&lt;span style="font-size: 11pt; font-family: calibri"&gt;The cell content presenter has a default margin of about 6 units. Removing this margin makes the gap between the check box and the text look &amp;quot;perfect&amp;quot; on Vista.&lt;/span&gt;&lt;/li&gt;       &lt;/ul&gt;     &lt;/li&gt;   &lt;/ul&gt;    &lt;p style="font-size: 11pt; margin: 0in 0in 0in 0.75in; font-family: calibri" mce_keep="true"&gt;&amp;#160;&lt;/p&gt;    &lt;p style="font-size: 9pt; margin: 0in 0in 0in 0.75in; font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;private void TextBlock_Loaded(object sender, RoutedEventArgs e)&lt;/p&gt;    &lt;p style="font-size: 9pt; margin: 0in 0in 0in 0.75in; font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;{&lt;/p&gt;    &lt;p style="font-size: 9pt; margin: 0in 0in 0in 0.75in; font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;GridView gridView = myListView.View as GridView;&lt;/p&gt;    &lt;p style="font-size: 9pt; margin: 0in 0in 0in 0.75in; font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;if (gridView != null &amp;amp;&amp;amp; gridView.Columns.Count &amp;gt;= 2)&lt;/p&gt;    &lt;p style="font-size: 9pt; margin: 0in 0in 0in 0.75in; font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;{&lt;/p&gt;    &lt;p style="font-size: 9pt; margin: 0in 0in 0in 0.75in; font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;...&lt;/p&gt;    &lt;p style="font-size: 9pt; margin: 0in 0in 0in 0.75in; font-family: &amp;#39;Courier New&amp;#39;" mce_keep="true"&gt;&amp;#160;&lt;/p&gt;    &lt;p style="font-size: 9pt; margin: 0in 0in 0in 0.75in; font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;span style="background: yellow; mso-highlight: yellow"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;// Remove the text block cell's content presenter built-in&lt;/span&gt;&lt;/p&gt;    &lt;p style="font-size: 9pt; margin: 0in 0in 0in 0.75in; font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;span style="background: yellow; mso-highlight: yellow"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;// margin for better-looking spacing&lt;/span&gt;&lt;/p&gt;    &lt;p style="font-size: 9pt; margin: 0in 0in 0in 0.75in; font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;span style="background: yellow; mso-highlight: yellow"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;ContentPresenter contentPresenter = VisualTreeHelper.GetParent(tb) as ContentPresenter;&lt;/span&gt;&lt;/p&gt;    &lt;p style="font-size: 9pt; margin: 0in 0in 0in 0.75in; font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;span style="background: yellow; mso-highlight: yellow"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;if (contentPresenter != null)&lt;/span&gt;&lt;/p&gt;    &lt;p style="font-size: 9pt; margin: 0in 0in 0in 0.75in; font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;span style="background: yellow; mso-highlight: yellow"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;{&lt;/span&gt;&lt;/p&gt;    &lt;p style="font-size: 9pt; margin: 0in 0in 0in 0.75in; font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;span style="background: yellow; mso-highlight: yellow"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;contentPresenter.Margin = new Thickness(0);&lt;/span&gt;&lt;/p&gt;    &lt;p style="font-size: 9pt; margin: 0in 0in 0in 0.75in; font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;span style="background: yellow; mso-highlight: yellow"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;}&lt;/span&gt;&lt;/p&gt;    &lt;p style="font-size: 9pt; margin: 0in 0in 0in 0.75in; font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;}&lt;/p&gt;    &lt;p style="font-size: 9pt; margin: 0in 0in 0in 0.75in; font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;}&lt;/p&gt;    &lt;p style="font-size: 11pt; margin: 0in; font-family: calibri" mce_keep="true"&gt;&amp;#160;&lt;/p&gt;    &lt;p style="font-size: 18pt; margin: 0in; font-family: calibri"&gt;Hey, What About Data-Binding?&lt;/p&gt;    &lt;p style="font-size: 11pt; margin: 0in; font-family: calibri"&gt;Even though there are a lot of resources on this topic, here is one way that you can encapsulate an item data source and bind the sources to the List View.&lt;/p&gt;    &lt;p style="font-size: 11pt; margin: 0in; font-family: calibri" mce_keep="true"&gt;&amp;#160;&lt;/p&gt;    &lt;p style="font-size: 14pt; margin: 0in; font-family: calibri"&gt;First define a class to hold the data for each list view item:&lt;/p&gt;    &lt;p style="font-size: 11pt; margin: 0in; font-family: calibri" mce_keep="true"&gt;&amp;#160;&lt;/p&gt;    &lt;p style="font-size: 9pt; margin: 0in 0in 0in 0.375in; font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;/// &amp;lt;summary&amp;gt;&lt;/p&gt;    &lt;p style="font-size: 9pt; margin: 0in 0in 0in 0.375in; font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;/// Encapsulate item data source for a CheckBoxListView item&lt;/p&gt;    &lt;p style="font-size: 9pt; margin: 0in 0in 0in 0.375in; font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;/// &amp;lt;/summary&amp;gt;&lt;/p&gt;    &lt;p style="font-size: 9pt; margin: 0in 0in 0in 0.375in; font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;public class &lt;span style="background: lime; mso-highlight: lime"&gt;CheckBoxListViewItemSource&lt;/span&gt; : INotifyPropertyChanged&lt;/p&gt;    &lt;p style="font-size: 9pt; margin: 0in 0in 0in 0.375in; font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;{&lt;/p&gt;    &lt;p style="font-size: 9pt; margin: 0in 0in 0in 0.375in; font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;public CheckBoxListViewItemSource(String text)&lt;/p&gt;    &lt;p style="font-size: 9pt; margin: 0in 0in 0in 0.375in; font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;{&lt;/p&gt;    &lt;p style="font-size: 9pt; margin: 0in 0in 0in 0.375in; font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;m_text = text;&lt;/p&gt;    &lt;p style="font-size: 9pt; margin: 0in 0in 0in 0.375in; font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;}&lt;/p&gt;    &lt;p style="font-size: 9pt; margin: 0in 0in 0in 0.375in; font-family: &amp;#39;Courier New&amp;#39;" mce_keep="true"&gt;&amp;#160;&lt;/p&gt;    &lt;p style="font-size: 9pt; margin: 0in 0in 0in 0.375in; font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;public bool IsChecked&lt;/p&gt;    &lt;p style="font-size: 9pt; margin: 0in 0in 0in 0.375in; font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;{&lt;/p&gt;    &lt;p style="font-size: 9pt; margin: 0in 0in 0in 0.375in; font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;get { return m_checked; }&lt;/p&gt;    &lt;p style="font-size: 9pt; margin: 0in 0in 0in 0.375in; font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;set&lt;/p&gt;    &lt;p style="font-size: 9pt; margin: 0in 0in 0in 0.375in; font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;{&lt;/p&gt;    &lt;p style="font-size: 9pt; margin: 0in 0in 0in 0.375in; font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;if (m_checked == value) return;&lt;/p&gt;    &lt;p style="font-size: 9pt; margin: 0in 0in 0in 0.375in; font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;m_checked = value;&lt;/p&gt;    &lt;p style="font-size: 9pt; margin: 0in 0in 0in 0.375in; font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;RaisePropertyChanged(&amp;quot;Checked&amp;quot;);&lt;/p&gt;    &lt;p style="font-size: 9pt; margin: 0in 0in 0in 0.375in; font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;}&lt;/p&gt;    &lt;p style="font-size: 9pt; margin: 0in 0in 0in 0.375in; font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;}&lt;/p&gt;    &lt;p style="font-size: 9pt; margin: 0in 0in 0in 0.375in; font-family: &amp;#39;Courier New&amp;#39;" mce_keep="true"&gt;&amp;#160;&lt;/p&gt;    &lt;p style="font-size: 9pt; margin: 0in 0in 0in 0.375in; font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;public String Text&lt;/p&gt;    &lt;p style="font-size: 9pt; margin: 0in 0in 0in 0.375in; font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;{&lt;/p&gt;    &lt;p style="font-size: 9pt; margin: 0in 0in 0in 0.375in; font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;get { return m_text; }&lt;/p&gt;    &lt;p style="font-size: 9pt; margin: 0in 0in 0in 0.375in; font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;set&lt;/p&gt;    &lt;p style="font-size: 9pt; margin: 0in 0in 0in 0.375in; font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;{&lt;/p&gt;    &lt;p style="font-size: 9pt; margin: 0in 0in 0in 0.375in; font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;if (m_text == value) return;&lt;/p&gt;    &lt;p style="font-size: 9pt; margin: 0in 0in 0in 0.375in; font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;m_text = value;&lt;/p&gt;    &lt;p style="font-size: 9pt; margin: 0in 0in 0in 0.375in; font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;RaisePropertyChanged(&amp;quot;Text&amp;quot;);&lt;/p&gt;    &lt;p style="font-size: 9pt; margin: 0in 0in 0in 0.375in; font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;}&lt;/p&gt;    &lt;p style="font-size: 9pt; margin: 0in 0in 0in 0.375in; font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;}&lt;/p&gt;    &lt;p style="font-size: 9pt; margin: 0in 0in 0in 0.375in; font-family: &amp;#39;Courier New&amp;#39;" mce_keep="true"&gt;&amp;#160;&lt;/p&gt;    &lt;p style="font-size: 9pt; margin: 0in 0in 0in 0.375in; font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;public override string ToString()&lt;/p&gt;    &lt;p style="font-size: 9pt; margin: 0in 0in 0in 0.375in; font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;{&lt;/p&gt;    &lt;p style="font-size: 9pt; margin: 0in 0in 0in 0.375in; font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;return Text;&lt;/p&gt;    &lt;p style="font-size: 9pt; margin: 0in 0in 0in 0.375in; font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;}&lt;/p&gt;    &lt;p style="font-size: 9pt; margin: 0in 0in 0in 0.375in; font-family: &amp;#39;Courier New&amp;#39;" mce_keep="true"&gt;&amp;#160;&lt;/p&gt;    &lt;p style="font-size: 9pt; margin: 0in 0in 0in 0.375in; font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;public event PropertyChangedEventHandler PropertyChanged;&lt;/p&gt;    &lt;p style="font-size: 9pt; margin: 0in 0in 0in 0.375in; font-family: &amp;#39;Courier New&amp;#39;" mce_keep="true"&gt;&amp;#160;&lt;/p&gt;    &lt;p style="font-size: 9pt; margin: 0in 0in 0in 0.375in; font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;private void RaisePropertyChanged(string propName)&lt;/p&gt;    &lt;p style="font-size: 9pt; margin: 0in 0in 0in 0.375in; font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;{&lt;/p&gt;    &lt;p style="font-size: 9pt; margin: 0in 0in 0in 0.375in; font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;PropertyChangedEventHandler eh = PropertyChanged;&lt;/p&gt;    &lt;p style="font-size: 9pt; margin: 0in 0in 0in 0.375in; font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;if (eh != null)&lt;/p&gt;    &lt;p style="font-size: 9pt; margin: 0in 0in 0in 0.375in; font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;{&lt;/p&gt;    &lt;p style="font-size: 9pt; margin: 0in 0in 0in 0.375in; font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;eh(this, new PropertyChangedEventArgs(propName));&lt;/p&gt;    &lt;p style="font-size: 9pt; margin: 0in 0in 0in 0.375in; font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;}&lt;/p&gt;    &lt;p style="font-size: 9pt; margin: 0in 0in 0in 0.375in; font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;}&lt;/p&gt;    &lt;p style="font-size: 9pt; margin: 0in 0in 0in 0.375in; font-family: &amp;#39;Courier New&amp;#39;" mce_keep="true"&gt;&amp;#160;&lt;/p&gt;    &lt;p style="font-size: 9pt; margin: 0in 0in 0in 0.375in; font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;private bool m_checked;&lt;/p&gt;    &lt;p style="font-size: 9pt; margin: 0in 0in 0in 0.375in; font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;private String m_text;&lt;/p&gt;    &lt;p style="font-size: 9pt; margin: 0in 0in 0in 0.375in; font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;}&lt;/p&gt;    &lt;p style="font-size: 11pt; margin: 0in 0in 0in 0.375in; font-family: calibri" mce_keep="true"&gt;&amp;#160;&lt;/p&gt;    &lt;p style="font-size: 14pt; margin: 0in; font-family: calibri"&gt;Then create a list to hold those item data sources:&lt;/p&gt;    &lt;p style="font-size: 11pt; margin: 0in; font-family: calibri"&gt;In the following sample, I created this list in the constructor of the application window.&lt;/p&gt;    &lt;p style="font-size: 11pt; margin: 0in; font-family: calibri" mce_keep="true"&gt;&amp;#160;&lt;/p&gt;    &lt;p style="font-size: 9pt; margin: 0in 0in 0in 0.375in; font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;public Window1()&lt;/p&gt;    &lt;p style="font-size: 9pt; margin: 0in 0in 0in 0.375in; font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;{&lt;/p&gt;    &lt;p style="font-size: 9pt; margin: 0in 0in 0in 0.375in; font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;InitializeComponent();&lt;/p&gt;    &lt;p style="font-size: 9pt; margin: 0in 0in 0in 0.375in; font-family: &amp;#39;Courier New&amp;#39;" mce_keep="true"&gt;&amp;#160;&lt;/p&gt;    &lt;p style="font-size: 9pt; margin: 0in 0in 0in 0.375in; font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;// Fill the list via data-bound item sources&lt;/p&gt;    &lt;p style="font-size: 9pt; margin: 0in 0in 0in 0.375in; font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;span style="background: yellow; mso-highlight: yellow"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;ObservableCollection&amp;lt;&lt;/span&gt;&lt;span style="background: lime; mso-highlight: lime"&gt;CheckBoxListViewItemSource&lt;/span&gt;&lt;span style="background: yellow; mso-highlight: yellow"&gt;&amp;gt; itemSources = new ObservableCollection&amp;lt;&lt;/span&gt;&lt;span style="background: lime; mso-highlight: lime"&gt;CheckBoxListViewItemSource&lt;/span&gt;&lt;span style="background: yellow; mso-highlight: yellow"&gt;&amp;gt;();&lt;/span&gt;&lt;/p&gt;    &lt;p style="font-size: 9pt; margin: 0in 0in 0in 0.375in; font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;myListView.ItemsSource = itemSources;&lt;/p&gt;    &lt;p style="font-size: 9pt; margin: 0in 0in 0in 0.375in; font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;int ii = 1;&lt;/p&gt;    &lt;p style="font-size: 9pt; margin: 0in 0in 0in 0.375in; font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;for (int i = 0; i &amp;lt; 10; i++)&lt;/p&gt;    &lt;p style="font-size: 9pt; margin: 0in 0in 0in 0.375in; font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;{&lt;/p&gt;    &lt;p style="font-size: 9pt; margin: 0in 0in 0in 0.375in; font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;itemSources.Add(new CheckBoxListViewItemSource(String.Format(&amp;quot;Short Item {0}&amp;quot;, ii++)));&lt;/p&gt;    &lt;p style="font-size: 9pt; margin: 0in 0in 0in 0.375in; font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;}&lt;/p&gt;    &lt;p style="font-size: 9pt; margin: 0in 0in 0in 0.375in; font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;for (int i = 0; i &amp;lt; 5; i++)&lt;/p&gt;    &lt;p style="font-size: 9pt; margin: 0in 0in 0in 0.375in; font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;{&lt;/p&gt;    &lt;p style="font-size: 9pt; margin: 0in 0in 0in 0.375in; font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;itemSources.Add(new CheckBoxListViewItemSource(String.Format(&amp;quot;Long Item {0} with long long long long long long long long long text&amp;quot;, ii++)));&lt;/p&gt;    &lt;p style="font-size: 9pt; margin: 0in 0in 0in 0.375in; font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;}&lt;/p&gt;    &lt;p style="font-size: 9pt; margin: 0in 0in 0in 0.375in; font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;}&lt;/p&gt;    &lt;p style="font-size: 11pt; margin: 0in 0in 0in 0.375in; font-family: calibri" mce_keep="true"&gt;&amp;#160;&lt;/p&gt;    &lt;p style="font-size: 14pt; margin: 0in; font-family: calibri"&gt;Then bind that list to the List View:&lt;/p&gt;    &lt;p style="font-size: 11pt; margin: 0in; font-family: calibri" mce_keep="true"&gt;&amp;#160;&lt;/p&gt;    &lt;p style="font-size: 9pt; margin: 0in 0in 0in 0.75in; font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;public Window1()&lt;/p&gt;    &lt;p style="font-size: 9pt; margin: 0in 0in 0in 0.75in; font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;{&lt;/p&gt;    &lt;p style="font-size: 9pt; margin: 0in 0in 0in 0.75in; font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;InitializeComponent();&lt;/p&gt;    &lt;p style="font-size: 9pt; margin: 0in 0in 0in 0.75in; font-family: &amp;#39;Courier New&amp;#39;" mce_keep="true"&gt;&amp;#160;&lt;/p&gt;    &lt;p style="font-size: 9pt; margin: 0in 0in 0in 0.75in; font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;// Fill the list via data-bound item sources&lt;/p&gt;    &lt;p style="font-size: 9pt; margin: 0in 0in 0in 0.75in; font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;ObservableCollection&amp;lt;CheckBoxListViewItemSource&amp;gt; itemSources = new ObservableCollection&amp;lt;CheckBoxListViewItemSource&amp;gt;();&lt;/p&gt;    &lt;p style="font-size: 9pt; margin: 0in 0in 0in 0.75in; font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;span style="background: yellow; mso-highlight: yellow"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;myListView.ItemsSource = itemSources;&lt;/span&gt;&lt;/p&gt;    &lt;p style="font-size: 9pt; margin: 0in 0in 0in 0.75in; font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;int ii = 1;&lt;/p&gt;    &lt;p style="font-size: 9pt; margin: 0in 0in 0in 0.75in; font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;for (int i = 0; i &amp;lt; 10; i++)&lt;/p&gt;    &lt;p style="font-size: 9pt; margin: 0in 0in 0in 0.75in; font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;{&lt;/p&gt;    &lt;p style="font-size: 9pt; margin: 0in 0in 0in 0.75in; font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;itemSources.Add(new CheckBoxListViewItemSource(String.Format(&amp;quot;Short Item {0}&amp;quot;, ii++)));&lt;/p&gt;    &lt;p style="font-size: 9pt; margin: 0in 0in 0in 0.75in; font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;}&lt;/p&gt;    &lt;p style="font-size: 9pt; margin: 0in 0in 0in 0.75in; font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;for (int i = 0; i &amp;lt; 5; i++)&lt;/p&gt;    &lt;p style="font-size: 9pt; margin: 0in 0in 0in 0.75in; font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;{&lt;/p&gt;    &lt;p style="font-size: 9pt; margin: 0in 0in 0in 0.75in; font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;itemSources.Add(new CheckBoxListViewItemSource(String.Format(&amp;quot;Long Item {0} with long long long long long long long long long text&amp;quot;, ii++)));&lt;/p&gt;    &lt;p style="font-size: 9pt; margin: 0in 0in 0in 0.75in; font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;}&lt;/p&gt;    &lt;p style="font-size: 9pt; margin: 0in 0in 0in 0.75in; font-family: &amp;#39;Courier New&amp;#39;"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;}&lt;/p&gt;    &lt;p style="font-size: 11pt; margin: 0in 0in 0in 0.75in; font-family: calibri" mce_keep="true"&gt;&amp;#160;&lt;/p&gt;    &lt;p style="font-size: 11pt; margin: 0in; font-family: calibri" mce_keep="true"&gt;&amp;#160;&lt;/p&gt;    &lt;p style="font-size: 11pt; margin: 0in; font-family: calibri" mce_keep="true"&gt;&amp;#160;&lt;/p&gt;    &lt;p style="font-size: 11pt; margin: 0in; font-family: calibri" mce_keep="true"&gt;&amp;#160;&lt;/p&gt;    &lt;p style="font-size: 11pt; margin: 0in; font-family: calibri"&gt;That's it for now. Next time, we'll look at a way to set focus to a list view item.&lt;/p&gt;    &lt;p style="font-size: 11pt; margin: 0in; font-family: calibri" mce_keep="true"&gt;&amp;#160;&lt;/p&gt;    &lt;p style="font-size: 11pt; margin: 0in; font-family: calibri"&gt;-Tan&lt;/p&gt;    &lt;p style="font-size: 11pt; margin: 0in; font-family: calibri" mce_keep="true"&gt;&amp;#160;&lt;/p&gt; &lt;/ul&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9340683" width="1" height="1"&gt;</description></item><item><title>Giving full trust (revised)</title><link>http://blogs.msdn.com/permanenttan/archive/2008/11/12/giving-full-trust-revised.aspx</link><pubDate>Wed, 12 Nov 2008 23:16:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9064203</guid><dc:creator>PermanentTan</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/permanenttan/comments/9064203.aspx</comments><wfw:commentRss>http://blogs.msdn.com/permanenttan/commentrss.aspx?PostID=9064203</wfw:commentRss><description>&lt;P&gt;Newer version of caspol.exe expects a more precise URL specification. Here is the revised caspol.exe command&amp;nbsp;to give full trust to a network share //MyDevBox/MyTools:&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;caspol.exe&amp;nbsp; -m&amp;nbsp; -ag 1.2&amp;nbsp; -url &lt;/EM&gt;&lt;EM&gt;&lt;FONT color=#006666&gt;&lt;A href="file://mydevbox/MyTools/"&gt;file://\\MyDevBox\MyTools&lt;/FONT&gt;&lt;/EM&gt;&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;Note the adding of&amp;nbsp;"\\" and the switching of the "/" to "\" in the URL.&lt;/P&gt;
&lt;P&gt;-Tan&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9064203" width="1" height="1"&gt;</description></item><item><title>Giving full trust to a network share</title><link>http://blogs.msdn.com/permanenttan/archive/2008/06/05/giving-full-trust-to-a-network-share.aspx</link><pubDate>Thu, 05 Jun 2008 15:38:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8575201</guid><dc:creator>PermanentTan</dc:creator><slash:comments>2</slash:comments><comments>http://blogs.msdn.com/permanenttan/comments/8575201.aspx</comments><wfw:commentRss>http://blogs.msdn.com/permanenttan/commentrss.aspx?PostID=8575201</wfw:commentRss><description>&lt;P&gt;I work on multiple machines and, very often, I need access to my tool sets on each machine that I work on. This is accomplished by sharing out my tools folder/drive and restrict full permissions to myself. There is a little wrinkle. Network shares by default only get LocalIntranet permissions and that may not be sufficient for some exes and managed assemblies. Fortunately there is the tool "caspol.exe" (normally located in the installed .NET framework folder, \Windows\Microsoft.NET\Framework\vN.N.NNNNN\CasPol.exe). caspol.exe can tell the client computer to give full trust to a network share which in turn enables the execution of exes and loading of assemblies directly&amp;nbsp;from the network share.&lt;/P&gt;
&lt;P&gt;Here is how I give full trust to a network share //MyDevBox/MyTools:&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;caspol.exe&amp;nbsp; -m&amp;nbsp; -ag 1.2&amp;nbsp; -url &lt;/EM&gt;&lt;A href="file://mydevbox/MyTools/"&gt;&lt;EM&gt;file://MyDevBox/MyTools/&lt;/EM&gt;&lt;/A&gt;&lt;EM&gt;*&amp;nbsp; FullTrust&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;Giving full trust is also&amp;nbsp;needed if you share development of Visual Studio&amp;nbsp;projects/solutions&amp;nbsp;across different machines. For example, I would develop code on my dev box and run test on multiple VPCs with the sources/binaries shared with full trust.&lt;/P&gt;
&lt;P&gt;Hope this helps.&lt;/P&gt;
&lt;P&gt;-Tan&lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=8575201" width="1" height="1"&gt;</description></item><item><title>Determine the last synced version for a folder in TFS</title><link>http://blogs.msdn.com/permanenttan/archive/2008/06/05/determine-the-last-synced-version-for-a-folder-in-tfs.aspx</link><pubDate>Thu, 05 Jun 2008 15:24:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8575152</guid><dc:creator>PermanentTan</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/permanenttan/comments/8575152.aspx</comments><wfw:commentRss>http://blogs.msdn.com/permanenttan/commentrss.aspx?PostID=8575152</wfw:commentRss><description>&lt;P&gt;Have you ever need to find the last synced version of a folder in TFS? Here is a quick way:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Change directory to YourFolder&lt;/LI&gt;
&lt;LI&gt;&lt;EM&gt;tf&amp;nbsp; history&amp;nbsp; .&amp;nbsp; /r&amp;nbsp; /version:W&amp;nbsp; /stopafter:1&amp;nbsp; /i&lt;/EM&gt;&lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;Note the "." (current directory).&lt;/P&gt;
&lt;P&gt;This command recursively lists the history for the YourFolder but stops after the first output entry which is the latest synced version. The /version:W scopes the command to just looking at &lt;U&gt;your local&lt;/U&gt; workspace version and not the latest on the server.&lt;/P&gt;
&lt;P&gt;Hope this helps.&lt;/P&gt;
&lt;P&gt;-Tan&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=8575152" width="1" height="1"&gt;</description></item><item><title>Diagnosing side-by-side problems on Vista</title><link>http://blogs.msdn.com/permanenttan/archive/2008/06/05/diagnosing-side-by-side-problems-on-vista.aspx</link><pubDate>Thu, 05 Jun 2008 15:02:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8575105</guid><dc:creator>PermanentTan</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/permanenttan/comments/8575105.aspx</comments><wfw:commentRss>http://blogs.msdn.com/permanenttan/commentrss.aspx?PostID=8575105</wfw:commentRss><description>&lt;P&gt;There have been times where a program&amp;nbsp;failed to load due to missing dependencies or side-by-side inconsistencies. One of the tool available on Windows Vista is "sxstrace.exe" (normally located in \Windows\System32). sxstrace.exe can help you pin-point which dependent assembly is&amp;nbsp;expected and is not found. Use sxstrace.exe /? to get the full options.&lt;/P&gt;
&lt;P&gt;Example usage:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Before running the program that failed to start, in a CMD window, run sxstrace in trace mode&lt;/LI&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;EM&gt;sxstrace.exe&amp;nbsp; Trace&amp;nbsp; -logfile:C:\tmp\MySxSTrace.log&lt;/EM&gt;&lt;/LI&gt;&lt;/UL&gt;
&lt;LI&gt;In another CMD window, run the program that failed to start. Wait until it errors out.&lt;/LI&gt;
&lt;LI&gt;Back on the first CMD window, stop the trace and convert the log&lt;/LI&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;EM&gt;sxstrace.exe&amp;nbsp; Parse&amp;nbsp; -logfile:C:\tmp\MySxSTrace.log&amp;nbsp; -outfile:C:\tmp\MySxSTrace.txt&lt;/EM&gt;&lt;/LI&gt;&lt;/UL&gt;
&lt;LI&gt;You can then look at the parsed log in MySxSTrace.txt. It will be quite obvious which assembly the failed program was looking for and the various locations that were tried.&lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;If you are not on Windows Vista, filemon or procmon can be used to help track down the offending assembly.&lt;/P&gt;
&lt;P&gt;Hope that helps.&lt;/P&gt;
&lt;P&gt;-Tan&lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=8575105" width="1" height="1"&gt;</description></item><item><title>How to share VS Macro Projects</title><link>http://blogs.msdn.com/permanenttan/archive/2008/04/03/how-to-share-vs-macro-projects.aspx</link><pubDate>Thu, 03 Apr 2008 16:05:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8353735</guid><dc:creator>PermanentTan</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/permanenttan/comments/8353735.aspx</comments><wfw:commentRss>http://blogs.msdn.com/permanenttan/commentrss.aspx?PostID=8353735</wfw:commentRss><description>&lt;P&gt;One way to share VS Macro projects is to add the projects to source control and have all users mapped the versioned&amp;nbsp;macro projects&amp;nbsp;to&amp;nbsp;a local folder to be used by VS. Here is a rough outline (an except from&amp;nbsp;one of my forum post)&amp;nbsp;on how you can accomplish this goal.&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;FONT face=Arial size=2&gt;You can do this using a combination of&amp;nbsp;mapping the Macro project local folder to source control&amp;nbsp;and using the Source Control Explorer (or command line tf.exe)&amp;nbsp;for version control operations.&lt;/FONT&gt;&lt;/P&gt;
&lt;P align=left&gt;When you create the macro project, specify a local folder like C:\Source\MacroProjects\MacroProjects1. Then use File &amp;gt; Source Control &amp;gt; Workspaces to map the macro projects folder C:\Source\MacroProjects to somewhere on the server like $/TeamProject/MacroProjects. You can then use the Source Control Explorer (or the command line tf.exe)&amp;nbsp;to add and&amp;nbsp;subsequently check-in&amp;nbsp;the entire MacroProjects folder to source control.&lt;/P&gt;
&lt;P align=left&gt;Note: Since the IDE&amp;nbsp;may/can hold onto the handle of&amp;nbsp;a loaded&amp;nbsp;macro project file (.vsmacros), you may want to unload the macro project before doing version control operations (like check-ins) or you may get an error about "another process&amp;nbsp;accessing the file".&lt;/P&gt;
&lt;P align=left&gt;From this point, the macro projects are on the server and can be shared by other users. Using the Source Control Explorer (or the command line tf.exe), other users just need to add a mapping to their workspace and then do a&amp;nbsp;Get to download&amp;nbsp;the macro projects&amp;nbsp;to their local folder.&lt;/P&gt;
&lt;P align=left&gt;That's it!&lt;/P&gt;
&lt;P align=left&gt;-Tan&lt;/P&gt;&lt;/SPAN&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=8353735" width="1" height="1"&gt;</description></item><item><title>Sorting the work items in the Pending Changes window</title><link>http://blogs.msdn.com/permanenttan/archive/2008/02/11/sorting-the-work-items-in-the-pending-changes-window.aspx</link><pubDate>Mon, 11 Feb 2008 16:25:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:7610709</guid><dc:creator>PermanentTan</dc:creator><slash:comments>2</slash:comments><comments>http://blogs.msdn.com/permanenttan/comments/7610709.aspx</comments><wfw:commentRss>http://blogs.msdn.com/permanenttan/commentrss.aspx?PostID=7610709</wfw:commentRss><description>&lt;P&gt;The work item channels displays the work items in the order specified by the&amp;nbsp;selected query.&amp;nbsp;This means that you can control the sort order by modifying the query's sort preferences. You can do this&amp;nbsp;from Team Explorer, expand Work Items to your query, activate context menu and select View Query, and then click the Column Options button on the toolbar. From that dialog, you can&amp;nbsp;define the sorting order.&lt;/P&gt;
&lt;P&gt;The fields however cannot be changed in the Pending Changes window. Why? We had a&amp;nbsp;usability study back in pre-V1 and the results were to keep the channel simple.&lt;/P&gt;
&lt;P&gt;-Tan&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=7610709" width="1" height="1"&gt;</description></item><item><title>WPF Equivalent for WinForms Ampersand (&amp;) to Prefix Access/Accelerator Character</title><link>http://blogs.msdn.com/permanenttan/archive/2008/01/22/wpf-equivalent-for-winforms-ampersand-to-prefix-access-accelerator-character.aspx</link><pubDate>Tue, 22 Jan 2008 20:16:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:7199930</guid><dc:creator>PermanentTan</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/permanenttan/comments/7199930.aspx</comments><wfw:commentRss>http://blogs.msdn.com/permanenttan/commentrss.aspx?PostID=7199930</wfw:commentRss><description>&lt;P&gt;WPF uses an underscore character instead of&amp;nbsp;the ampersand character&amp;nbsp;(like with WinForms) to&amp;nbsp;prefix an access (a.k.a. accelerator or mnemonic)&amp;nbsp;key in the text of its elements like Label and Button.&lt;/P&gt;
&lt;P&gt;You can escape the underscore by using two underscores.&lt;/P&gt;
&lt;P&gt;The underscore replaces&amp;nbsp;the ampersand because, in XAML,&amp;nbsp;ampersands can&amp;nbsp;easily lead to mistakes and cause&amp;nbsp;problems.&lt;/P&gt;
&lt;P&gt;-Tan&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=7199930" width="1" height="1"&gt;</description></item></channel></rss>