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

<channel>
	<title>tewari &#187; xaml</title>
	<atom:link href="http://www.tewari.info/category/xaml/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.tewari.info</link>
	<description>Professional Software Development by Ash Tewari</description>
	<lastBuildDate>Thu, 03 Jun 2010 01:52:16 +0000</lastBuildDate>
	
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Win Advanced MVVM Book</title>
		<link>http://www.tewari.info/2010/05/09/win-advanced-mvvm-book/</link>
		<comments>http://www.tewari.info/2010/05/09/win-advanced-mvvm-book/#comments</comments>
		<pubDate>Mon, 10 May 2010 03:33:06 +0000</pubDate>
		<dc:creator>tewari</dc:creator>
				<category><![CDATA[C#]]></category>
		<category><![CDATA[WPF]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[xaml]]></category>
		<category><![CDATA[CodeCamp]]></category>
		<category><![CDATA[mvvm]]></category>
		<category><![CDATA[speaking]]></category>

		<guid isPermaLink="false">http://www.tewari.info/?p=200</guid>
		<description><![CDATA[	I am presenting a session on Building WPF Application using MVVM (Model-View-ViewModel) on May 15th at the Carolina Code Camp 2010.
	I will dissect a Sample WPF MVVM application and then highlight the most important aspects of the MVVM by coding a brand new ViewModel and incorporating it into the application. You will learn about the [...]]]></description>
			<content:encoded><![CDATA[	<p><a href="../library/josh-smith/advanced-mvvm/"><img class="alignleft" title="Advanced MVVM Cover" src="http://www.tewari.info/wp-content/advancedmvvmcover.jpg" alt="Advanced MVVM Cover" width="246" height="320" /></a>I am presenting a session on Building WPF Application using MVVM (<a title="Wikipedia-MVVM" href="http://en.wikipedia.org/wiki/Model_View_ViewModel">Model-View-ViewModel</a>) on May 15th at the <a title="Carolina Code Camp 2010" href="http://codecamp.developersguild.org/">Carolina Code Camp</a> 2010.</p>
	<p>I will dissect a Sample WPF MVVM application and then highlight the most important aspects of the MVVM by coding a brand new ViewModel and incorporating it into the application. You will learn about the Roles of the MVVM triad, the advantages of using MVVM and Characteristics of the ViewModel.</p>
	<p>Attendees will be eligible to win <del datetime="2010-06-02T01:39:18+00:00">two copies</del> one copy (see below) of <a title="Josh Smith" href="http://joshsmithonwpf.wordpress.com/">Josh Smith&#8217;s</a> <a title="advanced-mvvm-book" href="http://joshsmithonwpf.wordpress.com/advanced-mvvm/">Advanced MVVM book</a> as well as a few other WPF Books.</p>
	<p><em>{ I will be giving away one hard copy version of the book instead of digital versions due to concerns about DRM protection and unclear gift guidelines at lulu.com }</em>.</p>
	<p>And the winner is &#8230; Mark Freeman !!! Congratulations Mark, your copy of &#8220;Advanced MVVM&#8221; is on its way. Thanks for attending the code camp and your feedback.<br />
<hr/>Copyright &copy; 2010 <strong><a href="http://www.tewari.info">tewari</a></strong>. This Feed is for personal non-commercial use only. If you are not reading this material in your news aggregator, the site you are looking at is guilty of copyright infringement. Please contact legal@tewari.info so we can take legal action immediately.<br/><span style="float: right;font-size: 7pt"><a href="http://blog.taragana.com/index.php/archive/wordpress-plugins-provided-by-taraganacom/">Plugin</a> by <a href="http://www.taragana.com/">Taragana</a></span>
</p>
<p class="akst_link"><a href="http://www.tewari.info/?p=200&amp;akst_action=share-this"  title="E-mail this, post to del.icio.us, etc." id="akst_link_200" class="akst_share_link" rel="nofollow">Share This</a>
</p>]]></content:encoded>
			<wfw:commentRss>http://www.tewari.info/2010/05/09/win-advanced-mvvm-book/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using Model-View-ViewModel in WPF Applications</title>
		<link>http://www.tewari.info/2010/01/25/using-model-view-viewmodel-in-wpf-applications/</link>
		<comments>http://www.tewari.info/2010/01/25/using-model-view-viewmodel-in-wpf-applications/#comments</comments>
		<pubDate>Mon, 25 Jan 2010 22:23:39 +0000</pubDate>
		<dc:creator>tewari</dc:creator>
				<category><![CDATA[C#]]></category>
		<category><![CDATA[WPF]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[xaml]]></category>
		<category><![CDATA[design pattern]]></category>
		<category><![CDATA[mvvm]]></category>
		<category><![CDATA[presentation]]></category>
		<category><![CDATA[socalcodecamp]]></category>

		<guid isPermaLink="false">http://www.tewari.info/?p=155</guid>
		<description><![CDATA[	I am presenting at SoCalCodeCamp this weekend (January 30th, 2010) - Advanced WPF &#8211; Using Model-View-ViewModel in WPF Applications.
	Agenda :
	1. Roles of the M-V-VM triad
	2. Why use M-V-VM ?
	3. Characteristics of the ViewModel
	4. Build a Sample WPF Application using M-V-VM
	
	Resources :
	
	MSDN Magazine Article and Sample Application Download
	Martin Fowler’s  description of the ‘Presentation Model ‘
	Jeremy [...]]]></description>
			<content:encoded><![CDATA[	<div class="mceTemp">I am presenting at <a title="socalcodecamp website" href="http://www.socalcodecamp.com/" target="_self">SoCalCodeCamp</a> this weekend (January 30th, 2010) -<a title="WPF MVVM Presntation " href="http://www.socalcodecamp.com/socalcodecamp/session.aspx?sid=0b2ee44f-595d-4f55-a5d6-2b1293f546d0" target="_self"> Advanced WPF &#8211; Using Model-View-ViewModel in WPF Applications</a>.</div>
	<p><div id="attachment_156" class="wp-caption alignnone" style="width: 460px"><img class="size-full wp-image-156" title="Sample WPF App - TaskList" src="http://www.tewari.info/wp-content/tasklist.png" alt="tasklist-mockup" width="450" height="256" /><p class="wp-caption-text">tasklist-mockup</p></div></p>
	<p>Agenda :</p>
	<div>1. Roles of the M-V-VM triad</div>
	<div>2. Why use M-V-VM ?</div>
	<div>3. Characteristics of the ViewModel</div>
	<div>4. Build a Sample WPF Application using M-V-VM</div>
	<p></br></br></p>
	<p>Resources :</p>
	<ol>
	<li><a title="MSDN Magazine Article" href="http://msdn.microsoft.com/en-us/magazine/dd419663.aspx">MSDN Magazine Article</a> and Sample Application <a title="Download Demo Application Code" href="http://code.msdn.microsoft.com/mag200902MVVM/Release/ProjectReleases.aspx">Download</a></li>
	<li><a title="MartinFowler.com" href="http://martinfowler.com/eaaDev/PresentationModel.html">Martin Fowler’s  description of the ‘Presentation Model ‘</a></li>
	<li><a title="Jeremy Miller's - Build Your CAB" href="http://codebetter.com/blogs/jeremy.miller/archive/2007/07/25/the-build-your-own-cab-series-table-of-contents.aspx">Jeremy Miller’s ‘Build Your Own CAB’ series</a></li>
	</ol>
<hr/>Copyright &copy; 2010 <strong><a href="http://www.tewari.info">tewari</a></strong>. This Feed is for personal non-commercial use only. If you are not reading this material in your news aggregator, the site you are looking at is guilty of copyright infringement. Please contact legal@tewari.info so we can take legal action immediately.<br/><span style="float: right;font-size: 7pt"><a href="http://blog.taragana.com/index.php/archive/wordpress-plugins-provided-by-taraganacom/">Plugin</a> by <a href="http://www.taragana.com/">Taragana</a></span>
</p>
<p class="akst_link"><a href="http://www.tewari.info/?p=155&amp;akst_action=share-this"  title="E-mail this, post to del.icio.us, etc." id="akst_link_155" class="akst_share_link" rel="nofollow">Share This</a>
</p>]]></content:encoded>
			<wfw:commentRss>http://www.tewari.info/2010/01/25/using-model-view-viewmodel-in-wpf-applications/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Dial Gauge is a ProgressBar</title>
		<link>http://www.tewari.info/2008/06/10/dial-gauge-is-a-progressbar/</link>
		<comments>http://www.tewari.info/2008/06/10/dial-gauge-is-a-progressbar/#comments</comments>
		<pubDate>Wed, 11 Jun 2008 06:49:43 +0000</pubDate>
		<dc:creator>tewari</dc:creator>
				<category><![CDATA[C#]]></category>
		<category><![CDATA[WPF]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[xaml]]></category>
		<category><![CDATA[.NET]]></category>
		<category><![CDATA[Dial]]></category>
		<category><![CDATA[Gauge]]></category>
		<category><![CDATA[ProgressBar]]></category>

		<guid isPermaLink="false">http://www.tewari.info/2008/06/10/dial-gauge-is-a-progressbar/</guid>
		<description><![CDATA[	I am not just being philosophical here. In WPF, ControlTemplates allow you to transform a control&#8217;s appearance. This is not the same as applying stylesheets. This is an entirely new level of customization. What you see in the screenshot below looks like a Dial but is actually a simple  ProgressBar control wearing a &#8220;Dial&#8221; [...]]]></description>
			<content:encoded><![CDATA[	<p>I am not just being philosophical here. In <a href="http://msdn.microsoft.com/en-us/netframework/aa663326.aspx" title="MSDN-WPF" target="_blank">WPF</a>, <a href="http://msdn.microsoft.com/en-us/magazine/cc163497.aspx" title="Using Templates to Customize WPF Controls" target="_blank">ControlTemplates </a>allow you to transform a control&#8217;s appearance. This is not the same as applying stylesheets. This is an entirely new level of customization. What you see in the screenshot below looks like a Dial but is actually a simple  ProgressBar control wearing a &#8220;Dial&#8221; template. The Dial template was created using <a href="http://www.microsoft.com/expression/products/Overview.aspx?key=blend" title="Microsoft-Expression-Blend" target="_blank">Microsoft Expression Blend</a> .</p>
	<p><img src="http://www.tewari.info/images/dial-is-a-progressbar.PNG" alt="dial-is-a-progressbar.PNG" height="483" width="566" /></p>
	<p>Include the ControlTemplate as a Window.Resource and then assign it to ProgressBar element&#8217;s Template attribute :</p>
	<pre name="code" class="xml">
        <ProgressBar x:Name=\"pBar\" Template=\"{StaticResource templateDial}\"
                     Minimum=\"0\" Maximum=\"270\" Margin=\"0\" />
</pre>
	<p>Of course that is not all. The ControlTemplate must define some named elements of  FrameworkElement type. Charles Petzold has explained it in detail : <a href="http://msdn.microsoft.com/en-us/magazine/cc163497.aspx" title="Charles-Petzold-Using Templates to Customize WPF Controls" target="_blank">MSDN Magazine Article</a>. So, I will not repeat it here.</p>
	<p>The sample code can be downloaded here : <a href="http://www.tewari.info/downloads/DialTest.zip" title="DialTest.zip" target="_blank">DialTest.zip</a><br />
License : <a href="http://creativecommons.org/licenses/by-nc-sa/3.0/us/" rel="license">Creative Commons Attribution-Noncommercial-Share Alike 3.0 United States License.</a><hr/>Copyright &copy; 2010 <strong><a href="http://www.tewari.info">tewari</a></strong>. This Feed is for personal non-commercial use only. If you are not reading this material in your news aggregator, the site you are looking at is guilty of copyright infringement. Please contact legal@tewari.info so we can take legal action immediately.<br/><span style="float: right;font-size: 7pt"><a href="http://blog.taragana.com/index.php/archive/wordpress-plugins-provided-by-taraganacom/">Plugin</a> by <a href="http://www.taragana.com/">Taragana</a></span>
</p>
<p class="akst_link"><a href="http://www.tewari.info/?p=38&amp;akst_action=share-this"  title="E-mail this, post to del.icio.us, etc." id="akst_link_38" class="akst_share_link" rel="nofollow">Share This</a>
</p>]]></content:encoded>
			<wfw:commentRss>http://www.tewari.info/2008/06/10/dial-gauge-is-a-progressbar/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using Custom Converter in XAML</title>
		<link>http://www.tewari.info/2008/04/15/using-custom-converter-in-xaml/</link>
		<comments>http://www.tewari.info/2008/04/15/using-custom-converter-in-xaml/#comments</comments>
		<pubDate>Wed, 16 Apr 2008 05:22:12 +0000</pubDate>
		<dc:creator>tewari</dc:creator>
				<category><![CDATA[C#]]></category>
		<category><![CDATA[WPF]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[xaml]]></category>
		<category><![CDATA[Binding]]></category>
		<category><![CDATA[ImageDataConverter]]></category>
		<category><![CDATA[ListView]]></category>

		<guid isPermaLink="false">http://www.tewari.info/2008/04/15/using-custom-converter-in-xaml/</guid>
		<description><![CDATA[	In my previous post : WPF-LINQ To SQL Sample, I had to resort to modifying .dbml file to get the images stored as varbinary into the WPF ListView control. I had to change the Type of image fields to System.Byte[], instead of using System.Data.Linq.Binary. A better way to do this is to use a custom [...]]]></description>
			<content:encoded><![CDATA[	<p>In my previous post : <a href="http://www.tewari.info/2008/03/07/wpf-linq-to-sql-sample/" title="wpf-linq-to-sql-sample" target="_blank">WPF-LINQ To SQL Sample</a>, I had to resort to modifying .dbml file to get the images stored as varbinary into the WPF ListView control. I had to change the Type of image fields to System.Byte[], instead of using System.Data.Linq.Binary. A better way to do this is to use a custom converter. WPF allows you    to specify custom converter as part of the Binding in .xaml, like this -</p>
	<pre name="code" class="xml">
&lt;Image Grid.Row=\"2\"
Source=\"{Binding Path=ThumbNailPhoto ,
Converter={StaticResource imageConverter}}\"&gt;&lt;/Image&gt;</pre>
	<p>The custom converter is declared in the same .xaml file as a resource -</p>
	<pre name="code" class="xml">
&lt;Window.Resources&gt;
&lt;local:ImageDataConverter x:Key=\"imageConverter\" /&gt;
&lt;/Window.Resources&gt;</pre>
	<p>ImageDataConverter is implemented in .xaml.cs file -</p>
	<pre name="code" class="csharp">
public class ImageDataConverter : IValueConverter
{
   public object Convert(object value, Type targetType, object parameter,
   System.Globalization.CultureInfo culture)
   {
      byte[] image = ((System.Data.Linq.Binary)value).ToArray();
      return image;
   }
	
   public object ConvertBack(object value, Type targetType, object parameter,
   System.Globalization.CultureInfo culture)
   {
      throw new NotSupportedException();
   }
}</pre>
	<p>The updated sample code can be downloaded here : <a href="http://www.tewari.info/downloads/Linq2SqlSample2.zip" title="Linq2SqlSample2.zip" target="_blank">WPF-LINQ to SQL Sample</a><br />
License : <a href="http://creativecommons.org/licenses/by-nc-sa/3.0/us/" rel="license">Creative Commons Attribution-Noncommercial-Share Alike 3.0 United States License.</a><hr/>Copyright &copy; 2010 <strong><a href="http://www.tewari.info">tewari</a></strong>. This Feed is for personal non-commercial use only. If you are not reading this material in your news aggregator, the site you are looking at is guilty of copyright infringement. Please contact legal@tewari.info so we can take legal action immediately.<br/><span style="float: right;font-size: 7pt"><a href="http://blog.taragana.com/index.php/archive/wordpress-plugins-provided-by-taraganacom/">Plugin</a> by <a href="http://www.taragana.com/">Taragana</a></span>
</p>
<p class="akst_link"><a href="http://www.tewari.info/?p=34&amp;akst_action=share-this"  title="E-mail this, post to del.icio.us, etc." id="akst_link_34" class="akst_share_link" rel="nofollow">Share This</a>
</p>]]></content:encoded>
			<wfw:commentRss>http://www.tewari.info/2008/04/15/using-custom-converter-in-xaml/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
