<?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>Elegant Code &#187; xaml</title>
	<atom:link href="http://elegantcode.com/tag/xaml/feed/" rel="self" type="application/rss+xml" />
	<link>http://elegantcode.com</link>
	<description></description>
	<lastBuildDate>Fri, 03 Sep 2010 01:57:09 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Visual Studio: Open in Full XAML View by Default</title>
		<link>http://elegantcode.com/2010/04/01/visual-studio-open-in-full-xaml-view-by-default/</link>
		<comments>http://elegantcode.com/2010/04/01/visual-studio-open-in-full-xaml-view-by-default/#comments</comments>
		<pubDate>Thu, 01 Apr 2010 15:49:14 +0000</pubDate>
		<dc:creator>Brian Lagunas</dc:creator>
				<category><![CDATA[Silverlight]]></category>
		<category><![CDATA[Visual Studio]]></category>
		<category><![CDATA[WPF]]></category>
		<category><![CDATA[xaml]]></category>

		<guid isPermaLink="false">http://elegantcode.com/2010/04/01/visual-studio-open-in-full-xaml-view-by-default/</guid>
		<description><![CDATA[So I am using Visual Studio 2008 for developing WPF and Silverlight applications.&#160; The one thing that really annoys me is when I open a .XAML file and then Visual Studio automatically opens the file in split view mode.&#160; I am sure you are well aware of how VS 2008 support for the preview pane [...]]]></description>
			<content:encoded><![CDATA[<p>So I am using Visual Studio 2008 for developing WPF and Silverlight applications.&#160; The one thing that really annoys me is when I open a .XAML file and then Visual Studio automatically opens the file in split view mode.&#160; I am sure you are well aware of how VS 2008 support for the preview pane blows.&#160; So now I have to sit and wait for VS to render my view in the preview pane, and sometimes it can take a while, if it doesn’t just completely crash.&#160; Sometimes I take the extra time to go grab a snack and beverage of my choice.&#160; </p>
<p>So here is a hidden performance increasing jewel you might find useful.&#160; We can set the default open mode to be in full XAML view.</p>
<p>First thing you need to do is in Visual Studio go to your Tools ==&gt; Options ==&gt; Text Editor ==&gt; XAML ==&gt; Miscellaneous.&#160; There you will see an option for “Always open documents in full XAML view”.&#160; Check that box.</p>
<p><a href="http://elegantcode.com/wp-content/uploads/2010/04/image.png" target="_blank"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="xaml options for opening in full xaml view" border="0" alt="xaml options for opening in full xaml view" src="http://elegantcode.com/wp-content/uploads/2010/04/image_thumb.png" width="244" height="146" /></a> </p>
<p>Now every time you open a XAML file it will open in full XAML view and give you one less thing to gripe about.</p>
]]></content:encoded>
			<wfw:commentRss>http://elegantcode.com/2010/04/01/visual-studio-open-in-full-xaml-view-by-default/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>A Simple WPF Loading Animation</title>
		<link>http://elegantcode.com/2009/08/21/a-simple-wpf-loading-animation/</link>
		<comments>http://elegantcode.com/2009/08/21/a-simple-wpf-loading-animation/#comments</comments>
		<pubDate>Sat, 22 Aug 2009 03:47:21 +0000</pubDate>
		<dc:creator>Brian Lagunas</dc:creator>
				<category><![CDATA[WPF]]></category>
		<category><![CDATA[animation]]></category>
		<category><![CDATA[xaml]]></category>

		<guid isPermaLink="false">http://elegantcode.com/2009/08/21/a-simple-wpf-loading-animation/</guid>
		<description><![CDATA[Okay, so I needed a very simple and clean loading animation for a multi threaded application I was working on to notify the user that something was in the process of being loaded.&#160; So of course the first place I looked was Google, because I figured someone else has already written one and I could [...]]]></description>
			<content:encoded><![CDATA[<p>Okay, so I needed a very simple and clean loading animation for a multi threaded application I was working on to notify the user that something was in the process of being loaded.&#160; So of course the first place I looked was Google, because I figured someone else has already written one and I could save myself some time by just using theirs.&#160; Well, after almost an hour searching, I found nothing.&#160; So much for being a timesaver.&#160; Now, don’t get me wrong, I found a couple of WPF animations out there, but none of them really fit what I needed.&#160; So I just decided to bite the bullet and create my own.&#160; After creating the animation I decided to share the fruits of my labor so that anyone else who is looking for the same thing I was, or something similar, wouldn’t have as much trouble as I did.</p>
<p>Here is what it looks like.</p>
<p><a href="http://elegantcode.com/wp-content/uploads/2009/08/loadingAnimation.jpg"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="loadingAnimation" border="0" alt="loadingAnimation" src="http://elegantcode.com/wp-content/uploads/2009/08/loadingAnimation_thumb.jpg" width="114" height="114" /></a> </p>
<p>Here is the source: <a href="http://brianlagunas.com/downloads/source/LoadingControl.zip">Download the Loading Animation Source</a></p>
<p>I hope it is useful to someone besides me.</p>
]]></content:encoded>
			<wfw:commentRss>http://elegantcode.com/2009/08/21/a-simple-wpf-loading-animation/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Debugging XAML</title>
		<link>http://elegantcode.com/2009/04/14/debugging-xaml/</link>
		<comments>http://elegantcode.com/2009/04/14/debugging-xaml/#comments</comments>
		<pubDate>Wed, 15 Apr 2009 01:43:01 +0000</pubDate>
		<dc:creator>Brian Lagunas</dc:creator>
				<category><![CDATA[WPF]]></category>
		<category><![CDATA[debugging]]></category>
		<category><![CDATA[xaml]]></category>

		<guid isPermaLink="false">http://elegantcode.com/2009/04/14/debugging-xaml/</guid>
		<description><![CDATA[Okay, so I have been asked this question more than almost any XAML related question in the past few weeks; How do I debug XAML?&#160; The problem with XAML’s powerful binding model is that it can be difficult to debug errors in your binding paths.
Lets say I have the following code snippet:


&#60;StatusBar&#62;
   &#60;StatusBarItem&#62;
 [...]]]></description>
			<content:encoded><![CDATA[<p>Okay, so I have been asked this question more than almost any XAML related question in the past few weeks; How do I debug XAML?&#160; The problem with XAML’s powerful binding model is that it can be difficult to debug errors in your binding paths.</p>
<p>Lets say I have the following code snippet:</p>
<div style="border-right: gray 1px solid; padding-right: 4px; border-top: gray 1px solid; padding-left: 4px; font-size: 8pt; padding-bottom: 4px; margin: 20px 0px 10px; overflow: auto; border-left: gray 1px solid; width: 97.5%; cursor: text; max-height: 200px; line-height: 12pt; padding-top: 4px; border-bottom: gray 1px solid; font-family: consolas, &#39;Courier New&#39;, courier, monospace; background-color: #f4f4f4">
<div style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #0000ff">&lt;</span><span style="color: #800000">StatusBar</span><span style="color: #0000ff">&gt;</span></pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">   <span style="color: #0000ff">&lt;</span><span style="color: #800000">StatusBarItem</span><span style="color: #0000ff">&gt;</span></pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">       <span style="color: #0000ff">&lt;</span><span style="color: #800000">TextBlock</span> <span style="color: #ff0000">Text</span><span style="color: #0000ff">=&quot;{Binding Messssage}&quot;</span> <span style="color: #0000ff">/&gt;</span></pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">   <span style="color: #0000ff">&lt;/</span><span style="color: #800000">StatusBarItem</span><span style="color: #0000ff">&gt;</span></pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #0000ff">&lt;/</span><span style="color: #800000">StatusBar</span><span style="color: #0000ff">&gt;</span></pre>
</p></div>
</div>
<p>As you can see my property Message is totally misspelled.&#160; If I were to run this application nothing would ever appear in my status bar, and I would not know why.&#160; I didn’t get any compile errors, and my view renders perfectly in my designer, so what the hell is going on.&#160; You might spend hours looking at your object’s property, stepping through the property changed events, or just saying XAML is a piece of crap and I give up.&#160; Well never fear, I am about to reveal the secret to debugging your XAML.</p>
<p>Look in your Output Window!</p>
<p><a href="http://elegantcode.com/wp-content/uploads/2009/04/outputwindow.jpg" target="_blank"><img title="OutputWindow" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="79" alt="OutputWindow" src="http://elegantcode.com/wp-content/uploads/2009/04/outputwindow-thumb.jpg" width="404" border="0" /></a> </p>
<p>Yes, the nearly always forgotten Output Window.&#160; As you can see, if you click on the image above, it tells me that I have a binding expression path error and gives the line number where the error occurred.&#160; So don’t spend hours stepping through code looking for a ghost.&#160; Just check your Output Window.</p>
]]></content:encoded>
			<wfw:commentRss>http://elegantcode.com/2009/04/14/debugging-xaml/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>WPF String.Format in XAML with the StringFormat attribute</title>
		<link>http://elegantcode.com/2009/04/07/wpf-stringformat-in-xaml-with-the-stringformat-attribute/</link>
		<comments>http://elegantcode.com/2009/04/07/wpf-stringformat-in-xaml-with-the-stringformat-attribute/#comments</comments>
		<pubDate>Wed, 08 Apr 2009 03:29:10 +0000</pubDate>
		<dc:creator>Brian Lagunas</dc:creator>
				<category><![CDATA[WPF]]></category>
		<category><![CDATA[stringformat]]></category>
		<category><![CDATA[xaml]]></category>

		<guid isPermaLink="false">http://elegantcode.com/2009/04/07/wpf-stringformat-in-xaml-with-the-stringformat-attribute/</guid>
		<description><![CDATA[So you want to format the output of information but don't want do it in code behind or write a value converter to do it. Well, good news, you don't have to. You can format your data directly in XAML. How, you may be asking? New in .NET 3.5 SP1 is the StringFormat attribute. 

Example 1: Lets say you want to format a double value into a currency: 

<TextBlock Text="{Binding Amount, StringFormat={}{0:C}}" />


Notice the “{ }” just after the StringFormat attribute? What that is doing is escaping the text after the “=” sign. You need to do this because we do not have any text directly after the “=” sign. If you don’t put the “{ }'”, strange things will happen. 

And now lets say we want to place some text in front of the currency: 

<TextBlock Text="{Binding Amount, StringFormat=Total: {0:C}}" />


Since we now have text after the “=” sign we no longer need the “{ }”. 

How about a date you ask: 

<TextBlock Text="{Binding Date, StringFormat={}{0:MM/dd/yyyy}}" />




Oh, and you want time: 

<TextBlock Text="{Binding Date, StringFormat={}{0:MM/dd/yyyy hh:mm tt}}" />


What? You want to create a tooltip comprised of more than one property of an object. Well Okay: 

<Button Content="Delete Me"> <Button.ToolTip> <ToolTip> <StackPanel Orientation="Horizontal"> <TextBlock> <TextBlock.Text> <MultiBinding StringFormat="Delete {0} {1}"> <Binding Path="FirstName" /> <Binding Path="LastName" /> </MultiBinding> </TextBlock.Text> </TextBlock> </StackPanel> </ToolTip> </Button.ToolTip></Button>


As you can see the StringFormat attribute can be a time saver, and just make life a little easier. One thing to note is that if you use the StringFormat attribute and you bind to a property that has no value, otherwise known as null, then the text that will be displayed is “{DependencyProperty.UnsetValue}".]]></description>
			<content:encoded><![CDATA[<p>So you want to format the output of information but don&#8217;t want do it in code behind or write a value converter to do it.&#160; Well, good news, you don&#8217;t have to.&#160; You can format your data directly in XAML.&#160; How, you may be asking?&#160; New in .NET 3.5 SP1 is the <strong>StringFormat</strong> attribute. </p>
<p>Example 1:&#160; Lets say you want to format a double value into a currency: </p>
<div style="border-right: gray 1px solid; padding-right: 4px; border-top: gray 1px solid; padding-left: 4px; font-size: 8pt; padding-bottom: 4px; margin: 20px 0px 10px; overflow: auto; border-left: gray 1px solid; width: 97.5%; cursor: text; max-height: 200px; line-height: 12pt; padding-top: 4px; border-bottom: gray 1px solid; font-family: consolas, &#39;Courier New&#39;, courier, monospace; height: 35px; background-color: #f4f4f4">
<div style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #0000ff">&lt;</span><span style="color: #800000">TextBlock</span> <span style="color: #ff0000">Text</span><span style="color: #0000ff">=&quot;{Binding Amount, StringFormat={}{0:C}}&quot;</span> <span style="color: #0000ff">/&gt;</span></pre>
</p></div>
</div>
<p>Notice the “{ }” just after the <strong>StringFormat</strong> attribute?&#160; What that is doing is escaping the text after the “=” sign.&#160; You need to do this because we do not have any text directly after the “=” sign.&#160; If you don’t put the “{ }&#8217;”, strange things will happen.&#160; </p>
<p>And now lets say we want to place some text in front of the currency: </p>
<div style="border-right: gray 1px solid; padding-right: 4px; border-top: gray 1px solid; padding-left: 4px; font-size: 8pt; padding-bottom: 4px; margin: 20px 0px 10px; overflow: auto; border-left: gray 1px solid; width: 97.5%; cursor: text; max-height: 200px; line-height: 12pt; padding-top: 4px; border-bottom: gray 1px solid; font-family: consolas, &#39;Courier New&#39;, courier, monospace; height: 31px; background-color: #f4f4f4">
<div style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #0000ff">&lt;</span><span style="color: #800000">TextBlock</span> <span style="color: #ff0000">Text</span><span style="color: #0000ff">=&quot;{Binding Amount, StringFormat=Total: {0:C}}&quot;</span> <span style="color: #0000ff">/&gt;</span></pre>
</p></div>
</div>
<p>Since we now have text after the “=” sign we no longer need the “{ }”.&#160; </p>
<p>How about a date you ask: </p>
<div style="border-right: gray 1px solid; padding-right: 4px; border-top: gray 1px solid; padding-left: 4px; font-size: 8pt; padding-bottom: 4px; margin: 20px 0px 10px; overflow: auto; border-left: gray 1px solid; width: 97.5%; cursor: text; max-height: 200px; line-height: 12pt; padding-top: 4px; border-bottom: gray 1px solid; font-family: consolas, &#39;Courier New&#39;, courier, monospace; height: 33px; background-color: #f4f4f4">
<div style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #0000ff">&lt;</span><span style="color: #800000">TextBlock</span> <span style="color: #ff0000">Text</span><span style="color: #0000ff">=&quot;{Binding Date, StringFormat={}{0:MM/dd/yyyy}}&quot;</span> <span style="color: #0000ff">/&gt;</span></pre>
</p></div>
</div>
<p>Oh, and you want time: </p>
<div style="border-right: gray 1px solid; padding-right: 4px; border-top: gray 1px solid; padding-left: 4px; font-size: 8pt; padding-bottom: 4px; margin: 20px 0px 10px; overflow: auto; border-left: gray 1px solid; width: 97.5%; cursor: text; max-height: 200px; line-height: 12pt; padding-top: 4px; border-bottom: gray 1px solid; font-family: consolas, &#39;Courier New&#39;, courier, monospace; height: 35px; background-color: #f4f4f4">
<div style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #0000ff">&lt;</span><span style="color: #800000">TextBlock</span> <span style="color: #ff0000">Text</span><span style="color: #0000ff">=&quot;{Binding Date, StringFormat={}{0:MM/dd/yyyy hh:mm tt}}&quot;</span> <span style="color: #0000ff">/&gt;</span></pre>
</p></div>
</div>
<p>What?&#160; You want to create a tooltip comprised of more than one property of an object.&#160; Well Okay: </p>
<div style="border-right: gray 1px solid; padding-right: 4px; border-top: gray 1px solid; padding-left: 4px; font-size: 8pt; padding-bottom: 4px; margin: 20px 0px 10px; overflow: auto; border-left: gray 1px solid; width: 97.5%; cursor: text; max-height: 200px; line-height: 12pt; padding-top: 4px; border-bottom: gray 1px solid; font-family: consolas, &#39;Courier New&#39;, courier, monospace; background-color: #f4f4f4">
<div style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #0000ff">&lt;</span><span style="color: #800000">Button</span> <span style="color: #ff0000">Content</span><span style="color: #0000ff">=&quot;Delete Me&quot;</span><span style="color: #0000ff">&gt;</span></pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">    <span style="color: #0000ff">&lt;</span><span style="color: #800000">Button.ToolTip</span><span style="color: #0000ff">&gt;</span></pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">        <span style="color: #0000ff">&lt;</span><span style="color: #800000">ToolTip</span><span style="color: #0000ff">&gt;</span></pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">            <span style="color: #0000ff">&lt;</span><span style="color: #800000">StackPanel</span> <span style="color: #ff0000">Orientation</span><span style="color: #0000ff">=&quot;Horizontal&quot;</span><span style="color: #0000ff">&gt;</span></pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">                <span style="color: #0000ff">&lt;</span><span style="color: #800000">TextBlock</span><span style="color: #0000ff">&gt;</span></pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">                    <span style="color: #0000ff">&lt;</span><span style="color: #800000">TextBlock.Text</span><span style="color: #0000ff">&gt;</span></pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">                        <span style="color: #0000ff">&lt;</span><span style="color: #800000">MultiBinding</span> <span style="color: #ff0000">StringFormat</span><span style="color: #0000ff">=&quot;Delete {0} {1}&quot;</span><span style="color: #0000ff">&gt;</span></pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">                            <span style="color: #0000ff">&lt;</span><span style="color: #800000">Binding</span> <span style="color: #ff0000">Path</span><span style="color: #0000ff">=&quot;FirstName&quot;</span> <span style="color: #0000ff">/&gt;</span></pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">                            <span style="color: #0000ff">&lt;</span><span style="color: #800000">Binding</span> <span style="color: #ff0000">Path</span><span style="color: #0000ff">=&quot;LastName&quot;</span> <span style="color: #0000ff">/&gt;</span></pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">                        <span style="color: #0000ff">&lt;/</span><span style="color: #800000">MultiBinding</span><span style="color: #0000ff">&gt;</span></pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">                    <span style="color: #0000ff">&lt;/</span><span style="color: #800000">TextBlock.Text</span><span style="color: #0000ff">&gt;</span></pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">                <span style="color: #0000ff">&lt;/</span><span style="color: #800000">TextBlock</span><span style="color: #0000ff">&gt;</span></pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">            <span style="color: #0000ff">&lt;/</span><span style="color: #800000">StackPanel</span><span style="color: #0000ff">&gt;</span></pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">        <span style="color: #0000ff">&lt;/</span><span style="color: #800000">ToolTip</span><span style="color: #0000ff">&gt;</span></pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">    <span style="color: #0000ff">&lt;/</span><span style="color: #800000">Button.ToolTip</span><span style="color: #0000ff">&gt;</span></pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #0000ff">&lt;/</span><span style="color: #800000">Button</span><span style="color: #0000ff">&gt;</span></pre>
</p></div>
</div>
<p>As you can see the <strong>StringFormat</strong> attribute can be a time saver, and just make life a little easier.&#160; One thing to note is that if you use the <strong>StringFormat</strong> attribute and you bind to a property that has no value, otherwise known as null, then the text that will be displayed is “{DependencyProperty.UnsetValue}&quot;. </p>
]]></content:encoded>
			<wfw:commentRss>http://elegantcode.com/2009/04/07/wpf-stringformat-in-xaml-with-the-stringformat-attribute/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
