<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>C# Disciples &#187; WPF Custom Controls</title>
	<atom:link href="http://marlongrech.wordpress.com/category/wpf-custom-controls/feed/" rel="self" type="application/rss+xml" />
	<link>http://marlongrech.wordpress.com</link>
	<description>my life in Avalon ....</description>
	<lastBuildDate>Thu, 15 Oct 2009 09:19:13 +0000</lastBuildDate>
	<generator>http://wordpress.com/</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<cloud domain='marlongrech.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://www.gravatar.com/blavatar/0c938eec94507e7222db1a9e8ad7ba9e?s=96&#038;d=http://s.wordpress.com/i/buttonw-com.png</url>
		<title>C# Disciples &#187; WPF Custom Controls</title>
		<link>http://marlongrech.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://marlongrech.wordpress.com/osd.xml" title="C# Disciples" />
		<item>
		<title>AvalonControlsLibrary DatePicker refactored</title>
		<link>http://marlongrech.wordpress.com/2008/04/04/avaloncontrolslibrary-datepicker-refactored/</link>
		<comments>http://marlongrech.wordpress.com/2008/04/04/avaloncontrolslibrary-datepicker-refactored/#comments</comments>
		<pubDate>Fri, 04 Apr 2008 17:29:57 +0000</pubDate>
		<dc:creator>marlongrech</dc:creator>
				<category><![CDATA[.Net 3.0]]></category>
		<category><![CDATA[.Net 3.5]]></category>
		<category><![CDATA[WPF]]></category>
		<category><![CDATA[WPF Custom Controls]]></category>

		<guid isPermaLink="false">http://marlongrech.wordpress.com/2008/04/04/avaloncontrolslibrary-datepicker-refactored/</guid>
		<description><![CDATA[Recently I received some requests from people to support some more styling for the DatePicker control. The initial idea for the DatePicker was to create a &#8220;lookless&#8221; control and then users would create a ControlTemplate to change the look and feel of the control (which is still 100% possible, see here for more info). Yet [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=marlongrech.wordpress.com&blog=783168&post=159&subd=marlongrech&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Recently I received some requests from people to support some more styling for the <a href="http://marlongrech.wordpress.com/2007/09/11/wpf-datepicker/" target="_blank">DatePicker</a> control. The initial idea for the DatePicker was to create a &#8220;lookless&#8221; control and then users would create a ControlTemplate to change the look and feel of the control (which is still 100% possible, <a href="http://marlongrech.wordpress.com/2007/09/11/wpf-datepicker/" target="_blank">see here for more info</a>). Yet sometimes users do not want to totally change the look of the control, sometimes it&#8217;s more a matter of changing colors and minor things like that. So I decided to make the DatePicker support some more styling so that users don&#8217;t need to create a new ControlTemplate for the DatePicker if they only need to change minor things in the DatePicker UI.</p>
<p><img src="http://marlongrech.files.wordpress.com/2008/04/datepicker.jpg" /></p>
<p>As you can see in the image above I added 5 new properties for styling the control. All of these properties are optional and if they are not set, a default value will be set for you.</p>
<h4>DayCellTemplate</h4>
<p>This property accepts a DataTemplate where the user can specify how each Day cell should look. The DataTemplate is fed with a DayCell object as DataContext. The DayCell class has the following properties which you can use in the DataTemplate</p>
<table border="0" cellpadding="2" cellspacing="0" width="782">
<tr>
<td valign="top" width="135"><b><i>Property Name</i></b></td>
<td valign="top" width="129"><b><i>Type</i></b></td>
<td valign="top" width="516"><b><i>Description</i></b></td>
</tr>
<tr>
<td valign="top" width="137"><b>DayNumber</b></td>
<td valign="top" width="128">int</td>
<td valign="top" width="516">Represents the Day number</td>
</tr>
<tr>
<td valign="top" width="138"><b>MonthNumber </b></td>
<td valign="top" width="127">int</td>
<td valign="top" width="516">Represents the Month number</td>
</tr>
<tr>
<td valign="top" width="139"><b>YearNumber </b></td>
<td valign="top" width="127">int</td>
<td valign="top" width="516">Represents the Year number</td>
</tr>
<tr>
<td valign="top" width="140"><b>IsEnabled </b></td>
<td valign="top" width="126">bool</td>
<td valign="top" width="516">Flag that indicates if the item falls out of the MinDate and MaxDate range</td>
</tr>
<tr>
<td valign="top" width="141"><b>IsInCurrentMonth</b></td>
<td valign="top" width="126">bool</td>
<td valign="top" width="516">Flag that indicates if the item is in the current selected month</td>
</tr>
</table>
<p>Here is a sample DataTemplate for the <i>DayCellTemplate.</i></p>
<div style="border:1px solid gray;overflow:auto;font-size:8pt;width:97.5%;cursor:text;max-height:200px;line-height:12pt;font-family:consolas,'Courier New',courier,monospace;background-color:#f4f4f4;margin:20px 0 10px;padding:4px;">
<div style="overflow:visible;font-size:8pt;width:100%;color:black;line-height:12pt;font-family:consolas,'Courier New',courier,monospace;background-color:#f4f4f4;border-style:none;padding:0;">
<pre style="overflow:visible;font-size:8pt;width:100%;color:black;line-height:12pt;font-family:consolas,'Courier New',courier,monospace;background-color:white;border-style:none;margin:0;padding:0;">&lt;DataTemplate&gt;</pre>
<pre style="overflow:visible;font-size:8pt;width:100%;color:black;line-height:12pt;font-family:consolas,'Courier New',courier,monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;">    &lt;Border Name=<span style="color:#006080;">"border"</span>&gt;</pre>
<pre style="overflow:visible;font-size:8pt;width:100%;color:black;line-height:12pt;font-family:consolas,'Courier New',courier,monospace;background-color:white;border-style:none;margin:0;padding:0;">        &lt;TextBlock Text=<span style="color:#006080;">"{Binding DayNumber}"</span> Name=<span style="color:#006080;">"dayCell"</span>/&gt;</pre>
<pre style="overflow:visible;font-size:8pt;width:100%;color:black;line-height:12pt;font-family:consolas,'Courier New',courier,monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;">    &lt;/Border&gt;</pre>
<pre style="overflow:visible;font-size:8pt;width:100%;color:black;line-height:12pt;font-family:consolas,'Courier New',courier,monospace;background-color:white;border-style:none;margin:0;padding:0;">    &lt;DataTemplate.Triggers&gt;</pre>
<pre style="overflow:visible;font-size:8pt;width:100%;color:black;line-height:12pt;font-family:consolas,'Courier New',courier,monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;">        &lt;!--This trigger <span style="color:#0000ff;">is</span> to <span style="color:#0000ff;">do</span> some thing with the template when an item <span style="color:#0000ff;">is</span> selected--&gt;</pre>
<pre style="overflow:visible;font-size:8pt;width:100%;color:black;line-height:12pt;font-family:consolas,'Courier New',courier,monospace;background-color:white;border-style:none;margin:0;padding:0;">        &lt;DataTrigger Binding=<span style="color:#006080;">"{Binding RelativeSource={</span></pre>
<pre style="overflow:visible;font-size:8pt;width:100%;color:black;line-height:12pt;font-family:consolas,'Courier New',courier,monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;">                                RelativeSource AncestorType={x:Type ListBoxItem}},</pre>
<pre style="overflow:visible;font-size:8pt;width:100%;color:black;line-height:12pt;font-family:consolas,'Courier New',courier,monospace;background-color:white;border-style:none;margin:0;padding:0;">                                Path=IsSelected}"</pre>
<pre style="overflow:visible;font-size:8pt;width:100%;color:black;line-height:12pt;font-family:consolas,'Courier New',courier,monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;">                     Value=<span style="color:#006080;">"True"</span>&gt;</pre>
<pre style="overflow:visible;font-size:8pt;width:100%;color:black;line-height:12pt;font-family:consolas,'Courier New',courier,monospace;background-color:white;border-style:none;margin:0;padding:0;">            &lt;Setter Property=<span style="color:#006080;">"Background"</span> Value=<span style="color:#006080;">"Blue"</span> TargetName=<span style="color:#006080;">"border"</span>/&gt;</pre>
<pre style="overflow:visible;font-size:8pt;width:100%;color:black;line-height:12pt;font-family:consolas,'Courier New',courier,monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;">        &lt;/DataTrigger&gt;</pre>
<pre style="overflow:visible;font-size:8pt;width:100%;color:black;line-height:12pt;font-family:consolas,'Courier New',courier,monospace;background-color:white;border-style:none;margin:0;padding:0;">        &lt;!--This <span style="color:#0000ff;">is</span> <span style="color:#0000ff;">for</span> those dates that fall <span style="color:#0000ff;">out</span> of the MinDate and MaxDate.--&gt;</pre>
<pre style="overflow:visible;font-size:8pt;width:100%;color:black;line-height:12pt;font-family:consolas,'Courier New',courier,monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;">        &lt;DataTrigger Binding=<span style="color:#006080;">"{Binding IsEnabled}"</span> Value=<span style="color:#006080;">"False"</span>&gt;</pre>
<pre style="overflow:visible;font-size:8pt;width:100%;color:black;line-height:12pt;font-family:consolas,'Courier New',courier,monospace;background-color:white;border-style:none;margin:0;padding:0;">            &lt;Setter Property=<span style="color:#006080;">"Background"</span> Value=<span style="color:#006080;">"Gray"</span> TargetName=<span style="color:#006080;">"border"</span>/&gt;</pre>
<pre style="overflow:visible;font-size:8pt;width:100%;color:black;line-height:12pt;font-family:consolas,'Courier New',courier,monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;">        &lt;/DataTrigger&gt;</pre>
<pre style="overflow:visible;font-size:8pt;width:100%;color:black;line-height:12pt;font-family:consolas,'Courier New',courier,monospace;background-color:white;border-style:none;margin:0;padding:0;">        &lt;DataTrigger Binding=<span style="color:#006080;">"{Binding IsInCurrentMonth}"</span> Value=<span style="color:#006080;">"False"</span>&gt;</pre>
<pre style="overflow:visible;font-size:8pt;width:100%;color:black;line-height:12pt;font-family:consolas,'Courier New',courier,monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;">            &lt;Setter Property=<span style="color:#006080;">"Foreground"</span> Value=<span style="color:#006080;">"Gray"</span> TargetName=<span style="color:#006080;">"dayCell"</span>/&gt;</pre>
<pre style="overflow:visible;font-size:8pt;width:100%;color:black;line-height:12pt;font-family:consolas,'Courier New',courier,monospace;background-color:white;border-style:none;margin:0;padding:0;">        &lt;/DataTrigger&gt;</pre>
<pre style="overflow:visible;font-size:8pt;width:100%;color:black;line-height:12pt;font-family:consolas,'Courier New',courier,monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;">    &lt;/DataTemplate.Triggers&gt;</pre>
<pre style="overflow:visible;font-size:8pt;width:100%;color:black;line-height:12pt;font-family:consolas,'Courier New',courier,monospace;background-color:white;border-style:none;margin:0;padding:0;">&lt;/DataTemplate&gt;</pre>
</div>
</div>
<p>So basically the DayCellTemplate will give you a lot of flexibility in terms of what you can do with the UI of the DatePicker because you can make the Day cell look however you want without the need of re building the whole UI for the control.</p>
<h4></h4>
<h4>DayHeaderTemplate</h4>
<p>The DayHeaderTemplate is again another DataTemplate, this time it will be a DataTemplate for the Header Day cell which basically is the Text -&gt; Sun, Mon, Tue etc.. The DataTemplate that you set as being the DayHeaderTemplate will be passed a string object as DataContext that contains the Text for the Header (ex. Mon, Tue etc..) Here is an example of a DataTemplate that can be applied for the DayHeaderTemplate property.</p>
<div style="border:1px solid gray;overflow:auto;font-size:8pt;width:97.5%;cursor:text;max-height:200px;line-height:12pt;font-family:consolas,'Courier New',courier,monospace;background-color:#f4f4f4;margin:20px 0 10px;padding:4px;">
<div style="overflow:visible;font-size:8pt;width:100%;color:black;line-height:12pt;font-family:consolas,'Courier New',courier,monospace;background-color:#f4f4f4;border-style:none;padding:0;">
<pre style="overflow:visible;font-size:8pt;width:100%;color:black;line-height:12pt;font-family:consolas,'Courier New',courier,monospace;background-color:white;border-style:none;margin:0;padding:0;">&lt;DataTemplate&gt;</pre>
<pre style="overflow:visible;font-size:8pt;width:100%;color:black;line-height:12pt;font-family:consolas,'Courier New',courier,monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;">    &lt;Border Background=<span style="color:#006080;">"Yellow"</span>&gt;</pre>
<pre style="overflow:visible;font-size:8pt;width:100%;color:black;line-height:12pt;font-family:consolas,'Courier New',courier,monospace;background-color:white;border-style:none;margin:0;padding:0;">        &lt;TextBlock Foreground=<span style="color:#006080;">"Lime"</span> Text=<span style="color:#006080;">"{Binding}"</span>/&gt;</pre>
<pre style="overflow:visible;font-size:8pt;width:100%;color:black;line-height:12pt;font-family:consolas,'Courier New',courier,monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;">    &lt;/Border&gt;</pre>
<pre style="overflow:visible;font-size:8pt;width:100%;color:black;line-height:12pt;font-family:consolas,'Courier New',courier,monospace;background-color:white;border-style:none;margin:0;padding:0;">&lt;/DataTemplate&gt;</pre>
</div>
</div>
<h4>MonthBackButtonStyle/MonthForwardButtonStyle</h4>
<p>These two properties are the styles for the back and forward month navigation buttons of the DatePicker. Basically you can apply a style for the Back and Forward button in any way you like. So you may decide even to create a ControlTemplate for these two buttons which would be quite easy. Something like this&#8230;.</p>
<div style="border:1px solid gray;overflow:auto;font-size:8pt;width:97.5%;cursor:text;max-height:200px;line-height:12pt;font-family:consolas,'Courier New',courier,monospace;background-color:#f4f4f4;margin:20px 0 10px;padding:4px;">
<div style="overflow:visible;font-size:8pt;width:100%;color:black;line-height:12pt;font-family:consolas,'Courier New',courier,monospace;background-color:#f4f4f4;border-style:none;padding:0;">
<pre style="overflow:visible;font-size:8pt;width:100%;color:black;line-height:12pt;font-family:consolas,'Courier New',courier,monospace;background-color:white;border-style:none;margin:0;padding:0;">&lt;Style TargetType=<span style="color:#006080;">"Button"</span>&gt;</pre>
<pre style="overflow:visible;font-size:8pt;width:100%;color:black;line-height:12pt;font-family:consolas,'Courier New',courier,monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;">    &lt;Setter Property=<span style="color:#006080;">"Template"</span>&gt;</pre>
<pre style="overflow:visible;font-size:8pt;width:100%;color:black;line-height:12pt;font-family:consolas,'Courier New',courier,monospace;background-color:white;border-style:none;margin:0;padding:0;">        &lt;Setter.Value&gt;</pre>
<pre style="overflow:visible;font-size:8pt;width:100%;color:black;line-height:12pt;font-family:consolas,'Courier New',courier,monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;">            &lt;ControlTemplate TargetType=<span style="color:#006080;">"Button"</span>&gt;</pre>
<pre style="overflow:visible;font-size:8pt;width:100%;color:black;line-height:12pt;font-family:consolas,'Courier New',courier,monospace;background-color:white;border-style:none;margin:0;padding:0;">                &lt;Border BorderBrush=<span style="color:#006080;">"Pink"</span> Width=<span style="color:#006080;">"20"</span> BorderThickness=<span style="color:#006080;">"2"</span>&gt;</pre>
<pre style="overflow:visible;font-size:8pt;width:100%;color:black;line-height:12pt;font-family:consolas,'Courier New',courier,monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;">                    &lt;TextBlock Text=<span style="color:#006080;">"&lt;"</span> FontWeight=<span style="color:#006080;">"Bold"</span>/&gt;</pre>
<pre style="overflow:visible;font-size:8pt;width:100%;color:black;line-height:12pt;font-family:consolas,'Courier New',courier,monospace;background-color:white;border-style:none;margin:0;padding:0;">                &lt;/Border&gt;</pre>
<pre style="overflow:visible;font-size:8pt;width:100%;color:black;line-height:12pt;font-family:consolas,'Courier New',courier,monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;">            &lt;/ControlTemplate&gt;</pre>
<pre style="overflow:visible;font-size:8pt;width:100%;color:black;line-height:12pt;font-family:consolas,'Courier New',courier,monospace;background-color:white;border-style:none;margin:0;padding:0;">        &lt;/Setter.Value&gt;</pre>
<pre style="overflow:visible;font-size:8pt;width:100%;color:black;line-height:12pt;font-family:consolas,'Courier New',courier,monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;">    &lt;/Setter&gt;</pre>
<pre style="overflow:visible;font-size:8pt;width:100%;color:black;line-height:12pt;font-family:consolas,'Courier New',courier,monospace;background-color:white;border-style:none;margin:0;padding:0;">&lt;/Style&gt;</pre>
</div>
</div>
<h4>MonthSelectorStyle</h4>
<p>Last but not least is the MonthSelectorStyle property. This property enables you to set a style for the Months drop down list aka ComboBox. Since here we are setting a scyle for a ComboBox a user has full control over that combobox. One can decide to do a ControlTemplate for the ComboBox or maybe just set an ItemTemplate for the elements inside it&#8230; Here is a style that I used in the demo app of the DatePicker&#8230;</p>
<div style="border:1px solid gray;overflow:auto;font-size:8pt;width:97.5%;cursor:text;max-height:200px;line-height:12pt;font-family:consolas,'Courier New',courier,monospace;background-color:#f4f4f4;margin:20px 0 10px;padding:4px;">
<div style="overflow:visible;font-size:8pt;width:100%;color:black;line-height:12pt;font-family:consolas,'Courier New',courier,monospace;background-color:#f4f4f4;border-style:none;padding:0;">
<pre style="overflow:visible;font-size:8pt;width:100%;color:black;line-height:12pt;font-family:consolas,'Courier New',courier,monospace;background-color:white;border-style:none;margin:0;padding:0;">&lt;Style TargetType=<span style="color:#006080;">"ComboBox"</span>&gt;</pre>
<pre style="overflow:visible;font-size:8pt;width:100%;color:black;line-height:12pt;font-family:consolas,'Courier New',courier,monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;">    &lt;Setter Property=<span style="color:#006080;">"Background"</span> Value=<span style="color:#006080;">"Yellow"</span>/&gt;</pre>
<pre style="overflow:visible;font-size:8pt;width:100%;color:black;line-height:12pt;font-family:consolas,'Courier New',courier,monospace;background-color:white;border-style:none;margin:0;padding:0;">    &lt;Setter Property=<span style="color:#006080;">"ItemContainerStyle"</span>&gt;</pre>
<pre style="overflow:visible;font-size:8pt;width:100%;color:black;line-height:12pt;font-family:consolas,'Courier New',courier,monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;">        &lt;Setter.Value&gt;</pre>
<pre style="overflow:visible;font-size:8pt;width:100%;color:black;line-height:12pt;font-family:consolas,'Courier New',courier,monospace;background-color:white;border-style:none;margin:0;padding:0;">            &lt;Style TargetType=<span style="color:#006080;">"ComboBoxItem"</span>&gt;</pre>
<pre style="overflow:visible;font-size:8pt;width:100%;color:black;line-height:12pt;font-family:consolas,'Courier New',courier,monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;">                &lt;Setter Property=<span style="color:#006080;">"Background"</span> Value=<span style="color:#006080;">"Yellow"</span>/&gt;</pre>
<pre style="overflow:visible;font-size:8pt;width:100%;color:black;line-height:12pt;font-family:consolas,'Courier New',courier,monospace;background-color:white;border-style:none;margin:0;padding:0;">            &lt;/Style&gt;</pre>
<pre style="overflow:visible;font-size:8pt;width:100%;color:black;line-height:12pt;font-family:consolas,'Courier New',courier,monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;">        &lt;/Setter.Value&gt;</pre>
<pre style="overflow:visible;font-size:8pt;width:100%;color:black;line-height:12pt;font-family:consolas,'Courier New',courier,monospace;background-color:white;border-style:none;margin:0;padding:0;">    &lt;/Setter&gt;</pre>
<pre style="overflow:visible;font-size:8pt;width:100%;color:black;line-height:12pt;font-family:consolas,'Courier New',courier,monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;">    &lt;Setter Property=<span style="color:#006080;">"ItemTemplate"</span>&gt;</pre>
<pre style="overflow:visible;font-size:8pt;width:100%;color:black;line-height:12pt;font-family:consolas,'Courier New',courier,monospace;background-color:white;border-style:none;margin:0;padding:0;">        &lt;Setter.Value&gt;</pre>
<pre style="overflow:visible;font-size:8pt;width:100%;color:black;line-height:12pt;font-family:consolas,'Courier New',courier,monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;">            &lt;DataTemplate&gt;</pre>
<pre style="overflow:visible;font-size:8pt;width:100%;color:black;line-height:12pt;font-family:consolas,'Courier New',courier,monospace;background-color:white;border-style:none;margin:0;padding:0;">                &lt;TextBlock Foreground=<span style="color:#006080;">"Red"</span> Text=<span style="color:#006080;">"{Binding}"</span>/&gt;</pre>
<pre style="overflow:visible;font-size:8pt;width:100%;color:black;line-height:12pt;font-family:consolas,'Courier New',courier,monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;">            &lt;/DataTemplate&gt;</pre>
<pre style="overflow:visible;font-size:8pt;width:100%;color:black;line-height:12pt;font-family:consolas,'Courier New',courier,monospace;background-color:white;border-style:none;margin:0;padding:0;">        &lt;/Setter.Value&gt;</pre>
<pre style="overflow:visible;font-size:8pt;width:100%;color:black;line-height:12pt;font-family:consolas,'Courier New',courier,monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;">    &lt;/Setter&gt;</pre>
<pre style="overflow:visible;font-size:8pt;width:100%;color:black;line-height:12pt;font-family:consolas,'Courier New',courier,monospace;background-color:white;border-style:none;margin:0;padding:0;">&lt;/Style&gt;</pre>
</div>
</div>
<h4>Conclusion</h4>
<p>I think that with the introduction of these properties the DatePicker control will be much more easy to use and re style. Again I would suggest that if you need to totally re arrange the look of this control the best way would be to use a ControlTemplate and change the whole look of the control, yet if all you need is to change some colors and other minor things, these new properties will help you out in the process.</p>
<p>The new version of the DatePicker will be available in the <a href="https://www.codeplex.com/Release/ProjectReleases.aspx?ProjectName=AvalonControlsLib&amp;ReleaseId=11518" target="_blank">AvalonControlsLibrary v3</a>, yet I know you can&#8217;t wait until you get your hands on this so I created a demo app for you  <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> </p>
<p>I am open to suggestions as usual! Please let me know if there is something missing or something that you would like to have in YOUR AvalonControlsLibarary DatePicker <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>And as my friend <a href="http://www.sachabarber.net" target="_blank">Sacha Barber</a> says &#8211; &#8220;It&#8217;s all good!&#8221; <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> </p>
<p><a href="http://cid-96f8d49aa44c79c1.skydrive.live.com/self.aspx/Public/DatePickerRefactored.zip" target="_blank">Download Demo Project</a></p>
<p>
<a href="http://www.dotnetkicks.com/kick/?url=http%3a%2f%2fmarlongrech.wordpress.com%2f2008%2f04%2f04%2favaloncontrolslibrary-datepicker-refactored%2f"><img src="http://www.dotnetkicks.com/Services/Images/KickItImageGenerator.ashx?url=http%3a%2f%2fmarlongrech.wordpress.com%2f2008%2f04%2f04%2favaloncontrolslibrary-datepicker-refactored%2f" border="0" alt="kick it on DotNetKicks.com" /></a></p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/marlongrech.wordpress.com/159/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/marlongrech.wordpress.com/159/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/marlongrech.wordpress.com/159/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/marlongrech.wordpress.com/159/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/marlongrech.wordpress.com/159/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/marlongrech.wordpress.com/159/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/marlongrech.wordpress.com/159/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/marlongrech.wordpress.com/159/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/marlongrech.wordpress.com/159/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/marlongrech.wordpress.com/159/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/marlongrech.wordpress.com/159/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/marlongrech.wordpress.com/159/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=marlongrech.wordpress.com&blog=783168&post=159&subd=marlongrech&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://marlongrech.wordpress.com/2008/04/04/avaloncontrolslibrary-datepicker-refactored/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/4231953dc5a7ec7d7b5acb2444eeeeab?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">C# Disciple</media:title>
		</media:content>

		<media:content url="http://marlongrech.files.wordpress.com/2008/04/datepicker.jpg" medium="image" />

		<media:content url="http://www.dotnetkicks.com/Services/Images/KickItImageGenerator.ashx?url=http%3a%2f%2fmarlongrech.wordpress.com%2f2008%2f04%2f04%2favaloncontrolslibrary-datepicker-refactored%2f" medium="image">
			<media:title type="html">kick it on DotNetKicks.com</media:title>
		</media:content>
	</item>
		<item>
		<title>WPF Treeview root node</title>
		<link>http://marlongrech.wordpress.com/2008/03/15/wpf-treeview-root-node/</link>
		<comments>http://marlongrech.wordpress.com/2008/03/15/wpf-treeview-root-node/#comments</comments>
		<pubDate>Sat, 15 Mar 2008 15:20:35 +0000</pubDate>
		<dc:creator>marlongrech</dc:creator>
				<category><![CDATA[.Net 3.0]]></category>
		<category><![CDATA[.Net 3.5]]></category>
		<category><![CDATA[WPF]]></category>
		<category><![CDATA[WPF Custom Controls]]></category>

		<guid isPermaLink="false">http://marlongrech.wordpress.com/2008/03/15/wpf-treeview-root-node/</guid>
		<description><![CDATA[Unfortunately the WPF native treeview or treeview items do not expose a property to determine which item is the root node in the treeview. I needed such a feature and thought to put it on my blog&#8230;
What is a treeview?
Well believe it or not a TreeView is just an Items Control nothing more. Yes, an [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=marlongrech.wordpress.com&blog=783168&post=135&subd=marlongrech&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Unfortunately the WPF native treeview or treeview items do not expose a property to determine which item is the root node in the treeview. I needed such a feature and thought to put it on my blog&#8230;</p>
<p>What is a treeview?<br />
Well believe it or not a TreeView is just an Items Control nothing more. Yes, an ItemsControl that creates TreeViewItems as it&#8217;s Item Containers. The TreeViewItems are also ItemsControl so a recursive data structure is formed and the TreeViewItems generate there own child nodes.</p>
<p>Today I will not go into details of how the treeview and ItemsControl work&#8230; For more info on this visit <a href="http://drwpf.com/blog/Home/tabid/36/EntryID/15/Default.aspx" target="_blank">Dr.Wpf Blog</a>. I will discuss more how I implemented the root nodes for the treeview.</p>
<p>So an ItemsControl has a very special method that one can override to do some custom logic, &#8220;<b>PrepareContainerForItemOverride</b>&#8220;. The following is the signature of the method</p>
<div style="border:1px solid gray;overflow:auto;font-size:8pt;width:97.5%;cursor:text;max-height:200px;line-height:12pt;font-family:consolas,'Courier New',courier,monospace;background-color:#f4f4f4;margin:20px 0 10px;padding:4px;">
<div style="overflow:visible;font-size:8pt;width:100%;color:black;line-height:12pt;font-family:consolas,'Courier New',courier,monospace;background-color:#f4f4f4;border-style:none;padding:0;">
<pre style="overflow:visible;font-size:8pt;width:100%;color:black;line-height:12pt;font-family:consolas,'Courier New',courier,monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#0000ff;">protected</span> <span style="color:#0000ff;">override</span> <span style="color:#0000ff;">void</span> PrepareContainerForItemOverride(</pre>
<pre style="overflow:visible;font-size:8pt;width:100%;color:black;line-height:12pt;font-family:consolas,'Courier New',courier,monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;">    DependencyObject element, <span style="color:#0000ff;">object</span> item)</pre>
</div>
</div>
<p>Basically this method gets called whenever an item (in our case a TreeViewItem) is being created and decorated with a DataTemplate (if set). In this method we can set a property of the TreeViewItem to identify the item as a root node.Ok, lets start. First we need to sub class the Treeview control. Once we did that we need a way how to attach information to the TreeViewItems&#8230; HMMM.. what better could do this then Attached Properties. Once we have all this, we need to set the attached property to True for the root nodes and we are done <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  &#8230;. something like this</p>
<div style="border:1px solid gray;overflow:auto;font-size:8pt;width:97.5%;cursor:text;max-height:200px;line-height:12pt;font-family:consolas,'Courier New',courier,monospace;background-color:#f4f4f4;height:600px;margin:20px 0 10px;padding:4px;">
<div style="overflow:visible;font-size:8pt;width:100%;color:black;line-height:12pt;font-family:consolas,'Courier New',courier,monospace;background-color:#f4f4f4;border-style:none;padding:0;">
<pre style="overflow:visible;font-size:8pt;width:100%;color:black;line-height:12pt;font-family:consolas,'Courier New',courier,monospace;background-color:white;border-style:none;margin:0;padding:0;"><span style="color:#0000ff;">public</span> <span style="color:#0000ff;">class</span> MyTreeView : TreeView</pre>
<pre style="overflow:visible;font-size:8pt;width:100%;color:black;line-height:12pt;font-family:consolas,'Courier New',courier,monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;">    {</pre>
<pre style="overflow:visible;font-size:8pt;width:100%;color:black;line-height:12pt;font-family:consolas,'Courier New',courier,monospace;background-color:white;border-style:none;margin:0;padding:0;"></pre>
<pre style="overflow:visible;font-size:8pt;width:100%;color:black;line-height:12pt;font-family:consolas,'Courier New',courier,monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;">        <span style="color:#0000ff;">public</span> <span style="color:#0000ff;">static</span> <span style="color:#0000ff;">bool</span> GetIsRootNode(DependencyObject obj)</pre>
<pre style="overflow:visible;font-size:8pt;width:100%;color:black;line-height:12pt;font-family:consolas,'Courier New',courier,monospace;background-color:white;border-style:none;margin:0;padding:0;">        {</pre>
<pre style="overflow:visible;font-size:8pt;width:100%;color:black;line-height:12pt;font-family:consolas,'Courier New',courier,monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;">            <span style="color:#0000ff;">return</span> (<span style="color:#0000ff;">bool</span>)obj.GetValue(IsRootNodeProperty);</pre>
<pre style="overflow:visible;font-size:8pt;width:100%;color:black;line-height:12pt;font-family:consolas,'Courier New',courier,monospace;background-color:white;border-style:none;margin:0;padding:0;">        }</pre>
<pre style="overflow:visible;font-size:8pt;width:100%;color:black;line-height:12pt;font-family:consolas,'Courier New',courier,monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;"></pre>
<pre style="overflow:visible;font-size:8pt;width:100%;color:black;line-height:12pt;font-family:consolas,'Courier New',courier,monospace;background-color:white;border-style:none;margin:0;padding:0;">        <span style="color:#0000ff;">public</span> <span style="color:#0000ff;">static</span> <span style="color:#0000ff;">void</span> SetIsRootNode(DependencyObject obj, <span style="color:#0000ff;">bool</span> <span style="color:#0000ff;">value</span>)</pre>
<pre style="overflow:visible;font-size:8pt;width:100%;color:black;line-height:12pt;font-family:consolas,'Courier New',courier,monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;">        {</pre>
<pre style="overflow:visible;font-size:8pt;width:100%;color:black;line-height:12pt;font-family:consolas,'Courier New',courier,monospace;background-color:white;border-style:none;margin:0;padding:0;">            obj.SetValue(IsRootNodeProperty, <span style="color:#0000ff;">value</span>);</pre>
<pre style="overflow:visible;font-size:8pt;width:100%;color:black;line-height:12pt;font-family:consolas,'Courier New',courier,monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;">        }</pre>
<pre style="overflow:visible;font-size:8pt;width:100%;color:black;line-height:12pt;font-family:consolas,'Courier New',courier,monospace;background-color:white;border-style:none;margin:0;padding:0;"></pre>
<pre style="overflow:visible;font-size:8pt;width:100%;color:black;line-height:12pt;font-family:consolas,'Courier New',courier,monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;">        <span style="color:#0000ff;">public</span> <span style="color:#0000ff;">static</span> <span style="color:#0000ff;">readonly</span> DependencyProperty IsRootNodeProperty =</pre>
<pre style="overflow:visible;font-size:8pt;width:100%;color:black;line-height:12pt;font-family:consolas,'Courier New',courier,monospace;background-color:white;border-style:none;margin:0;padding:0;">            DependencyProperty.RegisterAttached(<span style="color:#006080;">"IsRootNode"</span>, <span style="color:#0000ff;">typeof</span>(<span style="color:#0000ff;">bool</span>),</pre>
<pre style="overflow:visible;font-size:8pt;width:100%;color:black;line-height:12pt;font-family:consolas,'Courier New',courier,monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;">            <span style="color:#0000ff;">typeof</span>(MyTreeView), <span style="color:#0000ff;">new</span> UIPropertyMetadata(<span style="color:#0000ff;">false</span>));</pre>
<pre style="overflow:visible;font-size:8pt;width:100%;color:black;line-height:12pt;font-family:consolas,'Courier New',courier,monospace;background-color:white;border-style:none;margin:0;padding:0;"></pre>
<pre style="overflow:visible;font-size:8pt;width:100%;color:black;line-height:12pt;font-family:consolas,'Courier New',courier,monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;">        <span style="color:#0000ff;">protected</span> <span style="color:#0000ff;">override</span> <span style="color:#0000ff;">void</span> PrepareContainerForItemOverride(</pre>
<pre style="overflow:visible;font-size:8pt;width:100%;color:black;line-height:12pt;font-family:consolas,'Courier New',courier,monospace;background-color:white;border-style:none;margin:0;padding:0;">            DependencyObject element, <span style="color:#0000ff;">object</span> item)</pre>
<pre style="overflow:visible;font-size:8pt;width:100%;color:black;line-height:12pt;font-family:consolas,'Courier New',courier,monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;">        {</pre>
<pre style="overflow:visible;font-size:8pt;width:100%;color:black;line-height:12pt;font-family:consolas,'Courier New',courier,monospace;background-color:white;border-style:none;margin:0;padding:0;">            SetIsRootNode(element, <span style="color:#0000ff;">true</span>);</pre>
<pre style="overflow:visible;font-size:8pt;width:100%;color:black;line-height:12pt;font-family:consolas,'Courier New',courier,monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;">            <span style="color:#0000ff;">base</span>.PrepareContainerForItemOverride(element, item);</pre>
<pre style="overflow:visible;font-size:8pt;width:100%;color:black;line-height:12pt;font-family:consolas,'Courier New',courier,monospace;background-color:white;border-style:none;margin:0;padding:0;">        }</pre>
<pre style="overflow:visible;font-size:8pt;width:100%;color:black;line-height:12pt;font-family:consolas,'Courier New',courier,monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;">    }</pre>
</div>
</div>
<p>So the most important part is where we set the Attached property IsRootNode to true (Please also note that by default the Attached property is set to false). You would be wondering, But wouldn&#8217;t this make all TreeViewItems root nodes???!!??? And the answer is, NO. Because the Treeview only generate root nodes. all other nodes are generated by the TreeViewItems themselves (Remember that the TreeViewItems are ItemsControl as well <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> ).</p>
<p>Once we have the property IsRootNode set we can restyle the TreeView as we want by using a Control Template. something like this</p>
<div style="border:1px solid gray;overflow:auto;font-size:8pt;width:97.5%;cursor:text;max-height:200px;line-height:12pt;font-family:consolas,'Courier New',courier,monospace;background-color:#f4f4f4;margin:20px 0 10px;padding:4px;">
<div style="overflow:visible;font-size:8pt;width:100%;color:black;line-height:12pt;font-family:consolas,'Courier New',courier,monospace;background-color:#f4f4f4;border-style:none;padding:0;">
<pre style="overflow:visible;font-size:8pt;width:100%;color:black;line-height:12pt;font-family:consolas,'Courier New',courier,monospace;background-color:white;border-style:none;margin:0;padding:0;">&lt;ControlTemplate TargetType=<span style="color:#006080;">"TreeViewItem"</span>&gt;</pre>
<pre style="overflow:visible;font-size:8pt;width:100%;color:black;line-height:12pt;font-family:consolas,'Courier New',courier,monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;">    &lt;StackPanel Margin=<span style="color:#006080;">"10,2,0,0"</span>&gt;</pre>
<pre style="overflow:visible;font-size:8pt;width:100%;color:black;line-height:12pt;font-family:consolas,'Courier New',courier,monospace;background-color:white;border-style:none;margin:0;padding:0;">        &lt;WrapPanel Name=<span style="color:#006080;">"item"</span>&gt;</pre>
<pre style="overflow:visible;font-size:8pt;width:100%;color:black;line-height:12pt;font-family:consolas,'Courier New',courier,monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;">            &lt;ToggleButton Name=<span style="color:#006080;">"expander"</span></pre>
<pre style="overflow:visible;font-size:8pt;width:100%;color:black;line-height:12pt;font-family:consolas,'Courier New',courier,monospace;background-color:white;border-style:none;margin:0;padding:0;">                          IsChecked=<span style="color:#006080;">"{Binding RelativeSource={RelativeSource TemplatedParent}, </span></pre>
<pre style="overflow:visible;font-size:8pt;width:100%;color:black;line-height:12pt;font-family:consolas,'Courier New',courier,monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;">                                              Path=IsExpanded}"</pre>
<pre style="overflow:visible;font-size:8pt;width:100%;color:black;line-height:12pt;font-family:consolas,'Courier New',courier,monospace;background-color:white;border-style:none;margin:0;padding:0;">                          Content=<span style="color:#006080;">"+"</span>/&gt;</pre>
<pre style="overflow:visible;font-size:8pt;width:100%;color:black;line-height:12pt;font-family:consolas,'Courier New',courier,monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;">            &lt;ContentPresenter x:Name=<span style="color:#006080;">"PART_Header"</span></pre>
<pre style="overflow:visible;font-size:8pt;width:100%;color:black;line-height:12pt;font-family:consolas,'Courier New',courier,monospace;background-color:white;border-style:none;margin:0;padding:0;">                  ContentSource=<span style="color:#006080;">"Header"</span> /&gt;</pre>
<pre style="overflow:visible;font-size:8pt;width:100%;color:black;line-height:12pt;font-family:consolas,'Courier New',courier,monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;">        &lt;/WrapPanel&gt;</pre>
<pre style="overflow:visible;font-size:8pt;width:100%;color:black;line-height:12pt;font-family:consolas,'Courier New',courier,monospace;background-color:white;border-style:none;margin:0;padding:0;">        &lt;Border&gt;</pre>
<pre style="overflow:visible;font-size:8pt;width:100%;color:black;line-height:12pt;font-family:consolas,'Courier New',courier,monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;">            &lt;ItemsPresenter Name=<span style="color:#006080;">"children"</span> Visibility=<span style="color:#006080;">"Collapsed"</span> /&gt;</pre>
<pre style="overflow:visible;font-size:8pt;width:100%;color:black;line-height:12pt;font-family:consolas,'Courier New',courier,monospace;background-color:white;border-style:none;margin:0;padding:0;">        &lt;/Border&gt;</pre>
<pre style="overflow:visible;font-size:8pt;width:100%;color:black;line-height:12pt;font-family:consolas,'Courier New',courier,monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;">    &lt;/StackPanel&gt;</pre>
<pre style="overflow:visible;font-size:8pt;width:100%;color:black;line-height:12pt;font-family:consolas,'Courier New',courier,monospace;background-color:white;border-style:none;margin:0;padding:0;">    &lt;ControlTemplate.Triggers&gt;</pre>
<pre style="overflow:visible;font-size:8pt;width:100%;color:black;line-height:12pt;font-family:consolas,'Courier New',courier,monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;">        &lt;Trigger Property=<span style="color:#006080;">"IsSelected"</span> Value=<span style="color:#006080;">"True"</span>&gt;</pre>
<pre style="overflow:visible;font-size:8pt;width:100%;color:black;line-height:12pt;font-family:consolas,'Courier New',courier,monospace;background-color:white;border-style:none;margin:0;padding:0;">            &lt;Setter TargetName=<span style="color:#006080;">"item"</span> Property=<span style="color:#006080;">"Background"</span></pre>
<pre style="overflow:visible;font-size:8pt;width:100%;color:black;line-height:12pt;font-family:consolas,'Courier New',courier,monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;">                    Value=<span style="color:#006080;">"LightBlue"</span>/&gt;</pre>
<pre style="overflow:visible;font-size:8pt;width:100%;color:black;line-height:12pt;font-family:consolas,'Courier New',courier,monospace;background-color:white;border-style:none;margin:0;padding:0;">        &lt;/Trigger&gt;</pre>
<pre style="overflow:visible;font-size:8pt;width:100%;color:black;line-height:12pt;font-family:consolas,'Courier New',courier,monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;">        &lt;Trigger Property=<span style="color:#006080;">"IsExpanded"</span> Value=<span style="color:#006080;">"True"</span>&gt;</pre>
<pre style="overflow:visible;font-size:8pt;width:100%;color:black;line-height:12pt;font-family:consolas,'Courier New',courier,monospace;background-color:white;border-style:none;margin:0;padding:0;">            &lt;Setter TargetName=<span style="color:#006080;">"children"</span> Property=<span style="color:#006080;">"Visibility"</span></pre>
<pre style="overflow:visible;font-size:8pt;width:100%;color:black;line-height:12pt;font-family:consolas,'Courier New',courier,monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;">                    Value=<span style="color:#006080;">"Visible"</span>/&gt;</pre>
<pre style="overflow:visible;font-size:8pt;width:100%;color:black;line-height:12pt;font-family:consolas,'Courier New',courier,monospace;background-color:white;border-style:none;margin:0;padding:0;">        &lt;/Trigger&gt;</pre>
<pre style="overflow:visible;font-size:8pt;width:100%;color:black;line-height:12pt;font-family:consolas,'Courier New',courier,monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;">        &lt;Trigger Property=<span style="color:#006080;">"HasItems"</span> Value=<span style="color:#006080;">"False"</span>&gt;</pre>
<pre style="overflow:visible;font-size:8pt;width:100%;color:black;line-height:12pt;font-family:consolas,'Courier New',courier,monospace;background-color:white;border-style:none;margin:0;padding:0;">            &lt;Setter TargetName=<span style="color:#006080;">"expander"</span> Property=<span style="color:#006080;">"Visibility"</span></pre>
<pre style="overflow:visible;font-size:8pt;width:100%;color:black;line-height:12pt;font-family:consolas,'Courier New',courier,monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;">                    Value=<span style="color:#006080;">"Collapsed"</span>/&gt;</pre>
<pre style="overflow:visible;font-size:8pt;width:100%;color:black;line-height:12pt;font-family:consolas,'Courier New',courier,monospace;background-color:white;border-style:none;margin:0;padding:0;">        &lt;/Trigger&gt;</pre>
<pre style="overflow:visible;font-size:8pt;width:100%;color:black;line-height:12pt;font-family:consolas,'Courier New',courier,monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;">        &lt;Trigger Property=<span style="color:#006080;">"local:MyTreeView.IsRootNode"</span> Value=<span style="color:#006080;">"True"</span>&gt;</pre>
<pre style="overflow:visible;font-size:8pt;width:100%;color:black;line-height:12pt;font-family:consolas,'Courier New',courier,monospace;background-color:white;border-style:none;margin:0;padding:0;">            &lt;Setter TargetName=<span style="color:#006080;">"item"</span> Property=<span style="color:#006080;">"Background"</span> Value=<span style="color:#006080;">"Silver"</span>/&gt;</pre>
<pre style="overflow:visible;font-size:8pt;width:100%;color:black;line-height:12pt;font-family:consolas,'Courier New',courier,monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;">            &lt;Setter TargetName=<span style="color:#006080;">"item"</span> Property=<span style="color:#006080;">"Height"</span>  Value=<span style="color:#006080;">"50"</span>/&gt;</pre>
<pre style="overflow:visible;font-size:8pt;width:100%;color:black;line-height:12pt;font-family:consolas,'Courier New',courier,monospace;background-color:white;border-style:none;margin:0;padding:0;">        &lt;/Trigger&gt;</pre>
<pre style="overflow:visible;font-size:8pt;width:100%;color:black;line-height:12pt;font-family:consolas,'Courier New',courier,monospace;background-color:#f4f4f4;border-style:none;margin:0;padding:0;">    &lt;/ControlTemplate.Triggers&gt;</pre>
<pre style="overflow:visible;font-size:8pt;width:100%;color:black;line-height:12pt;font-family:consolas,'Courier New',courier,monospace;background-color:white;border-style:none;margin:0;padding:0;">&lt;/ControlTemplate&gt;</pre>
</div>
</div>
<p>The most important part of this ControlTemplate is the Trigger on the attached property <i>local:MyTreeView.IsRootNode.</i>Here we are making the RootNodes for the treeview look different from all other nodes&#8230;</p>
<p>Hope this post helps&#8230;. Please contact me if you need any help <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p><a href="http://cid-96f8d49aa44c79c1.skydrive.live.com/self.aspx/Public/TreeViewRootNodes.zip" target="_blank">Download the full source code</a></p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/marlongrech.wordpress.com/135/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/marlongrech.wordpress.com/135/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/marlongrech.wordpress.com/135/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/marlongrech.wordpress.com/135/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/marlongrech.wordpress.com/135/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/marlongrech.wordpress.com/135/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/marlongrech.wordpress.com/135/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/marlongrech.wordpress.com/135/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/marlongrech.wordpress.com/135/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/marlongrech.wordpress.com/135/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/marlongrech.wordpress.com/135/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/marlongrech.wordpress.com/135/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=marlongrech.wordpress.com&blog=783168&post=135&subd=marlongrech&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://marlongrech.wordpress.com/2008/03/15/wpf-treeview-root-node/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/4231953dc5a7ec7d7b5acb2444eeeeab?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">C# Disciple</media:title>
		</media:content>
	</item>
		<item>
		<title>Input Prompt support in WPF</title>
		<link>http://marlongrech.wordpress.com/2008/03/09/input-prompt-support-in-wpf/</link>
		<comments>http://marlongrech.wordpress.com/2008/03/09/input-prompt-support-in-wpf/#comments</comments>
		<pubDate>Sun, 09 Mar 2008 17:39:49 +0000</pubDate>
		<dc:creator>marlongrech</dc:creator>
				<category><![CDATA[.Net 3.0]]></category>
		<category><![CDATA[.Net 3.5]]></category>
		<category><![CDATA[WPF]]></category>
		<category><![CDATA[WPF Custom Controls]]></category>
		<category><![CDATA[wpf tools]]></category>

		<guid isPermaLink="false">http://marlongrech.wordpress.com/?p=133</guid>
		<description><![CDATA[Intro
If you look at Vista User experience guide, one thing that is a must have is the Input Prompt. I think that this is very important to improve the user experience. Yet unfortunately this is not supported natively by WPF  
But don&#8217;t worry because AvalonControlsLibrary is at the rescue  
I had noting to [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=marlongrech.wordpress.com&blog=783168&post=133&subd=marlongrech&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><h3><u>Intro</u></h3>
<p>If you look at Vista User experience guide, one thing that is a must have is the <a href="http://ui-patterns.com/pattern/InputPrompt" target="_blank">Input Prompt</a>. I think that this is very important to improve the user experience. Yet unfortunately this is not supported natively by WPF <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' /> </p>
<p>But don&#8217;t worry because <a href="http://www.codeplex.com/avaloncontrolslib" target="_blank">AvalonControlsLibrary</a> is at the rescue <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>I had noting to do today so I decided to create this functionality and share it with you guys&#8230; You would say, aha; here comes Marlon with a new control. But NO. This is not a control as such. What I have created is a class with some attached properties that can be used to have the Prompt Input feature for any control (or better any control that would make sense such a feature). I choose the attached properties approach rather than creating a custom control for the simple reason to support any control that you wish to have an input prompt like the one displayed in the image below.</p>
<p><a href="http://marlongrech.files.wordpress.com/2008/03/inputprompt.jpg" title="Input prompt"><img src="http://marlongrech.files.wordpress.com/2008/03/inputprompt.jpg" alt="Input prompt" /></a></p>
<p>As you can see in the image above I am using the Input Prompt both for the TextBox and the ComboBox. And yes you can use it with any control that you want&#8230;</p>
<h3><u>How to use this&#8230;</u></h3>
<p>Well using this feature is quite easy, all you have to do is to set an attached property in your control. Something like this&#8230;</p>
<div style="border:1px solid gray;overflow:auto;font-size:8pt;width:97.5%;cursor:text;max-height:200px;line-height:12pt;font-family:consolas,'Courier New',courier,monospace;background-color:#f4f4f4;margin:20px 0 10px;padding:4px;">
<div style="overflow:visible;font-size:8pt;width:100%;color:black;line-height:12pt;font-family:consolas,'Courier New',courier,monospace;background-color:#f4f4f4;border-style:none;padding:0;">
<pre style="overflow:visible;font-size:8pt;width:100%;color:black;line-height:12pt;font-family:consolas,'Courier New',courier,monospace;background-color:white;border-style:none;margin:0;padding:0;">&lt;TextBox local:InputPrompt.PromptText=<span style="color:#006080;">"Enter Search"</span> /&gt;</pre>
</div>
</div>
<p>[where local is the <a href="http://msdn2.microsoft.com/en-us/library/ms747086.aspx" target="_blank">XAML namespace mapping</a>]</p>
<p>In total there are 8 properties that you can set which are</p>
<ol>
<li>InputPrompt.PromptText               &#8211; I guess you already figured this one out <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> </li>
<li>InputPrompt.PromptColor              &#8211; This is a brush used as foreground for the Prompt Text <i>(Default: Gray)</i></li>
<li>InputPrompt.PromptFontFamily     &#8211; The font family to use for the Prompt Text <i>(Default: Arial)</i></li>
<li>InputPrompt.PromptFontSize        &#8211; The font size of the Prompt Text <i>(Default: 12.0)</i></li>
<li>InputPrompt.PromptFontStretch   &#8211; The font stretch to use for the Prompt Text <i>(Default: FontStretches.Normal)</i></li>
<li>InputPrompt.PromptFontStyle       &#8211; The font style to use for the Prompt Text <i>(Default: FontStyles.Normal)</i></li>
<li>InputPrompt.PromptFontWeight    &#8211; The font weight to use for the Prompt Text <i>(Default: FontWeights.Normal)</i></li>
<li>InputPrompt.PromptBackColor       &#8211; This is a brush that is used to color the background of the prompt <i>(Default: Transparent)</i></li>
</ol>
<p><i>Please note: You must set the <b>InputPrompt.PromptText </b>in order for this to work all the other properties are optional. Also you must have you control under an <b>AdornerDecorator </b>because the InputPrompt will draw the prompt text in an adorner. </i></p>
<p><i></i></p>
<p>If you use the Input Prompt with a textbox the input prompt will be much more intelligent. What do I mean by this? Basically the Input Prompt handles the Text Changed event of the TextBox and if the user enters no text the prompt re appears. The same happens if the TextBox looses focus and there is no text in it. I did this behaviour for the TextBox because this is the standard behaviour for an Input Prompt for textboxes.</p>
<h3></h3>
<h3>How does this work behind the scenes</h3>
<p>Well it&#8217;s quite simple. Basically an Adorner is placed on top of the control which sets the Attached properties and draws the InputPrompt.PromptText. Besides drawing the text this also draws a rectangle covering the surface of the control so that as soon as the user click the control(or better mouse down on the control), the adorner disappears and the control gets activated once again.</p>
<p>When the InputPrompt.PromptText is set for a TextBox, the input prompt will register to the LostFocus event and the TextChanged event and make sure to display the Prompt Text if the Text of the TextBox is to empty.</p>
<h3>Conclusion</h3>
<p>All this will be included in AvalonControlsLibrary v3 but I decided to upload a demo as a stand alone so that you can start using this immediately.</p>
<p>Hope you like this and as usual I am all ears for feedback and suggestions&#8230;.</p>
<p>Thanks</p>
<p><a href="http://cid-96f8d49aa44c79c1.skydrive.live.com/self.aspx/Public/TestInputPrompt.zip" target="_blank">Download Source Code and Demo App</a></p>
<p>
<a href="http://www.dotnetkicks.com/kick/?url=http%3a%2f%2fmarlongrech.wordpress.com%2f2008%2f03%2f09%2finput-prompt-support-in-wpf%2f"><img src="http://www.dotnetkicks.com/Services/Images/KickItImageGenerator.ashx?url=http%3a%2f%2fmarlongrech.wordpress.com%2f2008%2f03%2f09%2finput-prompt-support-in-wpf%2f" border="0" alt="kick it on DotNetKicks.com" /></a></p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/marlongrech.wordpress.com/133/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/marlongrech.wordpress.com/133/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/marlongrech.wordpress.com/133/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/marlongrech.wordpress.com/133/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/marlongrech.wordpress.com/133/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/marlongrech.wordpress.com/133/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/marlongrech.wordpress.com/133/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/marlongrech.wordpress.com/133/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/marlongrech.wordpress.com/133/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/marlongrech.wordpress.com/133/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/marlongrech.wordpress.com/133/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/marlongrech.wordpress.com/133/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=marlongrech.wordpress.com&blog=783168&post=133&subd=marlongrech&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://marlongrech.wordpress.com/2008/03/09/input-prompt-support-in-wpf/feed/</wfw:commentRss>
		<slash:comments>15</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/4231953dc5a7ec7d7b5acb2444eeeeab?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">C# Disciple</media:title>
		</media:content>

		<media:content url="http://marlongrech.files.wordpress.com/2008/03/inputprompt.jpg" medium="image">
			<media:title type="html">Input prompt</media:title>
		</media:content>

		<media:content url="http://www.dotnetkicks.com/Services/Images/KickItImageGenerator.ashx?url=http%3a%2f%2fmarlongrech.wordpress.com%2f2008%2f03%2f09%2finput-prompt-support-in-wpf%2f" medium="image">
			<media:title type="html">kick it on DotNetKicks.com</media:title>
		</media:content>
	</item>
		<item>
		<title>Support for MinDate and MaxDate in DatePicker and TimePicker</title>
		<link>http://marlongrech.wordpress.com/2008/03/03/support-for-mindate-and-maxdate-in-datepicker-and-timepicker/</link>
		<comments>http://marlongrech.wordpress.com/2008/03/03/support-for-mindate-and-maxdate-in-datepicker-and-timepicker/#comments</comments>
		<pubDate>Mon, 03 Mar 2008 22:22:45 +0000</pubDate>
		<dc:creator>marlongrech</dc:creator>
				<category><![CDATA[.Net 3.0]]></category>
		<category><![CDATA[.Net 3.5]]></category>
		<category><![CDATA[WPF]]></category>
		<category><![CDATA[WPF Custom Controls]]></category>

		<guid isPermaLink="false">http://marlongrech.wordpress.com/2008/03/03/support-for-mindate-and-maxdate-in-datepicker-and-timepicker/</guid>
		<description><![CDATA[I updated the sources for AvalonControlsLibrary v2 so that to support MinDate and MaxDate in the DatePicker.
Also added support for MinTime and MaxTime in TimePicker.
And while I was at it I also refactored the DateTimePicker to support these 2 properties.
The properties are DependencyProperties so you can easily databind to and do what every you like [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=marlongrech.wordpress.com&blog=783168&post=130&subd=marlongrech&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>I updated the sources for AvalonControlsLibrary v2 so that to support MinDate and MaxDate in the DatePicker.</p>
<p>Also added support for MinTime and MaxTime in TimePicker.</p>
<p>And while I was at it I also refactored the DateTimePicker to support these 2 properties.</p>
<p>The properties are DependencyProperties so you can easily databind to and do what every you like with them&#8230;.</p>
<p>Great&#8230; now i should go to sleep <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' />   <a href="http://www.codeplex.com/AvalonControlsLib" target="_blank"></a></p>
<p><a href="http://www.codeplex.com/AvalonControlsLib" target="_blank">Downlaod the new version</a></p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/marlongrech.wordpress.com/130/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/marlongrech.wordpress.com/130/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/marlongrech.wordpress.com/130/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/marlongrech.wordpress.com/130/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/marlongrech.wordpress.com/130/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/marlongrech.wordpress.com/130/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/marlongrech.wordpress.com/130/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/marlongrech.wordpress.com/130/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/marlongrech.wordpress.com/130/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/marlongrech.wordpress.com/130/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/marlongrech.wordpress.com/130/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/marlongrech.wordpress.com/130/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=marlongrech.wordpress.com&blog=783168&post=130&subd=marlongrech&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://marlongrech.wordpress.com/2008/03/03/support-for-mindate-and-maxdate-in-datepicker-and-timepicker/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/4231953dc5a7ec7d7b5acb2444eeeeab?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">C# Disciple</media:title>
		</media:content>
	</item>
		<item>
		<title>AvalonControlsLibrary v2 has been released !</title>
		<link>http://marlongrech.wordpress.com/2008/03/02/avaloncontrolslibrary-v2-has-been-released/</link>
		<comments>http://marlongrech.wordpress.com/2008/03/02/avaloncontrolslibrary-v2-has-been-released/#comments</comments>
		<pubDate>Sun, 02 Mar 2008 13:51:37 +0000</pubDate>
		<dc:creator>marlongrech</dc:creator>
				<category><![CDATA[.Net 3.0]]></category>
		<category><![CDATA[.Net 3.5]]></category>
		<category><![CDATA[WPF]]></category>
		<category><![CDATA[WPF Custom Controls]]></category>

		<guid isPermaLink="false">http://marlongrech.wordpress.com/2008/03/02/avaloncontrolslibrary-v2-has-been-released/</guid>
		<description><![CDATA[Finally I had some time to release the new version of AvalonControlsLibrary v2.
This release includes
- RangeSlider - All properties are now Dependency properties so that you can easily databind with.
- RangeSlider - The RangeSelectedChanged event has been  refactored into a Routed event.
- Range slider &#8211;  Support for Commands such as MoveBack Move Forward, [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=marlongrech.wordpress.com&blog=783168&post=129&subd=marlongrech&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Finally I had some time to release the new version of AvalonControlsLibrary v2.</p>
<p>This release includes</p>
<p>- <b>RangeSlider </b>- All properties are now Dependency properties so that you can easily databind with.<br />
- <b>RangeSlider </b>- The RangeSelectedChanged event has been  refactored into a Routed event.<br />
- <b>Range slider</b> &#8211;  Support for Commands such as MoveBack Move Forward, AllBack and AllForward</p>
<p>- <b>DatePicker </b>- Add a DateSelectedChanged routed event   &#8211; TimePicker &#8211; Add a TimeSelectedChanged routed event</p>
<p>- <b>DateTimePicker </b>(this will be the DatePicker and TimePicker joined)</p>
<p>- <b>DockableContainer </b>(aka Docky- This is a brand new control which supports docking of element and undocking. While elements are un docked you can drag around the element <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  Just like Blend Toolbars)</p>
<p>- <b>Bug Fixes</b><br />
Masked TextBox IsReadonly <a href="http://www.codeplex.com/AvalonControlsLib/WorkItem/View.aspx?WorkItemId=860" target="_blank">click here for more info</a><br />
DateTimePicker &#8211; setting the date via code before the ControlTemplate being loaded was thowing an exception</p>
<p><a href="https://www.codeplex.com/Release/ProjectReleases.aspx?ProjectName=AvalonControlsLib&amp;ReleaseId=10250" target="_blank">Download the new version</a></p>
<p>Send as much feedback as you can so that I can start working on V3 <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> </p>
<p>Thanks for all your support</p>
<p><a href="http://www.dotnetkicks.com/kick/?url=http%3a%2f%2fmarlongrech.wordpress.com%2f2008%2f03%2f02%2favaloncontrolslibrary-v2-has-been-released%2f"><img src="http://www.dotnetkicks.com/Services/Images/KickItImageGenerator.ashx?url=http%3a%2f%2fmarlongrech.wordpress.com%2f2008%2f03%2f02%2favaloncontrolslibrary-v2-has-been-released%2f" alt="kick it on DotNetKicks.com" border="0" /></a></p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/marlongrech.wordpress.com/129/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/marlongrech.wordpress.com/129/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/marlongrech.wordpress.com/129/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/marlongrech.wordpress.com/129/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/marlongrech.wordpress.com/129/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/marlongrech.wordpress.com/129/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/marlongrech.wordpress.com/129/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/marlongrech.wordpress.com/129/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/marlongrech.wordpress.com/129/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/marlongrech.wordpress.com/129/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/marlongrech.wordpress.com/129/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/marlongrech.wordpress.com/129/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=marlongrech.wordpress.com&blog=783168&post=129&subd=marlongrech&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://marlongrech.wordpress.com/2008/03/02/avaloncontrolslibrary-v2-has-been-released/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/4231953dc5a7ec7d7b5acb2444eeeeab?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">C# Disciple</media:title>
		</media:content>

		<media:content url="http://www.dotnetkicks.com/Services/Images/KickItImageGenerator.ashx?url=http%3a%2f%2fmarlongrech.wordpress.com%2f2008%2f03%2f02%2favaloncontrolslibrary-v2-has-been-released%2f" medium="image">
			<media:title type="html">kick it on DotNetKicks.com</media:title>
		</media:content>
	</item>
		<item>
		<title>WPF Date Time Picker</title>
		<link>http://marlongrech.wordpress.com/2008/02/06/wpf-date-time-picker/</link>
		<comments>http://marlongrech.wordpress.com/2008/02/06/wpf-date-time-picker/#comments</comments>
		<pubDate>Wed, 06 Feb 2008 20:30:50 +0000</pubDate>
		<dc:creator>marlongrech</dc:creator>
				<category><![CDATA[.Net 3.0]]></category>
		<category><![CDATA[.Net 3.5]]></category>
		<category><![CDATA[WPF]]></category>
		<category><![CDATA[WPF Custom Controls]]></category>

		<guid isPermaLink="false">http://marlongrech.wordpress.com/?p=103</guid>
		<description><![CDATA[[updated 09th Febuary 2008 - Bug fix for DateTimePicker]
After loads of requests for a DateTimePicker in AvalonControlLibrary I finally had sometime to build a DateTimePicker. DateTimePicker is nothing really special it is a DatePicker and a TimePicker combined in one control.
DateTimePicker  exposes an important property called DateTimeSelected. DateTimeSelected is a dependency property so that [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=marlongrech.wordpress.com&blog=783168&post=103&subd=marlongrech&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>[updated 09th Febuary 2008 - Bug fix for DateTimePicker]<br />
After loads of requests for a DateTimePicker in <a title="AvalonControlLibrary" href="http://www.codeplex.com/avaloncontrolslib" target="_blank">AvalonControlLibrary</a> I finally had sometime to build a DateTimePicker. DateTimePicker is nothing really special it is a <a title="DatePicker" href="http://marlongrech.wordpress.com/2007/09/11/wpf-datepicker/" target="_blank">DatePicker </a>and a <a title="TimePicker" href="http://marlongrech.wordpress.com/2007/11/18/time-picker/" target="_blank">TimePicker </a>combined in one control.</p>
<p>DateTimePicker  exposes an important property called DateTimeSelected. DateTimeSelected is a dependency property so that you can use it in data binding. DateTimePicker also exposes an event DateTimeSelectedChanged that is raised whenever the date/time is changed.</p>
<p>There are some other useful properties that you can set to layout this control</p>
<p>MinuteHand &#8211; This property takes a Brush and it is used to color the minute hand</p>
<p>HourHand &#8211; This property takes a Brush and it is used to color the hour hand</p>
<p>ClockBackground &#8211; This property takes a Brush and it is used as Background color for the clock</p>
<p>CalanderHeaderBackground &#8211;  This property takes a Brush and it is used as Background for the header of the calander</p>
<p>CalanderHeaderForeground &#8211;  This property takes a Brush and it is used as Foreground for the header text of the calander</p>
<p>This control also supports control templates. You MUST supply a DatePicker named PART_DatePicker and a TimePicker named as PART_TimePicker in order to create a ControlTemplate for this control.</p>
<p>This control will ship in v2 of AvalonControlLibrary. If you have any suggestions or find any bugs please let me know so that I can update it before I release AvalonControlLibrary v2.</p>
<p><a title="DateTimePicker" href="http://cid-96f8d49aa44c79c1.skydrive.live.com/self.aspx/Public/DatePickerRefactored.zip" target="_blank">Download Demo Project Here</a></p>
<p>Please note that a new version is available <a href="http://www.codeplex.com/avaloncontrolslib">here</a></p>
<p><a title="DateTimePicker" href="http://marlongrech.files.wordpress.com/2008/02/datetimepicker.jpg"><img src="http://marlongrech.files.wordpress.com/2008/02/datetimepicker.jpg" alt="DateTimePicker" /></a></p>
<p><a href="http://www.dotnetkicks.com/kick/?url=http%3a%2f%2fmarlongrech.wordpress.com%2f2008%2f02%2f06%2fwpf-date-time-picker%2f"><img src="http://www.dotnetkicks.com/Services/Images/KickItImageGenerator.ashx?url=http%3a%2f%2fmarlongrech.wordpress.com%2f2008%2f02%2f06%2fwpf-date-time-picker%2f" border="0" alt="kick it on DotNetKicks.com" /></a></p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/marlongrech.wordpress.com/103/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/marlongrech.wordpress.com/103/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/marlongrech.wordpress.com/103/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/marlongrech.wordpress.com/103/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/marlongrech.wordpress.com/103/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/marlongrech.wordpress.com/103/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/marlongrech.wordpress.com/103/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/marlongrech.wordpress.com/103/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/marlongrech.wordpress.com/103/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/marlongrech.wordpress.com/103/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/marlongrech.wordpress.com/103/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/marlongrech.wordpress.com/103/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=marlongrech.wordpress.com&blog=783168&post=103&subd=marlongrech&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://marlongrech.wordpress.com/2008/02/06/wpf-date-time-picker/feed/</wfw:commentRss>
		<slash:comments>49</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/4231953dc5a7ec7d7b5acb2444eeeeab?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">C# Disciple</media:title>
		</media:content>

		<media:content url="http://marlongrech.files.wordpress.com/2008/02/datetimepicker.jpg" medium="image">
			<media:title type="html">DateTimePicker</media:title>
		</media:content>

		<media:content url="http://www.dotnetkicks.com/Services/Images/KickItImageGenerator.ashx?url=http%3a%2f%2fmarlongrech.wordpress.com%2f2008%2f02%2f06%2fwpf-date-time-picker%2f" medium="image">
			<media:title type="html">kick it on DotNetKicks.com</media:title>
		</media:content>
	</item>
		<item>
		<title>Create Blend like UIs using DOCKY</title>
		<link>http://marlongrech.wordpress.com/2008/01/29/create-blend-like-uis-using-docky/</link>
		<comments>http://marlongrech.wordpress.com/2008/01/29/create-blend-like-uis-using-docky/#comments</comments>
		<pubDate>Tue, 29 Jan 2008 10:22:42 +0000</pubDate>
		<dc:creator>marlongrech</dc:creator>
				<category><![CDATA[.Net 3.0]]></category>
		<category><![CDATA[.Net 3.5]]></category>
		<category><![CDATA[WPF]]></category>
		<category><![CDATA[WPF Custom Controls]]></category>

		<guid isPermaLink="false">http://marlongrech.wordpress.com/?p=95</guid>
		<description><![CDATA[Docky is a new control for AvalonControlsLibrary. Docky is the codename for this control, the actual name for this control is DockableContainer. Basically Docky is a control that lets you add panels that can be dockable. By Dockable I mean that you can specify where the child panel (control) needs to be docked. If you [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=marlongrech.wordpress.com&blog=783168&post=95&subd=marlongrech&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Docky is a new control for AvalonControlsLibrary. Docky is the codename for this control, the actual name for this control is DockableContainer. Basically Docky is a control that lets you add panels that can be dockable. By Dockable I mean that you can specify where the child panel (control) needs to be docked. If you un dock one of the panels then the panel can be dragged any where on screen (within the working area)</p>
<p><a href="http://marlongrech.files.wordpress.com/2008/01/docky.jpg" title="Docky"><img src="http://marlongrech.files.wordpress.com/2008/01/docky.jpg" alt="Docky" /></a></p>
<p>Using Docky is very similar as using a dockpanel. Like a DockPanel, Docky has an attached property called Dock which you can use to specifiy where you want your panel to be docked. If you do not specify this property Docky will dock your control in the middle ( this is a behavior like Fill). An example for using the Dock property is</p>
<p><font color="#999999"> &lt; Grid local:DockableContianer.Dock=&#8221;Left&#8221; &#8230;&#8230;</font></p>
<p>Another important thing to know about Docky is how you can make your control be able to Dock and UnDock. Basically there is a command called ToggleDockChild that you can use to Dock and undock your control. This command needs a Parameter which is a reference to the control that is docked. So for example if the panel that is docked is a grid and inside it I have a button that dock and undocks the grid, I would have to pass the instance of the grid as parameter. Let me give an example</p>
<p><font color="#999999">&lt;Grid&gt;<br />
&lt;Button Command=&#8221;{local:DockableContainer.ToggleDockChild}&#8221; CommandParameter=&#8221;{Binding RealtiveSource={RelativeSource AncestorType={x;Type Grid}} }&#8221;/&gt;<br />
&lt;/Grid&gt; </font></p>
<p>The last thing that one has to do in order to use this control is set the ElementForDragging attached property. This property is used to let the DockableContainer know which control will be used to drag the panel when it is UnDocked. The value of this property should be set as the Panel to drag. You can put this property in any child element of the element being docked because the Docky will analyze the ViusalTree of children of the docked element and check which child has this property set. This is a useful feature for when you need to be able to drag the panel from the Middle part or bottom etc&#8230; Again I will give an example</p>
<p><font color="#999999">&lt;Grid&gt;<br />
&lt;Button Command=&#8221;{local:DockableContainer.ToggleDockChild}&#8221; CommandParameter=&#8221;{Binding RealtiveSource={RelativeSource AncestorType={x;Type Grid}} }&#8221;/&gt;</font></p>
<p><font color="#999999"> &lt;Border local:DockableContainer.ElementForDragging=&#8221;</font><font color="#999999">{Binding RealtiveSource={RelativeSource AncestorType={x;Type Grid}} }</font><font color="#999999">&#8220;/&gt;<br />
&lt;/Grid&gt; </font></p>
<p>So here what we are saying is that the surface where the user can grab to drag the panel is the Border.</p>
<p>Ok so there is some work to do in order to use this control, so I decided to create a control that handles all this stuff for you. The control is called DockableControl and it inherites from HeaderedContentControl. This control handles all attached properties and commands for the DockableContainer so all you have to do, is to feed the Header and the Content and all the other stuff is catered for.</p>
<p>I created a Demo Project for this control so that you do not need to download AvalonControlsLibrary (well in actual fact I didn&#8217;t commit the changes to codeplex yet since I am still doing some refactoring <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  ). Download the code for this control and see how it works to get a better idea of how one can use this control&#8230;..</p>
<p>If you have any problems, questions or bugs feel free to send me an email at marlongrech@gmail.com or post a comment to this post <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Hope you like it &#8230;</p>
<p><a href="http://cid-96f8d49aa44c79c1.skydrive.live.com/self.aspx/Public/Docky.zip" title="Docky sample" target="_blank">DOWNLOAD DEMO PROJECT</a></p>
<p>Regards</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/marlongrech.wordpress.com/95/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/marlongrech.wordpress.com/95/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/marlongrech.wordpress.com/95/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/marlongrech.wordpress.com/95/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/marlongrech.wordpress.com/95/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/marlongrech.wordpress.com/95/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/marlongrech.wordpress.com/95/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/marlongrech.wordpress.com/95/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/marlongrech.wordpress.com/95/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/marlongrech.wordpress.com/95/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/marlongrech.wordpress.com/95/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/marlongrech.wordpress.com/95/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=marlongrech.wordpress.com&blog=783168&post=95&subd=marlongrech&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://marlongrech.wordpress.com/2008/01/29/create-blend-like-uis-using-docky/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/4231953dc5a7ec7d7b5acb2444eeeeab?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">C# Disciple</media:title>
		</media:content>

		<media:content url="http://marlongrech.files.wordpress.com/2008/01/docky.jpg" medium="image">
			<media:title type="html">Docky</media:title>
		</media:content>
	</item>
		<item>
		<title>Jasema &#8211; The XAMLPadX plugin for building Path Geometry</title>
		<link>http://marlongrech.wordpress.com/2008/01/10/jasema-the-xamlpadx-plugin-for-building-path-geometry/</link>
		<comments>http://marlongrech.wordpress.com/2008/01/10/jasema-the-xamlpadx-plugin-for-building-path-geometry/#comments</comments>
		<pubDate>Thu, 10 Jan 2008 20:02:06 +0000</pubDate>
		<dc:creator>marlongrech</dc:creator>
				<category><![CDATA[.Net 3.5]]></category>
		<category><![CDATA[WPF]]></category>
		<category><![CDATA[WPF Custom Controls]]></category>
		<category><![CDATA[wpf tools]]></category>

		<guid isPermaLink="false">http://marlongrech.wordpress.com/2008/01/10/jasema-the-xamlpadx-plugin-for-building-path-geometry/</guid>
		<description><![CDATA[[Jasema v2 has been released] 
XAMLPadX v3 is out ! I love XAMLPadX, for me it is one of the best tools to have when developing WPF applications. One of the best features of XAMLPadX v3 is that you can build your own plugins&#8230; cool !! So basically we can be part of it!
Lately I [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=marlongrech.wordpress.com&blog=783168&post=88&subd=marlongrech&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p><a href="http://marlongrech.wordpress.com/jasema/">[Jasema v2 has been released] </a></p>
<p><a href="http://blogs.msdn.com/llobo/archive/2007/12/19/xamlpadx-v3-0.aspx" target="_blank">XAMLPadX v3 is out !</a> I love XAMLPadX, for me it is one of the best tools to have when developing WPF applications. One of the best features of XAMLPadX v3 is that you can build your own plugins&#8230; cool !! So basically we can be part of it!</p>
<p>Lately I was creating some simple paths yet it took me ages to build them because I was building them manually by hand. While creating the geometry for these paths I noticed that creating a tool to build these paths would be very easy&#8230; All you have to do is record where the mouse pointer is and put it in the Data property of the Path (<a href="http://msdn2.microsoft.com/en-us/library/ms752293(VS.85).aspx" target="_blank">for more info on how to build path geometry click here</a>).  So I decided to build a tool that I can use to build these Paths more efficiently&#8230;</p>
<p><a href="http://marlongrech.files.wordpress.com/2008/01/jasema.jpg" title="jasema.jpg"><img src="http://marlongrech.files.wordpress.com/2008/01/jasema.jpg" alt="jasema.jpg" /></a></p>
<p>The tool can be integrated as a XAMLPadX plugin and also run as a standalone application. Jasema is very simplistic and only caters for straight line paths (it is only v1, I am just testing the idea) yet in the near future I will add more functionality for it in order to support much more complex Paths.</p>
<p>You can generate paths by click on the drawing surface provided in the tool. When a point is created the point is shown as a small dot. If you click on the dot that point will be removed from the path geometry. Another interesting and helpful feature in Jasema is the Layout Grid. The layout grid is a simple grid that is drawn on the background of the drawing surface so that you have more guidance while painting the path that you want. You can also make the grid larger or small as you prefer by using the slider menu that is provided in the tool bar.</p>
<p><b>Why did I call this tool Jasema?</b></p>
<p>well &#8220;Jas&#8221; are the first 3 letters of my daughter&#8217;s name &#8211; Jasmine<br />
&#8220;Ema&#8221; is the name of my wife&#8230;.<br />
concatenate them &#8230;. string toolName = &#8220;Jas&#8221;+&#8221;ema&#8221;;<br />
There you have it &#8220;Jasema&#8221;  <b></b></p>
<p><b>To install this tool as a XAMLPadX plugin you will need to </b></p>
<p>First of all <a href="http://blogs.msdn.com/llobo/archive/2007/12/19/xamlpadx-v3-0.aspx" target="_blank">install XAMLPadX v3</a><br />
- Create a folder called &#8220;Jasema&#8221; under &#8220;C:\Program Files\XamlPadX\Addins&#8221; (assuming that XAMLPadX v3 is installed in that directory)<br />
- Copy the Jasema.dll and paste it in the folder that you have just created<br />
- Thats&#8217;s it ! Now when you open XAMLPadX and click on Plugins &gt;&gt; More Plugins, Jasema will appear in the list and you can select it&#8230;</p>
<p>To run Jasema as a standalone application you can do so, by starting up the JasemaApp.exe&#8230;</p>
<p>Again I want to point out that this is just the start&#8230;. I have loads of ideas on how to improve this tool such as supporting more complex paths etc&#8230; I am waiting to see the feedback on this tool because at the end of the day it is just an idea, now it is up to us to expand this idea into a handy tool <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>PLEASE SEND FEEDBACK&#8230;.</p>
<p><a href="http://www.snapdrive.net/files/496756/Jasema/JasemaSources.rar">Download Full Source Code</a><br />
<a href="http://www.snapdrive.net/files/496756/Jasema/Jasema-dlls.rar">Download DLL and Executable</a></p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/marlongrech.wordpress.com/88/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/marlongrech.wordpress.com/88/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/marlongrech.wordpress.com/88/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/marlongrech.wordpress.com/88/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/marlongrech.wordpress.com/88/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/marlongrech.wordpress.com/88/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/marlongrech.wordpress.com/88/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/marlongrech.wordpress.com/88/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/marlongrech.wordpress.com/88/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/marlongrech.wordpress.com/88/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/marlongrech.wordpress.com/88/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/marlongrech.wordpress.com/88/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=marlongrech.wordpress.com&blog=783168&post=88&subd=marlongrech&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://marlongrech.wordpress.com/2008/01/10/jasema-the-xamlpadx-plugin-for-building-path-geometry/feed/</wfw:commentRss>
		<slash:comments>16</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/4231953dc5a7ec7d7b5acb2444eeeeab?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">C# Disciple</media:title>
		</media:content>

		<media:content url="http://marlongrech.files.wordpress.com/2008/01/jasema.jpg" medium="image">
			<media:title type="html">jasema.jpg</media:title>
		</media:content>
	</item>
		<item>
		<title>Avalon Controls Library on CodePlex</title>
		<link>http://marlongrech.wordpress.com/2008/01/03/avalon-controls-library-on-codeplex/</link>
		<comments>http://marlongrech.wordpress.com/2008/01/03/avalon-controls-library-on-codeplex/#comments</comments>
		<pubDate>Thu, 03 Jan 2008 18:41:37 +0000</pubDate>
		<dc:creator>marlongrech</dc:creator>
				<category><![CDATA[.Net 3.0]]></category>
		<category><![CDATA[.Net 3.5]]></category>
		<category><![CDATA[WPF]]></category>
		<category><![CDATA[WPF Custom Controls]]></category>

		<guid isPermaLink="false">http://marlongrech.wordpress.com/2008/01/03/avalon-controls-library-on-codeplex/</guid>
		<description><![CDATA[Hi all,
I am pleased to announce that the AvalonControlsLibrary  has been uploaded on CodePlex. I am looking forward to see this project evolve more and more in the near future.
Looking forward to see more suggestions for this library so that together we can make this library grow &#8230;.
Visit the CodePlex homw page here 
Thanks for all [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=marlongrech.wordpress.com&blog=783168&post=79&subd=marlongrech&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Hi all,</p>
<p>I am pleased to announce that the AvalonControlsLibrary  has been uploaded on CodePlex. I am looking forward to see this project evolve more and more in the near future.</p>
<p>Looking forward to see more suggestions for this library so that together we can make this library grow &#8230;.</p>
<p><a href="http://www.codeplex.com/AvalonControlsLib">Visit the CodePlex homw page here </a></p>
<p>Thanks for all the help and support</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/marlongrech.wordpress.com/79/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/marlongrech.wordpress.com/79/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/marlongrech.wordpress.com/79/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/marlongrech.wordpress.com/79/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/marlongrech.wordpress.com/79/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/marlongrech.wordpress.com/79/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/marlongrech.wordpress.com/79/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/marlongrech.wordpress.com/79/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/marlongrech.wordpress.com/79/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/marlongrech.wordpress.com/79/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/marlongrech.wordpress.com/79/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/marlongrech.wordpress.com/79/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=marlongrech.wordpress.com&blog=783168&post=79&subd=marlongrech&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://marlongrech.wordpress.com/2008/01/03/avalon-controls-library-on-codeplex/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/4231953dc5a7ec7d7b5acb2444eeeeab?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">C# Disciple</media:title>
		</media:content>
	</item>
		<item>
		<title>Rating Selector</title>
		<link>http://marlongrech.wordpress.com/2007/12/17/rating-selector/</link>
		<comments>http://marlongrech.wordpress.com/2007/12/17/rating-selector/#comments</comments>
		<pubDate>Mon, 17 Dec 2007 22:04:46 +0000</pubDate>
		<dc:creator>marlongrech</dc:creator>
				<category><![CDATA[.Net 3.0]]></category>
		<category><![CDATA[WPF]]></category>
		<category><![CDATA[WPF Custom Controls]]></category>

		<guid isPermaLink="false">http://marlongrech.wordpress.com/2007/12/17/rating-selector/</guid>
		<description><![CDATA[Hello &#8230;
It&#8217;s been a while now since my last update on the blog. Currently I have been really busy, work family&#8230; You know the so called life&#8230;  
Some friends from Alambic asked me if I can create a Rating control for the AvalonControlsLibrary. A request for a control is always exciting for myself&#8230; So [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=marlongrech.wordpress.com&blog=783168&post=42&subd=marlongrech&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Hello &#8230;</p>
<p>It&#8217;s been a while now since my last update on the blog. Currently I have been really busy, work family&#8230; You know the so called life&#8230; <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Some friends from <a href="http://alambic.eclyps.info/">Alambic</a> asked me if I can create a Rating control for the AvalonControlsLibrary. A request for a control is always exciting for myself&#8230; So here it is a brand new control that you can go ahead and use&#8230;</p>
<p>The contol is very simple, you specify a <strong>MinRating</strong> (by default 0) and a <strong>MaxRating</strong>(by default 5) and the control will go ahead and create a list of Stars(this is the default look of the control, you can change this with a control template). The user can then click on one of the Rate Items(the star) and select a Rating. The Rating selected can be read from a property <strong>RatingSelected</strong>. The RatingSelected is a dependency property so you can bind to it and get notified when the value changes. I also added the <strong>IsReadOnly </strong>property so that you can specify that the control is readonly and the user cannot change the control. There are also 2 other important properties <strong>RateItemColor</strong> and <strong>RateItemHoverColor. </strong>By setting these properties you can change the color for the rate items (the stars by default)</p>
<p>Now lets dig into the implementation of the control&#8230; Believe it or not this contol is just an ItemsControl&#8230;  You don&#8217;t beleive me? check <a href="http://www.drwpf.com/blog/Home/tabid/36/EntryID/15/Default.aspx">this link</a> to see even crazier ItemsControl. Basically I create a list of RatingSelectorItems ranging from the MinRating to the MaxRating and add them in the ItemsSource of the control. The RatingSelectorItem has a RateValue property that is the Rate that the item represents. The RatingSelectorItem also has a IsSelected property that is set to true when the user selects a rating that is bigger or equal to the rate of the item.</p>
<p>The Rate selected is triggered via a Command (<a href="http://marlongrech.wordpress.com/2007/11/11/wpf-commands/">more details on command found here</a>) called SelectRating. This command also has a constraint so that it can be executed only if the IsReadOnly property of the RatingSelector is false.</p>
<p>The demo for the control contains different control templates for the control. It shows how you can show different objects for the Rate Items and aslo how to change the orientation of the control (which comes for free since the control is an ItemsControl)</p>
<p>Go Ahead, download the control and send me feedback&#8230; Any bugs or problems, feel free to send me and email&#8230;</p>
<p><a href="http://marlongrech.files.wordpress.com/2007/12/rating.jpg" title="Rating Control"><img src="http://marlongrech.files.wordpress.com/2007/12/rating.thumbnail.jpg" alt="Rating Control" /></a></p>
<p><a href="http://marlongrech.wordpress.com/presentations/">Download Source Code and Demo</a></p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/marlongrech.wordpress.com/42/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/marlongrech.wordpress.com/42/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/marlongrech.wordpress.com/42/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/marlongrech.wordpress.com/42/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/marlongrech.wordpress.com/42/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/marlongrech.wordpress.com/42/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/marlongrech.wordpress.com/42/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/marlongrech.wordpress.com/42/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/marlongrech.wordpress.com/42/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/marlongrech.wordpress.com/42/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/marlongrech.wordpress.com/42/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/marlongrech.wordpress.com/42/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=marlongrech.wordpress.com&blog=783168&post=42&subd=marlongrech&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://marlongrech.wordpress.com/2007/12/17/rating-selector/feed/</wfw:commentRss>
		<slash:comments>17</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/4231953dc5a7ec7d7b5acb2444eeeeab?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">C# Disciple</media:title>
		</media:content>

		<media:content url="http://marlongrech.files.wordpress.com/2007/12/rating.thumbnail.jpg" medium="image">
			<media:title type="html">Rating Control</media:title>
		</media:content>
	</item>
	</channel>
</rss>