<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>&#60; web:Blog x:Name=&#34;Brian Lagunas&#34; &#47;&#62; &#187; WPF</title>
	<atom:link href="http://www.brianlagunas.com/index.php/category/wpf/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.brianlagunas.com</link>
	<description></description>
	<lastBuildDate>Fri, 03 Sep 2010 01:55:48 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Extended WPF Toolkit &#8211; Release 1.1.0</title>
		<link>http://www.brianlagunas.com/index.php/2010/09/02/extended-wpf-toolkit-release-1-1-0/</link>
		<comments>http://www.brianlagunas.com/index.php/2010/09/02/extended-wpf-toolkit-release-1-1-0/#comments</comments>
		<pubDate>Fri, 03 Sep 2010 01:55:48 +0000</pubDate>
		<dc:creator>Brian Lagunas</dc:creator>
				<category><![CDATA[Extended WPF Toolkit]]></category>
		<category><![CDATA[WPF]]></category>
		<category><![CDATA[extended wpf toolit]]></category>

		<guid isPermaLink="false">http://www.brianlagunas.com/index.php/2010/09/02/extended-wpf-toolkit-release-1-1-0/</guid>
		<description><![CDATA[A new version of the Extended WPF Toolkit was released today and it is packed with goodies.&#160; And to all you cry babies who wined for a VS 2008 and .NET 3.5 version finally got on my nerves enough to create one for you.&#160; Ha, just kidding, but there really is a Visual Studio 2008 [...]]]></description>
			<content:encoded><![CDATA[<p>A new version of the <a href="http://wpftoolkit.codeplex.com/" target="_blank">Extended WPF Toolkit</a> was released today and it is packed with goodies.&#160; And to all you cry babies who wined for a VS 2008 and .NET 3.5 version finally got on my nerves enough to create one for you.&#160; Ha, just kidding, but there really is a Visual Studio 2008 and .NET 3.5 binaries and source available for download.&#160; One caveat to the 3.5 version is that it has a dependency on the <a href="http://wpf.codeplex.com/releases/view/40535" target="_blank">WPFToolkit</a> and won’t work without it.</p>
<p>What’s in it do you ask? Five kick @ss controls:</p>
<p><strong>The <a href="http://wpftoolkit.codeplex.com/wikipage?title=BusyIndicator&amp;referringTitle=Home" target="_blank">BusyIndicator</a></strong></p>
<p>BusyIndicator makes it easy to let the user know when an application is busy. Simply wrap the relavent content in an instance of the BusyIndicator control and toggle its IsBusy property to True during any long-running process.</p>
<p><img title="busyindicator.jpg" alt="busyindicator.jpg" src="http://i3.codeplex.com/Project/Download/FileDownload.aspx?ProjectName=wpftoolkit&amp;DownloadId=140575" width="640" height="204" /></p>
<p><strong>The <a href="http://wpftoolkit.codeplex.com/wikipage?title=ColorPicker&amp;referringTitle=Home" target="_blank">ColorPicker</a></strong></p>
<p>The ColorPicker is an editor that allows a user to select a custom color including support for transparency.</p>
<p><img title="color_picker_expanded.jpg" alt="color_picker_expanded.jpg" src="http://i3.codeplex.com/Project/Download/FileDownload.aspx?ProjectName=wpftoolkit&amp;DownloadId=142529" /></p>
<p><strong>The <a href="http://wpftoolkit.codeplex.com/wikipage?title=MessageBox&amp;referringTitle=Home" target="_blank">MessageBox</a></strong></p>
<p>Displays a message box that has a message and that returns a result.</p>
<p><img title="messagebox_icons.jpg" alt="messagebox_icons.jpg" src="http://i3.codeplex.com/Project/Download/FileDownload.aspx?ProjectName=wpftoolkit&amp;DownloadId=140577" width="640" height="288" /></p>
<p><strong>The <a href="http://wpftoolkit.codeplex.com/wikipage?title=RichTextBox&amp;referringTitle=Home" target="_blank">RichTextBox</a></strong></p>
<p>Extends the System.Windows.Control.RichTextBox control that represents a rich editing control which operates on FlowDocument objects. The RichTextBox control has a Text dependency property which allows a user to data bind content to the RichTextBox.Document property. The RichTextBox control introduces the concept of Text Formatters. Text Formatters allows a user to format the content of the RichTextBox control into any format of their choice. Three Text Formatters are included; PlainTextFormatter, RtfFormatter, and a XamlFormatter. The RtfFormatter is the default Text Formatter. A user can create their own custom Text Formatter by creating a class that inherits from ITextFormatter and implimenting the contract accordlingly.</p>
<p><img title="richtextbox_control.jpg" alt="richtextbox_control.jpg" src="http://i3.codeplex.com/Project/Download/FileDownload.aspx?ProjectName=wpftoolkit&amp;DownloadId=141838" width="350" height="233" /></p>
<p><strong>The ChildWindow</strong> – although it is in alpha</p>
<p>Similar to the functionality of a traditional, standard Windows Forms dialog window, the ChildWindow allows you to popup both modal and non-modal dialog windows using C# or XAML.</p>
<p><a href="http://www.brianlagunas.com/wp-content/uploads/2010/09/image.png"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="childwindow_control" border="0" alt="childwindow_control" src="http://www.brianlagunas.com/wp-content/uploads/2010/09/image_thumb.png" width="364" height="210" /></a>&#160;</p>
<p>These controls need to be pulled through the mud, used and abused.&#160; Help me find the bugs and make this toolkit a solid toolset that any WPF developer would want in their toolbox.&#160; please submit all issues to the <a href="http://wpftoolkit.codeplex.com/discussions" target="_blank">Discussions</a> section of the <a href="http://wpftoolkit.codeplex.com/" target="_blank">Extended WPF Toolkit</a> project site.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.brianlagunas.com/index.php/2010/09/02/extended-wpf-toolkit-release-1-1-0/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Extended WPF Toolkit &#8211; New ColorPicker Control</title>
		<link>http://www.brianlagunas.com/index.php/2010/08/15/extended-wpf-toolkit-new-colorpicker-control/</link>
		<comments>http://www.brianlagunas.com/index.php/2010/08/15/extended-wpf-toolkit-new-colorpicker-control/#comments</comments>
		<pubDate>Sun, 15 Aug 2010 06:01:29 +0000</pubDate>
		<dc:creator>Brian Lagunas</dc:creator>
				<category><![CDATA[Extended WPF Toolkit]]></category>
		<category><![CDATA[WPF]]></category>
		<category><![CDATA[extended wpf toolit]]></category>

		<guid isPermaLink="false">http://www.brianlagunas.com/index.php/2010/08/15/extended-wpf-toolkit-new-colorpicker-control/</guid>
		<description><![CDATA[Yes, another great control has been added to the Extended WPF Toolkit project on CodePlex called the ColorPicker.
The ColorPicker is pretty much self explanatory.&#160; It allows a user to select a color using a color canvas, a hue slider, and an alpha slider for transparency.
This is what is looks like when it is in display [...]]]></description>
			<content:encoded><![CDATA[<p>Yes, another great control has been added to the <a href="http://wpftoolkit.codeplex.com/" target="_blank">Extended WPF Toolkit</a> project on CodePlex called the <a href="http://wpftoolkit.codeplex.com/wikipage?title=ColorPicker&amp;referringTitle=Home" target="_blank">ColorPicker</a>.</p>
<p>The ColorPicker is pretty much self explanatory.&#160; It allows a user to select a color using a color canvas, a hue slider, and an alpha slider for transparency.</p>
<p><strong>This is what is looks like when it is in display mode:</strong></p>
<p><a href="http://www.brianlagunas.com/wp-content/uploads/2010/08/color_picker.jpg"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="color_picker" border="0" alt="color_picker" src="http://www.brianlagunas.com/wp-content/uploads/2010/08/color_picker_thumb.jpg" width="304" height="86" /></a>&#160;</p>
<p><strong>This is what it looks like in edit mode:</strong></p>
<p><a href="http://www.brianlagunas.com/wp-content/uploads/2010/08/color_picker_expanded.jpg"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="color_picker_expanded" border="0" alt="color_picker_expanded" src="http://www.brianlagunas.com/wp-content/uploads/2010/08/color_picker_expanded_thumb.jpg" width="305" height="232" /></a> </p>
<p>&#160;</p>
<p>It is a pretty simple control for now.&#160; There will be added functionality in the coming future to support entering RGB and HSV values, as well as Hexadecimal values.</p>
<p>There is a SelectedColor dependency property that can be data bound to as follows.</p>
<div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:9ce6104f-a9aa-4a17-a79f-3a39532ebf7c:698d730d-8b64-447b-bb28-887912584751" class="wlWriterEditableSmartContent">
<div style="border: #000080 1px solid; color: #000; font-family: 'Courier New', Courier, Monospace; font-size: 10pt">
<div style="background-color: #ffffff; max-height: 300px; overflow: auto; padding: 2px 5px;"><span style="color:#0000ff">&lt;</span><span style="color:#a31515">toolkit</span><span style="color:#0000ff">:</span><span style="color:#a31515">ColorPicker</span><span style="color:#ff0000"> SelectedColor</span><span style="color:#0000ff">=&quot;{</span><span style="color:#a31515">Binding</span><span style="color:#ff0000"> FavoriteColor}</span><span style="color:#0000ff">&quot; /&gt;</span></div>
</p></div>
</p></div>
<p>&#160;</p>
<p>As you can see, I have been hard at work trying to make the Extended WPF Toolkit a successful project full of valuable controls that can be used in your application.&#160; But I will need feedback on the controls to make sure they are meeting the needs of the users.&#160; So please leave your feedback, good or bad, in the <a href="http://wpftoolkit.codeplex.com/Thread/List.aspx" target="_blank">Discussions</a> section of the project site.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.brianlagunas.com/index.php/2010/08/15/extended-wpf-toolkit-new-colorpicker-control/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Extended WPF Toolkit &#8211; New RichTextBox Control</title>
		<link>http://www.brianlagunas.com/index.php/2010/08/12/extended-wpf-toolkit-new-richtextbox-control/</link>
		<comments>http://www.brianlagunas.com/index.php/2010/08/12/extended-wpf-toolkit-new-richtextbox-control/#comments</comments>
		<pubDate>Thu, 12 Aug 2010 13:49:26 +0000</pubDate>
		<dc:creator>Brian Lagunas</dc:creator>
				<category><![CDATA[Extended WPF Toolkit]]></category>
		<category><![CDATA[WPF]]></category>

		<guid isPermaLink="false">http://www.brianlagunas.com/index.php/2010/08/12/extended-wpf-toolkit-new-richtextbox-control/</guid>
		<description><![CDATA[There has been a new control added to the Extended WPF Toolkit project on CodePlex called the RichTextBox.
The RichTextBox extends the System.Windows.Control.RichTextBox control that represents a rich editing control which operates on FlowDocument objects. The RichTextBox control has a Text dependency property which allows a user to data bind content to the RichTextBox.Document property. The [...]]]></description>
			<content:encoded><![CDATA[<p>There has been a new control added to the <a href="http://wpftoolkit.codeplex.com/" target="_blank">Extended WPF Toolkit</a> project on CodePlex called the <a href="http://wpftoolkit.codeplex.com/wikipage?title=RichTextBox&amp;referringTitle=Documentation" target="_blank">RichTextBox</a>.</p>
<p>The RichTextBox extends the System.Windows.Control.RichTextBox control that represents a rich editing control which operates on FlowDocument objects. The RichTextBox control has a Text dependency property which allows a user to data bind content to the RichTextBox.Document property. The RichTextBox control introduces the concept of Text Formatters. Text Formatters allows a user to format the content of the RichTextBox control into any format of their choice. Three Text Formatters are included; PlainTextFormatter, RtfFormatter, and a XamlFormatter. The RtfFormatter is the default Text Formatter. A user can create their own custom Text Formatter by creating a class that inherits from ITextFormatter and implimenting the contract accordlingly.</p>
<h4>Usage</h4>
<p>When data binding to the Text property, you must use the Text Formatter that matches the format of the underlying data. If your data is in RTF you must use the RTF formatter. If your data is in plain text, you must use the PlainTextFormatter.</p>
<p><img title="richtextbox_control.jpg" alt="richtextbox_control.jpg" src="http://i3.codeplex.com/Project/Download/FileDownload.aspx?ProjectName=wpftoolkit&amp;DownloadId=141838" /></p>
<p>This RichTextBox is bound to an object that has a Notes property. The value of the Notes property is as follows in the RTF format:</p>
<p>{\rtf1\ansi\ansicpg1252\uc1\htmautsp\deff2{\fonttbl{\f0\fcharset0 Times New Roman;}{\f2\fcharset0 Segoe UI;}}{\colortbl\red0\green0\blue0;\red255\green255\blue255;}\loch\hich\dbch\pard\plain\ltrpar\itap0{\lang1033\fs18\f2\cf0 \cf0\ql{\f2 {\ltrch This is the }{\b\ltrch RichTextBox}\li0\ri0\sa0\sb0\fi0\ql\par}}}</p>
<div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:9ce6104f-a9aa-4a17-a79f-3a39532ebf7c:43934391-9f6c-47ba-90d1-38d9e7c9eff8" class="wlWriterEditableSmartContent">
<div style="border: #000080 1px solid; color: #000; font-family: 'Courier New', Courier, Monospace; font-size: 10pt">
<div style="background-color: #ffffff; overflow: auto; padding: 2px 5px;"><span style="color:#0000ff">&lt;</span><span style="color:#a31515">toolkit</span><span style="color:#0000ff">:</span><span style="color:#a31515">RichTextBox</span><span style="color:#ff0000"> x</span><span style="color:#0000ff">:</span><span style="color:#ff0000">Name</span><span style="color:#0000ff">=&quot;_richTextBox&quot;</span><span style="color:#ff0000"> Grid.Row</span><span style="color:#0000ff">=&quot;1&quot;</span><span style="color:#ff0000"> Margin</span><span style="color:#0000ff">=&quot;10&quot;</span><span style="color:#ff0000"> BorderBrush</span><span style="color:#0000ff">=&quot;Gray&quot;</span><span style="color:#ff0000"> Padding</span><span style="color:#0000ff">=&quot;10&quot;</span><br />                             <span style="color:#ff0000"> Text</span><span style="color:#0000ff">=&quot;{</span><span style="color:#a31515">Binding</span><span style="color:#ff0000"> Notes}</span><span style="color:#0000ff">&quot;</span> <br />                             <span style="color:#ff0000"> ScrollViewer.VerticalScrollBarVisibility</span><span style="color:#0000ff">=&quot;Auto&quot; /&gt;</span></div>
</p></div>
</p></div>
<h4>&#160;</h4>
<h4>Using Formatters</h4>
<p>To use a different Text Formatter than the default RtfFormatter use the following syntax:</p>
<p><strong>PlainTextFormatter</strong></p>
<div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:9ce6104f-a9aa-4a17-a79f-3a39532ebf7c:325d43a3-bb7f-4e2f-9a73-ff6a0554be30" class="wlWriterEditableSmartContent">
<div style="border: #000080 1px solid; color: #000; font-family: 'Courier New', Courier, Monospace; font-size: 10pt">
<div style="background-color: #ffffff; max-height: 300px; overflow: auto; padding: 2px 5px; white-space: nowrap"><span style="color:#0000ff">&lt;</span><span style="color:#a31515">toolkit</span><span style="color:#0000ff">:</span><span style="color:#a31515">RichTextBox</span><span style="color:#ff0000"> x</span><span style="color:#0000ff">:</span><span style="color:#ff0000">Name</span><span style="color:#0000ff">=&quot;_richTextBox&quot;</span><span style="color:#ff0000"> Grid.Row</span><span style="color:#0000ff">=&quot;1&quot;</span><span style="color:#ff0000"> Margin</span><span style="color:#0000ff">=&quot;10&quot;</span><span style="color:#ff0000"> BorderBrush</span><span style="color:#0000ff">=&quot;Gray&quot;</span><span style="color:#ff0000"> Padding</span><span style="color:#0000ff">=&quot;10&quot;</span><br />                                     <span style="color:#ff0000"> Text</span><span style="color:#0000ff">=&quot;{</span><span style="color:#a31515">Binding</span><span style="color:#ff0000"> Notes}</span><span style="color:#0000ff">&quot;</span> <br />                                     <span style="color:#ff0000"> ScrollViewer.VerticalScrollBarVisibility</span><span style="color:#0000ff">=&quot;Auto&quot;&gt;</span><br />             <span style="color:#a31515"></span><span style="color:#0000ff">&lt;</span><span style="color:#a31515">toolkit</span><span style="color:#0000ff">:</span><span style="color:#a31515">RichTextBox.TextFormatter</span><span style="color:#0000ff">&gt;</span><br />                 <span style="color:#a31515"></span><span style="color:#0000ff">&lt;</span><span style="color:#a31515">toolkit</span><span style="color:#0000ff">:</span><span style="color:#a31515">PlainTextFormatter</span><span style="color:#0000ff"> /&gt;</span><br />             <span style="color:#a31515"></span><span style="color:#0000ff">&lt;/</span><span style="color:#a31515">toolkit</span><span style="color:#0000ff">:</span><span style="color:#a31515">RichTextBox.TextFormatter</span><span style="color:#0000ff">&gt;</span><br />         <span style="color:#a31515"></span><span style="color:#0000ff">&lt;/</span><span style="color:#a31515">toolkit</span><span style="color:#0000ff">:</span><span style="color:#a31515">RichTextBox</span><span style="color:#0000ff">&gt;</span></div>
</p></div>
</p></div>
<p><b></b></p>
<p><b>XamlFormatter</b></p>
<div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:9ce6104f-a9aa-4a17-a79f-3a39532ebf7c:2b5c3c6a-a5c5-4077-903f-9a1e76b0c139" class="wlWriterEditableSmartContent">
<div style="border: #000080 1px solid; color: #000; font-family: 'Courier New', Courier, Monospace; font-size: 10pt">
<div style="background-color: #ffffff; max-height: 300px; overflow: auto; padding: 2px 5px; white-space: nowrap"><span style="color:#0000ff">&lt;</span><span style="color:#a31515">toolkit</span><span style="color:#0000ff">:</span><span style="color:#a31515">RichTextBox</span><span style="color:#ff0000"> x</span><span style="color:#0000ff">:</span><span style="color:#ff0000">Name</span><span style="color:#0000ff">=&quot;_richTextBox&quot;</span><span style="color:#ff0000"> Grid.Row</span><span style="color:#0000ff">=&quot;1&quot;</span><span style="color:#ff0000"> Margin</span><span style="color:#0000ff">=&quot;10&quot;</span><span style="color:#ff0000"> BorderBrush</span><span style="color:#0000ff">=&quot;Gray&quot;</span><span style="color:#ff0000"> Padding</span><span style="color:#0000ff">=&quot;10&quot;</span><br />                                     <span style="color:#ff0000"> Text</span><span style="color:#0000ff">=&quot;{</span><span style="color:#a31515">Binding</span><span style="color:#ff0000"> Notes}</span><span style="color:#0000ff">&quot;</span> <br />                                     <span style="color:#ff0000"> ScrollViewer.VerticalScrollBarVisibility</span><span style="color:#0000ff">=&quot;Auto&quot;&gt;</span><br />             <span style="color:#a31515"></span><span style="color:#0000ff">&lt;</span><span style="color:#a31515">toolkit</span><span style="color:#0000ff">:</span><span style="color:#a31515">RichTextBox.TextFormatter</span><span style="color:#0000ff">&gt;</span><br />                 <span style="color:#a31515"></span><span style="color:#0000ff">&lt;</span><span style="color:#a31515">toolkit</span><span style="color:#0000ff">:</span><span style="color:#a31515">XamlFormatter</span><span style="color:#0000ff"> /&gt;</span><br />             <span style="color:#a31515"></span><span style="color:#0000ff">&lt;/</span><span style="color:#a31515">toolkit</span><span style="color:#0000ff">:</span><span style="color:#a31515">RichTextBox.TextFormatter</span><span style="color:#0000ff">&gt;</span><br />         <span style="color:#a31515"></span><span style="color:#0000ff">&lt;/</span><span style="color:#a31515">toolkit</span><span style="color:#0000ff">:</span><span style="color:#a31515">RichTextBox</span><span style="color:#0000ff">&gt;</span></div>
</p></div>
</p></div>
<p>&#160;</p>
<h4>Custom Formatters</h4>
<p>To create a custom formatter, create a class that inherits from ITextFormatter and implement accordingly.</p>
<div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:9ce6104f-a9aa-4a17-a79f-3a39532ebf7c:d0959762-7096-49db-a258-615240293ac1" class="wlWriterEditableSmartContent">
<div style="border: #000080 1px solid; color: #000; font-family: 'Courier New', Courier, Monospace; font-size: 10pt">
<div style="background-color: #ffffff; max-height: 300px; overflow: auto; padding: 2px 5px; white-space: nowrap"><span style="color:#0000ff">public</span> <span style="color:#0000ff">class</span> <span style="color:#2b91af">MyFormatter</span> : ITextFormatter<br />     {<br />         <span style="color:#0000ff">public</span> <span style="color:#0000ff">string</span> GetText(System.Windows.Documents.<span style="color:#2b91af">FlowDocument</span> document)<br />         {<br />             <span style="color:#0000ff">return</span> <span style="color:#0000ff">new</span> <span style="color:#2b91af">TextRange</span>(document.ContentStart, document.ContentEnd).Text;<br />         }</p>
<p>         <span style="color:#0000ff">public</span> <span style="color:#0000ff">void</span> SetText(System.Windows.Documents.<span style="color:#2b91af">FlowDocument</span> document, <span style="color:#0000ff">string</span> text)<br />         {<br />             <span style="color:#0000ff">new</span> <span style="color:#2b91af">TextRange</span>(document.ContentStart, document.ContentEnd).Text = text;<br />         }<br />     }</div>
</p></div>
</p></div>
</p>
<p><strong>XAML</strong></p>
<div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:9ce6104f-a9aa-4a17-a79f-3a39532ebf7c:0d0f2931-d9cc-4cab-b526-7f76f0d49c46" class="wlWriterEditableSmartContent">
<div style="border: #000080 1px solid; color: #000; font-family: 'Courier New', Courier, Monospace; font-size: 10pt">
<div style="background-color: #ffffff; max-height: 300px; overflow: auto; padding: 2px 5px; white-space: nowrap"><span style="color:#a31515"> </span><span style="color:#0000ff">&lt;</span><span style="color:#a31515">toolkit</span><span style="color:#0000ff">:</span><span style="color:#a31515">RichTextBox</span><span style="color:#ff0000"> x</span><span style="color:#0000ff">:</span><span style="color:#ff0000">Name</span><span style="color:#0000ff">=&quot;_richTextBox&quot;</span><span style="color:#ff0000"> Grid.Row</span><span style="color:#0000ff">=&quot;1&quot;</span><span style="color:#ff0000"> Margin</span><span style="color:#0000ff">=&quot;10&quot;</span><span style="color:#ff0000"> BorderBrush</span><span style="color:#0000ff">=&quot;Gray&quot;</span><span style="color:#ff0000"> Padding</span><span style="color:#0000ff">=&quot;10&quot;</span><br />                            <span style="color:#ff0000"> Text</span><span style="color:#0000ff">=&quot;{</span><span style="color:#a31515">Binding</span><span style="color:#ff0000"> Notes}</span><span style="color:#0000ff">&quot;</span> <br />                            <span style="color:#ff0000"> ScrollViewer.VerticalScrollBarVisibility</span><span style="color:#0000ff">=&quot;Auto&quot;&gt;</span><br />             <span style="color:#a31515"></span><span style="color:#0000ff">&lt;</span><span style="color:#a31515">toolkit</span><span style="color:#0000ff">:</span><span style="color:#a31515">RichTextBox.TextFormatter</span><span style="color:#0000ff">&gt;</span><br />                 <span style="color:#a31515"></span><span style="color:#0000ff">&lt;</span><span style="color:#a31515">myCustomFormatter</span><span style="color:#0000ff">:</span><span style="color:#a31515">MyFormatter</span><span style="color:#0000ff"> /&gt;</span><br />             <span style="color:#a31515"></span><span style="color:#0000ff">&lt;/</span><span style="color:#a31515">toolkit</span><span style="color:#0000ff">:</span><span style="color:#a31515">RichTextBox.TextFormatter</span><span style="color:#0000ff">&gt;</span><br />         <span style="color:#a31515"></span><span style="color:#0000ff">&lt;/</span><span style="color:#a31515">toolkit</span><span style="color:#0000ff">:</span><span style="color:#a31515">RichTextBox</span><span style="color:#0000ff">&gt;</span></div>
</p></div>
</p></div>
]]></content:encoded>
			<wfw:commentRss>http://www.brianlagunas.com/index.php/2010/08/12/extended-wpf-toolkit-new-richtextbox-control/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Extended WPF Toolkit &#8211; New MessageBox Control</title>
		<link>http://www.brianlagunas.com/index.php/2010/08/05/extended-wpf-toolkit-new-messagebox-control/</link>
		<comments>http://www.brianlagunas.com/index.php/2010/08/05/extended-wpf-toolkit-new-messagebox-control/#comments</comments>
		<pubDate>Thu, 05 Aug 2010 17:29:32 +0000</pubDate>
		<dc:creator>Brian Lagunas</dc:creator>
				<category><![CDATA[Extended WPF Toolkit]]></category>
		<category><![CDATA[WPF]]></category>

		<guid isPermaLink="false">http://www.brianlagunas.com/index.php/2010/08/05/extended-wpf-toolkit-new-messagebox-control/</guid>
		<description><![CDATA[I have added a new control to the Extended WPF Toolkit&#160; project on CodePlex called the MessageBox.&#160; It is currently in beta and is only available in the source code download.&#160; The MessageBox control mimics the System.Windows.MessageBox closely and you use similar syntax to create it.
MessageBox
Displays a message box that has a message and that [...]]]></description>
			<content:encoded><![CDATA[<p>I have added a new control to the <a href="http://wpftoolkit.codeplex.com/" target="_blank">Extended WPF Toolkit</a>&#160; project on CodePlex called the <a href="http://wpftoolkit.codeplex.com/wikipage?title=Extended%20WPF%20Toolkit%20Controls&amp;referringTitle=Home&amp;ANCHOR#MessageBox" target="_blank">MessageBox</a>.&#160; It is currently in beta and is only available in the source code download.&#160; The MessageBox control mimics the System.Windows.MessageBox closely and you use similar syntax to create it.</p>
<h3>MessageBox</h3>
<p>Displays a message box that has a message and that returns a result.</p>
<h5>Buttons</h5>
<p><a href="http://www.brianlagunas.com/wp-content/uploads/2010/08/messagebox_buttons.jpg" target="_blank"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="messagebox_buttons" border="0" alt="messagebox_buttons" src="http://www.brianlagunas.com/wp-content/uploads/2010/08/messagebox_buttons_thumb.jpg" width="644" height="242" /></a> </p>
<h5>Icons</h5>
<p><a href="http://www.brianlagunas.com/wp-content/uploads/2010/08/messagebox_icons.jpg" target="_blank"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="messagebox_icons" border="0" alt="messagebox_icons" src="http://www.brianlagunas.com/wp-content/uploads/2010/08/messagebox_icons_thumb.jpg" width="644" height="292" /></a> </p>
<h5>Usage   </p>
<div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:9ce6104f-a9aa-4a17-a79f-3a39532ebf7c:f5edebbc-0ce7-4651-ad59-6a0bd1a8abd1" class="wlWriterEditableSmartContent">
<div style="border: #000080 1px solid; color: #000; font-family: 'Courier New', Courier, Monospace; font-size: 10pt">
<div style="background: #fff; max-height: 300px; overflow: auto">
<ol style="background: #ffffff; margin: 0; padding: 0 0 0 5px;">
<li><span style="color:#2b91af">MessageBoxResult</span> result =  Microsoft.Windows.Controls.<span style="color:#2b91af">MessageBox</span>.Show(<span style="color:#a31515">&quot;Hello world!&quot;</span>, <span style="color:#a31515">&quot;Extended WPF ToolKit MessageBox&quot;</span>, <span style="color:#2b91af">MessageBoxButton</span>.OK, <span style="color:#2b91af">MessageBoxImage</span>.Question);</li>
</ol></div>
</p></div>
</p></div>
</h5>
]]></content:encoded>
			<wfw:commentRss>http://www.brianlagunas.com/index.php/2010/08/05/extended-wpf-toolkit-new-messagebox-control/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>I Started a CodePlex Project: The Extended WPF Toolkit</title>
		<link>http://www.brianlagunas.com/index.php/2010/08/03/i-started-a-codeplex-project-the-extended-wpf-toolkit/</link>
		<comments>http://www.brianlagunas.com/index.php/2010/08/03/i-started-a-codeplex-project-the-extended-wpf-toolkit/#comments</comments>
		<pubDate>Wed, 04 Aug 2010 00:34:24 +0000</pubDate>
		<dc:creator>Brian Lagunas</dc:creator>
				<category><![CDATA[Extended WPF Toolkit]]></category>
		<category><![CDATA[WPF]]></category>
		<category><![CDATA[codeplex]]></category>
		<category><![CDATA[extended wpf toolit]]></category>

		<guid isPermaLink="false">http://www.brianlagunas.com/index.php/2010/08/03/i-started-a-codeplex-project-the-extended-wpf-toolkit/</guid>
		<description><![CDATA[WPF developers, have you ever needed a control that it is in the Silverlight Toolkit but not the WPF Toolkit?  What is that all about? 
Well my solution to that problem is on CodePlex and it is called the Extended WPF Toolkit.  The Extended WPF Toolkit is a collection of WPF controls, components and utilities made [...]]]></description>
			<content:encoded><![CDATA[<p>WPF developers, have you ever needed a control that it is in the Silverlight Toolkit but not the WPF Toolkit?  What is that all about? </p>
<p>Well my solution to that problem is on CodePlex and it is called the <a href="http://wpftoolkit.codeplex.com/" target="_blank">Extended WPF Toolkit</a>.  The Extended WPF Toolkit is a collection of WPF controls, components and utilities made available outside the normal WPF Toolkit.  It includes controls that are missing from the WPF Toolkit, or that have been ported over from the Silverlight Toolkit.</p>
<p>Currently there is only one control in it, the <a href="http://wpftoolkit.codeplex.com/wikipage?title=Extended%20WPF%20Toolkit%20Controls&amp;referringTitle=Home&amp;ANCHOR#BusyIndicator" target="_blank">BusyIndicator</a>.  It is the same busy indicator that is in the Silverlight toolkit, but for some strange reason never made it into the WPF toolkit.  Hey, WPF developers need busy indicators too!</p>
<h3>BusyIndicator</h3>
<p>BusyIndicator makes it easy to let the user know when an application is busy. Simply wrap the relavent content in an instance of the BusyIndicator control and toggle its IsBusy property to True during any long-running process.</p>
<p><img title="busyindicator.jpg" src="http://i3.codeplex.com/Project/Download/FileDownload.aspx?ProjectName=wpftoolkit&amp;DownloadId=139224" alt="busyindicator.jpg" width="640" height="204" /></p>
<p>Do you need a control ported over from the Silverlight toolkit?  Or a control that is used so commonly you think to yourself, “Why didn’t that just ship with Visual Studio?”.  Maybe you have a control you would like to contribute.  Whatever the case may be, place your questions in the <a href="http://wpftoolkit.codeplex.com/Thread/List.aspx" target="_blank">Discussions</a> and report bugs or request features in the <a href="http://wpftoolkit.codeplex.com/workitem/list/basic" target="_blank">Issue Tracker</a>.</p>
<p>Help me shape the Extended WPF Toolkit with your feedback!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.brianlagunas.com/index.php/2010/08/03/i-started-a-codeplex-project-the-extended-wpf-toolkit/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WPF Goodies in the Silverlight 4 Tools</title>
		<link>http://www.brianlagunas.com/index.php/2010/05/19/wpf-goodies-in-the-silverlight-4-tools/</link>
		<comments>http://www.brianlagunas.com/index.php/2010/05/19/wpf-goodies-in-the-silverlight-4-tools/#comments</comments>
		<pubDate>Thu, 20 May 2010 01:27:22 +0000</pubDate>
		<dc:creator>Brian Lagunas</dc:creator>
				<category><![CDATA[Silverlight]]></category>
		<category><![CDATA[WPF]]></category>
		<category><![CDATA[Silverlight 4]]></category>

		<guid isPermaLink="false">http://www.brianlagunas.com/index.php/2010/05/19/wpf-goodies-in-the-silverlight-4-tools/</guid>
		<description><![CDATA[If you haven’t heard already, the Silverlight Tools for VS2010 have been released, as mentioned by fellow ElegantCoder Bill Moore.&#160; In this release there have been some great improvements to the Visual Studio designer that work for both Silverlight and WPF.&#160; Lets check them out.
Go To Value Definition
Have you ever had a control that had [...]]]></description>
			<content:encoded><![CDATA[<p>If you haven’t heard already, the Silverlight Tools for VS2010 have been released, as <a href="http://elegantcode.com/2010/05/17/silverlight-4-tool-rtw-and-wcf-ria-services-v1-0-ships-today/" target="_blank">mentioned</a> by fellow ElegantCoder Bill Moore.&#160; In this release there have been some great improvements to the Visual Studio designer that work for both Silverlight and WPF.&#160; Lets check them out.</p>
<h5>Go To Value Definition</h5>
<p>Have you ever had a control that had a style assigned to it, but had no idea where to find that style?&#160; It could be nested down in some obscure folder path in a ResourceDictionary somewhere.&#160; You would have to do the good-old “ctrl + F” and do a search for it.&#160; Well, no longer.&#160; You can now go to the style value definition just by using the property inspector.</p>
<p><a href="http://www.brianlagunas.com/wp-content/uploads/2010/05/go_to_value_definition.jpg" target="_blank"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="go_to_value_definition" border="0" alt="go_to_value_definition" src="http://www.brianlagunas.com/wp-content/uploads/2010/05/go_to_value_definition_thumb.jpg" width="244" height="115" /></a> </p>
<p>And when you click that magic button, it takes you straight to its definition.</p>
<p><a href="http://www.brianlagunas.com/wp-content/uploads/2010/05/go_to_value_definition_results.jpg" target="_blank"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="go_to_value_definition_results" border="0" alt="go_to_value_definition_results" src="http://www.brianlagunas.com/wp-content/uploads/2010/05/go_to_value_definition_results_thumb.jpg" width="244" height="71" /></a> </p>
<h5>Style Intellisense</h5>
<p>A big pain for writing styles is that you have to hope you are setting the correct properties, and not fat-fingering them (misspelling).&#160; Well, never fear, Style intellisense is here.&#160; Never guess which property to use in the setter again.</p>
<p><a href="http://www.brianlagunas.com/wp-content/uploads/2010/05/style_intellisense.png" target="_blank"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="style_intellisense" border="0" alt="style_intellisense" src="http://www.brianlagunas.com/wp-content/uploads/2010/05/style_intellisense_thumb.png" width="244" height="166" /></a> </p>
<h5>Grid manipulation with a simple right-click</h5>
<p>The source of my biggest headaches comes from the Grid.&#160; Yes the Grid.&#160; Because it can be a real pain to change once you have it created.&#160; Lets say that I have laid out my nice beautiful form, and all of a sudden realize I put a row in the wrong order.&#160; Well, I have to go into my XAML and update all my Grid attached properties for all the controls affected.</p>
<p>Not anymore!&#160; With a simple right-click I can now move, insert, and delete rows and columns from my grid.&#160; I just have to select any control in the row/column I want to manipulate, right-click it, then make my selection.&#160; In this case I chose to move an entire row down one level.</p>
<p><a href="http://www.brianlagunas.com/wp-content/uploads/2010/05/grid_row_move_before.jpg" target="_blank"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="grid_row_move_before" border="0" alt="grid_row_move_before" src="http://www.brianlagunas.com/wp-content/uploads/2010/05/grid_row_move_before_thumb.jpg" width="244" height="150" /></a> </p>
<p>As you can see, not just the control I selected moves, but the entire row moves with it.</p>
<p><a href="http://www.brianlagunas.com/wp-content/uploads/2010/05/grid_row_move_after.jpg" target="_blank"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="grid_row_move_after" border="0" alt="grid_row_move_after" src="http://www.brianlagunas.com/wp-content/uploads/2010/05/grid_row_move_after_thumb.jpg" width="244" height="52" /></a> </p>
</p>
</p>
<p>As you can see, the Silverlight Tools for VS2010 aren’t just for Silverlight developers.&#160; Even WPF peeps get a little love.&#160; </p>
<p>Check out this <a href="http://channel9.msdn.com/shows/SilverlightTV/Silverlight-4-Tools-for-Visual-Studio-2010-Launch-New-Designer-Capabilities-Silverlight-TV-27/" target="_blank">video</a> which shows theses features in action.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.brianlagunas.com/index.php/2010/05/19/wpf-goodies-in-the-silverlight-4-tools/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>NETDUG – Silverlight/WPF Multi-Targeting Presentation Sample Code</title>
		<link>http://www.brianlagunas.com/index.php/2010/01/28/netdug-silverlightwpf-multi-targeting-presentation-sample-code/</link>
		<comments>http://www.brianlagunas.com/index.php/2010/01/28/netdug-silverlightwpf-multi-targeting-presentation-sample-code/#comments</comments>
		<pubDate>Fri, 29 Jan 2010 03:12:03 +0000</pubDate>
		<dc:creator>Brian Lagunas</dc:creator>
				<category><![CDATA[NETDUG]]></category>
		<category><![CDATA[Silverlight]]></category>
		<category><![CDATA[WPF]]></category>
		<category><![CDATA[XAML]]></category>
		<category><![CDATA[multi-targeting]]></category>

		<guid isPermaLink="false">http://brianlagunas.com/2010/01/28/netdug-silverlightwpf-multi-targeting-presentation-sample-code/</guid>
		<description><![CDATA[If you attended the NETDUG user group meeting last Thursday night and would like to download the sample code for my Silverlight/WPF Multi-Targeting presentation, you can download it here.
Recap:
The Silverlight and WPF platforms are very similar, but they do not have binary compatibility; this means that an assembly compiled for one platform cannot execute on [...]]]></description>
			<content:encoded><![CDATA[<p>If you attended the NETDUG user group meeting last Thursday night and would like to download the sample code for my Silverlight/WPF Multi-Targeting presentation, you can <a href="http://www.brianlagunas.com/downloads/presentations/MultiTargetingDemo.zip">download it here</a>.</p>
<p><strong>Recap:</strong></p>
<p>The Silverlight and WPF platforms are very similar, but they do not have binary compatibility; this means that an assembly compiled for one platform cannot execute on the other platform (Although, the story is a little different in Silverlight 4). You may want to target some or all of your application on WPF and Silverlight for a number of reasons.</p>
<p>Due to the fact that Silverlight and WPF are so closely related, the bulk of your application code can be shared between the two platforms. This encourages heavy use of pattern based development to isolate the logic from the presentation and maximize the separation between UI code and non-UI code.</p>
<p><strong>Elements you can share:</strong></p>
<ul>
<li>Presenters</li>
<li>Controllers</li>
<li>Models</li>
<li>Services</li>
<li>Unit tests</li>
<li>Simple views, if the XAML used is supported by both Silverlight and WPF.</li>
</ul>
<p><strong>Elements that are harder to share:</strong></p>
<ul>
<li>Complex views (XAML)</li>
<li>Controls</li>
<li>Styling</li>
<li>Animation</li>
</ul>
<p>Like always, if anyone has any questions feel free ask.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.brianlagunas.com/index.php/2010/01/28/netdug-silverlightwpf-multi-targeting-presentation-sample-code/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>BSDG &#8211; Silverlight/WPF Multi-Targeting Presentation Sample Code</title>
		<link>http://www.brianlagunas.com/index.php/2009/12/04/bsdg-silverlightwpf-multi-targeting-presentation-sample-code/</link>
		<comments>http://www.brianlagunas.com/index.php/2009/12/04/bsdg-silverlightwpf-multi-targeting-presentation-sample-code/#comments</comments>
		<pubDate>Fri, 04 Dec 2009 18:37:46 +0000</pubDate>
		<dc:creator>Brian Lagunas</dc:creator>
				<category><![CDATA[BSDG]]></category>
		<category><![CDATA[Silverlight]]></category>
		<category><![CDATA[WPF]]></category>
		<category><![CDATA[XAML]]></category>
		<category><![CDATA[multi-targeting]]></category>

		<guid isPermaLink="false">http://brianlagunas.com/2009/12/04/bsdg-silverlightwpf-multi-targeting-presentation-sample-code/</guid>
		<description><![CDATA[If you attended the BSDG user group meeting last night and would like to download the sample code for my Silverlight/WPF Multi-Targeting presentation, you can download it here. 
Recap:
The Silverlight and WPF platforms are very similar, but they do not have binary compatibility; this means that an assembly compiled for one platform cannot execute on [...]]]></description>
			<content:encoded><![CDATA[<p>If you attended the BSDG user group meeting last night and would like to download the sample code for my Silverlight/WPF Multi-Targeting presentation, you can <a href="http://www.brianlagunas.com/downloads/presentations/MultiTargetingDemo.zip" target="_blank">download it here</a>. </p>
<p><strong>Recap:</strong></p>
<p>The Silverlight and WPF platforms are very similar, but they do not have binary compatibility; this means that an assembly compiled for one platform cannot execute on the other platform (Although, the story is a little different in Silverlight 4). You may want to target some or all of your application on WPF and Silverlight for a number of reasons. </p>
<p>Due to the fact that Silverlight and WPF are so closely related, the bulk of your application code can be shared between the two platforms. This encourages heavy use of pattern based development to isolate the logic from the presentation and maximize the separation between UI code and non-UI code.</p>
<p><strong>Elements you can share:</strong></p>
<ul>
<li>Presenters </li>
<li>Controllers </li>
<li>Models </li>
<li>Services </li>
<li>Unit tests </li>
<li>Simple views, if the XAML used is supported by both Silverlight and WPF. </li>
</ul>
<p><strong>Elements that are harder to share:</strong></p>
<ul>
<li>Complex views (XAML) </li>
<li>Controls </li>
<li>Styling </li>
<li>Animation </li>
</ul>
<p>Like always, if anyone has any questions feel free ask.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.brianlagunas.com/index.php/2009/12/04/bsdg-silverlightwpf-multi-targeting-presentation-sample-code/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Extending the ObservableCollection to add navigation methods such as MoveFirst, MoveNext, MoveLast, and MovePrevious.</title>
		<link>http://www.brianlagunas.com/index.php/2009/09/25/extending-the-observablecollection-to-add-navigation-methods-such-as-movefirst-movenext-movelast-and-moveprevious/</link>
		<comments>http://www.brianlagunas.com/index.php/2009/09/25/extending-the-observablecollection-to-add-navigation-methods-such-as-movefirst-movenext-movelast-and-moveprevious/#comments</comments>
		<pubDate>Fri, 25 Sep 2009 19:31:12 +0000</pubDate>
		<dc:creator>Brian Lagunas</dc:creator>
				<category><![CDATA[.NET 3.5]]></category>
		<category><![CDATA[WPF]]></category>
		<category><![CDATA[observablecollection items navigation]]></category>

		<guid isPermaLink="false">http://brianlagunas.com/2009/09/25/extending-the-observablecollection-to-add-navigation-methods-such-as-movefirst-movenext-movelast-and-moveprevious/</guid>
		<description><![CDATA[Recently, I had the need to navigate a list by using methods such as MoveFirts, MovePrevious, MoveNext, and MoveLast while at the same time keeping track of its current location to notify the user where they are at in the list.
Enter the ICollectionView.&#160; “You can think of a collection view as a layer on top [...]]]></description>
			<content:encoded><![CDATA[<p>Recently, I had the need to navigate a list by using methods such as MoveFirts, MovePrevious, MoveNext, and MoveLast while at the same time keeping track of its current location to notify the user where they are at in the list.</p>
<p>Enter the ICollectionView.&#160; “You can think of a collection view as a layer on top of a binding source collection that allows you to navigate and display the collection based on sort, filter, and group queries, all without having to manipulate the underlying source collection itself.”, says the MSDN documentation. The ICollectionView supports filtering, sorting, grouping, selection, and navigation.</p>
<p>Now the most common way this is used is by creating your collection, populating it with data, then creating an ICollectionView instance from your collection, and then start sorting, filtering, grouping, etc.&#160; The following code show some examples of how to use the ICollectionView.</p>
<div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper">
<div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet">
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #008000">//get the view</span></pre>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">List&lt;MyObject&gt; myList = <span style="color: #0000ff">new</span> List&lt;MyObject&gt;();   </pre>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">ICollectionView view = CollectionViewSource.GetDefaultView(myList);</pre>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">&#160;</pre>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #008000">//filtering</span></pre>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">view.Filter = <span style="color: #0000ff">delegate</span>(<span style="color: #0000ff">object</span> item)</pre>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">{<span style="color: #0000ff">return</span> item.Contains(searchText);};</pre>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">&#160;</pre>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #008000">//sorting</span></pre>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">view.SortDescriptions.Add(<span style="color: #0000ff">new</span> SortDescription(<span style="color: #006080">&quot;LastName&quot;</span>, direction));</pre>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">&#160;</pre>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #008000">//grouping</span></pre>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">view.GroupDescriptions.Add(<span style="color: #0000ff">new</span> PropertyGroupDescription(<span style="color: #006080">&quot;State&quot;</span>));</pre>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">&#160;</pre>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #008000">//selection</span></pre>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">view.CurrentItem</pre>
</p></div>
</div>
<p>But I didn’t want to do this every time I had a collection of data I wanted to navigate. I wanted a single generic collection class that encapsulated all this functionality. So I decided to extend the ObservableCollection to allow for this functionality. So the first thing I need to do is create my class, inherit from ObservableCollection, and then create my constructors.</p>
<div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper">
<div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet">
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #0000ff">public</span> <span style="color: #0000ff">class</span> MyObservableCollection&lt;T&gt; : ObservableCollection&lt;T&gt;</pre>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">{</pre>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">    <span style="color: #0000ff">public</span> MyObservableCollection(List&lt;T&gt; list)</pre>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">        : <span style="color: #0000ff">base</span>(list)</pre>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">    {</pre>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">    }</pre>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">&#160;</pre>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">    <span style="color: #0000ff">public</span> MyObservableCollection(IEnumerable&lt;T&gt; collection)</pre>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">        : <span style="color: #0000ff">base</span>(collection)</pre>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">    {</pre>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">    }</pre>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">}</pre>
</p></div>
</div>
<p>Next I want to create my method to return my instance of ICollectionView.</p>
<div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper">
<div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet">
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #0000ff">private</span> System.ComponentModel.ICollectionView GetDefaultView()</pre>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">{</pre>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">    <span style="color: #0000ff">return</span> System.Windows.Data.CollectionViewSource.GetDefaultView(<span style="color: #0000ff">this</span>);</pre>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">}</pre>
</p></div>
</div>
<p>Now, lets create a property to retrieve the currently selected item in the list.</p>
<div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper">
<div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet">
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #0000ff">public</span> <span style="color: #0000ff">int</span> CurrentPosition</pre>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">{</pre>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">    get</pre>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">    {</pre>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">        <span style="color: #0000ff">return</span> GetDefaultView().CurrentPosition;</pre>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">    }</pre>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">}</pre>
</p></div>
</div>
<p>Now lets create our four methods for navigating the items in the collection.</p>
<div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper">
<div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet">
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #0000ff">public</span> <span style="color: #0000ff">void</span> MoveFirst()</pre>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">{</pre>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">    GetDefaultView().MoveCurrentToFirst();</pre>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">}</pre>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">&#160;</pre>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #0000ff">public</span> <span style="color: #0000ff">void</span> MovePrevious()</pre>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">{</pre>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">    GetDefaultView().MoveCurrentToPrevious();</pre>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">}</pre>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">&#160;</pre>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #0000ff">public</span> <span style="color: #0000ff">void</span> MoveNext()</pre>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">{</pre>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">    GetDefaultView().MoveCurrentToNext();</pre>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">}</pre>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">&#160;</pre>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #0000ff">public</span> <span style="color: #0000ff">void</span> MoveLast()</pre>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">{</pre>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">    GetDefaultView().MoveCurrentToLast();</pre>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">}</pre>
</p></div>
</div>
<p>Now, lets use our new collection. First start off by creating and instance of your custom collection. </p>
<div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper">
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet">MyObservableCollection&lt;MyObject&gt; ProgressItemsList = <span style="color: #0000ff">new</span> MyObservableCollection&lt;MyObject&gt;(data);</pre>
<p></div>
<p>In this example I am using a WPF Ribbon to hold my navigation controls, and commanding to execute the navigation methods. The center label maintains the current position and the count of the number of items in the collection.</p>
<p><a href="http://www.brianlagunas.com//wp-content/uploads/ExtendingtheObservableCollectiontoaddna_ADAE/ribbon_navigation.jpg" target="_blank"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="ribbon_navigation" border="0" alt="ribbon_navigation" src="http://www.brianlagunas.com//wp-content/uploads/ExtendingtheObservableCollectiontoaddna_ADAE/ribbon_navigation_thumb.jpg" width="231" height="99" /></a></p>
<p>So now, when I click the Next button I first need to check whether or not I can move to the next record in the command’s CanExecute event.</p>
<div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper">
<div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet">
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #0000ff">private</span> <span style="color: #0000ff">bool</span> CanMoveNext(<span style="color: #0000ff">object</span> parameter)</pre>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">{</pre>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">    <span style="color: #0000ff">bool</span> canExecute = <span style="color: #0000ff">false</span>;</pre>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">&#160;</pre>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">    <span style="color: #0000ff">if</span> (ProgressItemsList != <span style="color: #0000ff">null</span>)</pre>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">    {</pre>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">        <span style="color: #0000ff">int</span> currentPosition = ProgressItemsList.CurrentPosition;</pre>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">        <span style="color: #0000ff">int</span> lastIndex = ProgressItemsList.Count - 1;</pre>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">&#160;</pre>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">        canExecute = currentPosition &lt; lastIndex;</pre>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">    }</pre>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">&#160;</pre>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">    <span style="color: #0000ff">return</span> canExecute;</pre>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">}</pre>
</p></div>
</div>
<p>If I can move to the next record, then execute the Execute method of the command.</p>
<div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper">
<div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet">
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #0000ff">private</span> <span style="color: #0000ff">void</span> MoveNext(<span style="color: #0000ff">object</span> sender)</pre>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">{</pre>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">    ProgressItemsList.MoveNext();</pre>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">}</pre>
</p></div>
</div>
<p>That is it, and because this is an ObservableCollection, all the changes are notified back to the UI for you automatically. Now you can extend your custom collection even more to customize your sorting, filtering and grouping.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.brianlagunas.com/index.php/2009/09/25/extending-the-observablecollection-to-add-navigation-methods-such-as-movefirst-movenext-movelast-and-moveprevious/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>NETDUG: WPF Event Routing Sample Code</title>
		<link>http://www.brianlagunas.com/index.php/2009/09/22/bsdg-wpf-event-routing-sample-code/</link>
		<comments>http://www.brianlagunas.com/index.php/2009/09/22/bsdg-wpf-event-routing-sample-code/#comments</comments>
		<pubDate>Tue, 22 Sep 2009 20:54:01 +0000</pubDate>
		<dc:creator>Brian Lagunas</dc:creator>
				<category><![CDATA[NETDUG]]></category>
		<category><![CDATA[WPF]]></category>
		<category><![CDATA[routed events]]></category>

		<guid isPermaLink="false">http://brianlagunas.com/2009/09/22/bsdg-wpf-event-routing-sample-code/</guid>
		<description><![CDATA[Here is the sample code for last Thursday’s WPF Event Routing presentation.
Download Sample Code
I know I covered the subject fast, but I was in a hurry. I had to go to the airport. So here is a quick review.
Event Types:

Direct events are like ordinary .NET events. They originate in one element and don’t pass to [...]]]></description>
			<content:encoded><![CDATA[<p>Here is the sample code for last Thursday’s WPF Event Routing presentation.</p>
<p><a href="http://www.brianlagunas.com/downloads/presentations/routedevents.zip">Download Sample Code</a></p>
<p>I know I covered the subject fast, but I was in a hurry. I had to go to the airport. So here is a quick review.</p>
<p>Event Types:</p>
<ul>
<li><strong>Direct events </strong>are like ordinary .NET events. They originate in one element and don’t pass to any other. For example, MouseEnter is a direct event. </li>
<li><strong>Bubbling</strong> <strong>events</strong> are events that travel up the containment hierarchy. For example, MouseDown is a bubbling event. It is raised first by the element that is clicked. Next, it is raised by that element’s parent, and then by that element’s parent, and so on, until WPF reaches the top of the element tree. </li>
<li><strong>Tunneling events</strong> are events that travel down the containment hierarchy. They give you the chance to preview (and possible stop) an event before it reaches the appropriate control. For example, PreviewKeyDown allows you to intercept a key press, first at the window level, and then in increasingly more specific containers until you reach the element that had focus when the key was pressed. </li>
</ul>
<p>RoutedEventArgs Class:</p>
<ul>
<li><strong>Source</strong> indicates what object raised the event. </li>
<li><strong>OriginalSource</strong> indicates what object originally raised the event. Usually the OriginalSource is the same a the Source. But in some cases they could be different. For example, if you click close to the border of a window, you will get a Window object for the Source but a Border object for the OriginalSource. </li>
<li><strong>RoutedEvent</strong> provides the RoutedEvent object for the event triggered by your event handler. </li>
<li><strong>Handled</strong> allows you to halt the event bubbling or tunneling process. </li>
</ul>
<p>Here is a simple example of when you might use a bubbling event:</p>
<div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper">
<div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet">
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #0000ff">&lt;</span><span style="color: #800000">StackPanel</span> <span style="color: #ff0000">Hyperlink</span>.<span style="color: #ff0000">Click</span><span style="color: #0000ff">=&quot;StackPanel_Click&quot;</span><span style="color: #0000ff">&gt;</span></pre>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">    <span style="color: #0000ff">&lt;</span><span style="color: #800000">TextBlock</span><span style="color: #0000ff">&gt;</span></pre>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">        <span style="color: #0000ff">&lt;</span><span style="color: #800000">Hyperlink</span> <span style="color: #ff0000">NavigateUri</span><span style="color: #0000ff">=&quot;http://www.yahoo.com&quot;</span><span style="color: #0000ff">&gt;</span>Yahoo!<span style="color: #0000ff">&lt;/</span><span style="color: #800000">Hyperlink</span><span style="color: #0000ff">&gt;</span></pre>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">   <span style="color: #0000ff">&lt;/</span><span style="color: #800000">TextBlock</span><span style="color: #0000ff">&gt;</span></pre>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">   <span style="color: #0000ff">&lt;</span><span style="color: #800000">TextBlock</span><span style="color: #0000ff">&gt;</span></pre>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">       <span style="color: #0000ff">&lt;</span><span style="color: #800000">Hyperlink</span> <span style="color: #ff0000">NavigateUri</span><span style="color: #0000ff">=&quot;http://www.google.com&quot;</span><span style="color: #0000ff">&gt;</span>Google<span style="color: #0000ff">&lt;/</span><span style="color: #800000">Hyperlink</span><span style="color: #0000ff">&gt;</span></pre>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">   <span style="color: #0000ff">&lt;/</span><span style="color: #800000">TextBlock</span><span style="color: #0000ff">&gt;</span></pre>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">   <span style="color: #0000ff">&lt;</span><span style="color: #800000">TextBlock</span><span style="color: #0000ff">&gt;</span></pre>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">       <span style="color: #0000ff">&lt;</span><span style="color: #800000">Hyperlink</span> <span style="color: #ff0000">NavigateUri</span><span style="color: #0000ff">=&quot;http://www.msn.com&quot;</span><span style="color: #0000ff">&gt;</span>MSN<span style="color: #0000ff">&lt;/</span><span style="color: #800000">Hyperlink</span><span style="color: #0000ff">&gt;</span></pre>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">   <span style="color: #0000ff">&lt;/</span><span style="color: #800000">TextBlock</span><span style="color: #0000ff">&gt;</span></pre>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #0000ff">&lt;/</span><span style="color: #800000">StackPanel</span><span style="color: #0000ff">&gt;</span></pre>
</div>
</div>
<div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper">
<div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet">
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #0000ff">private</span> <span style="color: #0000ff">void</span> StackPanel_Click(<span style="color: #0000ff">object</span> sender, RoutedEventArgs e)</pre>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">{</pre>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">    Process.Start(((Hyperlink)e.Source).NavigateUri.ToString());</pre>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">}</pre>
</div>
</div>
<p>So instead of having to create an event handler for each hyperlink, or creating a single event handler and pointing each hyperlink to the same event handler, I can use one event handler on the parent element.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.brianlagunas.com/index.php/2009/09/22/bsdg-wpf-event-routing-sample-code/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
