<?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>The GUI Guys'  Blog</title>
	<atom:link href="http://guiguys.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://guiguys.wordpress.com</link>
	<description>Just another WordPress.com weblog</description>
	<lastBuildDate>Mon, 08 Dec 2008 16:55:59 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='guiguys.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>The GUI Guys'  Blog</title>
		<link>http://guiguys.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://guiguys.wordpress.com/osd.xml" title="The GUI Guys&#039;  Blog" />
	<atom:link rel='hub' href='http://guiguys.wordpress.com/?pushpress=hub'/>
		<item>
		<title>Blog Has Moved</title>
		<link>http://guiguys.wordpress.com/2008/12/08/blog-has-moved/</link>
		<comments>http://guiguys.wordpress.com/2008/12/08/blog-has-moved/#comments</comments>
		<pubDate>Mon, 08 Dec 2008 16:55:59 +0000</pubDate>
		<dc:creator>wpfguiblog</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://guiguys.wordpress.com/?p=7</guid>
		<description><![CDATA[This blog is no longer being maintained. Please update your links to the following url. http://dotnetgui.blogspot.com/<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=guiguys.wordpress.com&amp;blog=2847328&amp;post=7&amp;subd=guiguys&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>This blog is no longer being maintained. Please update your links to the following url.</p>
<p><a href="http://dotnetgui.blogspot.com/">http://dotnetgui.blogspot.com/</a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/guiguys.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/guiguys.wordpress.com/7/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/guiguys.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/guiguys.wordpress.com/7/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/guiguys.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/guiguys.wordpress.com/7/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/guiguys.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/guiguys.wordpress.com/7/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/guiguys.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/guiguys.wordpress.com/7/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/guiguys.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/guiguys.wordpress.com/7/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/guiguys.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/guiguys.wordpress.com/7/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=guiguys.wordpress.com&amp;blog=2847328&amp;post=7&amp;subd=guiguys&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://guiguys.wordpress.com/2008/12/08/blog-has-moved/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/24eb013962689d808643ef5974801ee8?s=96&#38;d=identicon" medium="image">
			<media:title type="html">wpfguiblog</media:title>
		</media:content>
	</item>
		<item>
		<title></title>
		<link>http://guiguys.wordpress.com/2008/03/03/6/</link>
		<comments>http://guiguys.wordpress.com/2008/03/03/6/#comments</comments>
		<pubDate>Mon, 03 Mar 2008 16:09:59 +0000</pubDate>
		<dc:creator>wpfguiblog</dc:creator>
				<category><![CDATA[Interoperability]]></category>

		<guid isPermaLink="false">http://guiguys.wordpress.com/?p=6</guid>
		<description><![CDATA[Question: &#8220;I have been working with Windows Forms for a long time. I have a lot of good Winforms user controls that I want to keep using, but I would like to start using WPF to create better user interfaces. Is this an all or nothing deal? Can I create Winforms apps which use some [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=guiguys.wordpress.com&amp;blog=2847328&amp;post=6&amp;subd=guiguys&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p style="font-weight:bold;font-size:11pt;font-style:italic;font-family:Calibri;margin:0;"><span style="font-weight:bold;font-size:11pt;font-style:italic;font-family:Calibri;"><font color="#000000">Question:</font></span></p>
<p style="font-weight:bold;font-size:11pt;font-style:italic;font-family:Calibri;margin:0;"><font color="#000000">&#8220;I have been working with Windows Forms for a long time. I have a lot of good Winforms user controls that I want to keep using, but I would like to start using WPF to create better user interfaces. Is this an all or nothing deal? Can I create Winforms apps which use some WPF controls or WPF apps which use some of my existing Winforms controls?&#8221;</font></p>
<p style="font-weight:bold;font-size:11pt;font-style:italic;font-family:Calibri;margin:0;">&nbsp;</p>
<p style="font-weight:bold;font-size:11pt;font-style:italic;font-family:Calibri;margin:0;">&nbsp;</p>
<p style="font-weight:bold;font-size:11pt;font-style:italic;font-family:Calibri;margin:0;"><font color="#000000"></font></p>
<p style="font-weight:bold;font-size:11pt;font-style:italic;font-family:Calibri;margin:0;"><font color="#000000"></font></p>
<p style="font-size:11pt;font-family:Calibri;margin:0;"><font color="#000000">Answer:</font></p>
<p style="font-size:11pt;font-family:Calibri;margin:0;"><font color="#000000">No. This is not an all or nothing deal. You can leverage WPF in your existing Winform applications and vice versa. </font></p>
<p style="font-size:11pt;font-family:Calibri;margin:0;"><font color="#000000"></font></p>
<p style="font-size:11pt;font-family:Calibri;margin:0;"><font color="#000000">Embedding a Winforms control in a WPF application:</font></p>
<ol>
<li><span style="font-size:11pt;font-family:Calibri;"><font color="#000000">Add references to System.Windows.Forms and WindowsFormsIntegration dlls.</font></span></li>
<li><span style="font-size:11pt;font-family:Calibri;"><font color="#000000">Add a reference to the dll containing the Windows Form control you are going to be placing in your WPF app.</font></span></li>
<li><span style="font-size:11pt;font-family:Calibri;"><font color="#000000">Add a new xml namespace (xmlns) attribute to the root element of your xaml document … (usually a Window element)</font></span>
<p style="font-size:11pt;font-family:Calibri;margin:0 0 0 0.375in;"><font color="#000000"><br />
&lt;Window</font></p>
<p style="font-size:11pt;font-family:Calibri;margin:0 0 0 0.75in;"><font color="#000000">xmlns=&#8221;</font><a href="http://schemas.microsoft.com/winfx/2006/xaml/presentation"><font color="#000000">http://schemas.microsoft.com/winfx/2006/xaml/presentation</font></a><font color="#000000">&#8220;</font></p>
<p style="font-size:11pt;font-family:Calibri;margin:0 0 0 0.75in;"><font color="#000000">xmlns:x=&#8221;http://schemas.microsoft.com/winfx/2006/xaml&#8221;</font></p>
<p style="font-size:11pt;font-family:Calibri;margin:0 0 0 0.75in;"><font color="#000000">. . .</font></p>
<p style="font-size:11pt;font-family:Calibri;margin:0 0 0 0.75in;"><font color="#000000"><span style="font-weight:bold;"><span> </span>xmlns:zed=&#8221;clr-namespace:ZedGraph;assembly=ZedGraph&#8221;</span> </font><font color="#000000"> <br />
</font><font color="#000000"></p>
<p></font><font color="#000000">In this example I am inserting a ZedGraph control. It is third party control used to graph out the movements of a Wiimote device. The class defined in the ZedGraph assembly which is in the ZedGraph namespace. I am using zed as a shorthand to reference that assembly.<br />
</font></li>
<p style="font-size:11pt;font-family:Calibri;margin:0;"><font color="#000000"></font></p>
<li><span style="font-size:11pt;font-family:Calibri;"><font color="#000000">Add a WindowsFromsHost element in the panel where you want to insert your Winforms control.</font></span></li>
<li><span style="font-size:11pt;font-family:Calibri;"><font color="#000000">Add your Windforms control as the content of that WindowsFormsHost element.</font></span>
<p style="font-size:11pt;font-family:Calibri;margin:0;"><font color="#000000"></font></p>
<p style="font-weight:bold;font-size:11pt;font-family:Calibri;margin:0 0 0 0.375in;"><font color="#000000"><span></p>
<p> </span>&lt;WindowsFormsHost&gt;</font></p>
<p style="font-weight:bold;font-size:11pt;font-family:Calibri;margin:0 0 0 0.75in;"><font color="#000000">&lt;zed:ZedGraphControl x:Name=&#8221;graphControl&#8221;/&gt;<span>                </span></font></p>
<p style="font-weight:bold;font-size:11pt;font-family:Calibri;margin:0 0 0 0.375in;"><font color="#000000">&lt;/WindowsFormsHost&gt;<br />
</font></p>
<p style="font-size:11pt;font-family:Calibri;margin:0;"><font color="#000000"></font></p>
<p style="font-size:11pt;font-family:Calibri;margin:0;"><font color="#000000"><span style="font-weight:bold;"></p>
<p></span></font><font color="#000000"><span style="font-weight:bold;">Warning:<span>  </span>If you have the attribute AllowsTransparency=True on the root Window element, the WindowsFormsHost will not be displayed. You will not get any compiler errors, but the content will simply not be displayed. The way WPF handles transparency is not supported by Windows Forms, so if the window allows transparency, the Winforms content cannot be properly rendered… I learned this the hard way. It took a while to figure out why my controls weren&#8217;t displaying on my GUI!<br />
</span></font><font color="#000000"><br />
Embedding a WPF control in a Winforms application:<br />
</font></li>
</ol>
<p><span style="font-size:11pt;font-family:Calibri;"><font color="#000000"> First, add ElementHost to the VisualStudio Toolbox going to the Tools menu and selecting Choose Toolbox Items.<span>  </span>A dialog is shown with a<span>  </span>list of controls that can be added to the toolbox. Make sure ElementHost is checked and click Ok.</font></span></p>
<p style="font-size:11pt;font-family:Calibri;margin:0;"><font color="#000000"></font></p>
<p style="font-size:11pt;font-family:Calibri;margin:0 0 0 0.375in;"><font color="#000000">Note: By dragging the ElementHost on to the form using the Winforms designer, Visual Studio automatically adds references to the necessary references to the necessary WPF assemblies like PresentationFramework.dll, PresentationCore.dll, etc.</font></p>
<p style="font-size:11pt;font-family:Calibri;margin:0 0 0 0.375in;"><span><font color="#000000">  </font></span></p>
<ol>
<li><span style="font-size:11pt;font-family:Calibri;"><font color="#000000">Drag an instance of the ElementHost control on to your Winforms application wherever you wish to insert WPF content.</font></span></li>
<li><span style="font-size:11pt;font-family:Calibri;"><font color="#000000">Create your WPF content (in the code behind) and set it as the Child of your ElementHost object.</font></span>
<p style="font-size:11pt;font-family:Calibri;margin:0 0 0 0.375in;"><font color="#000000">public</font></p>
<p style="font-size:11pt;font-family:Calibri;margin:0 0 0 0.375in;"><font color="#000000"></font></p>
<p style="font-size:11pt;font-family:Calibri;margin:0 0 0 0.375in;"><font color="#000000">Public Form1()</font></p>
<p style="font-size:11pt;font-family:Calibri;margin:0 0 0 0.375in;"><font color="#000000">{</font></p>
<p style="font-size:11pt;font-family:Calibri;margin:0 0 0 0.75in;"><font color="#000000">InitializeComponent();</font></p>
<p style="font-size:11pt;font-family:Calibri;margin:0 0 0 0.75in;"><font color="#000000"></font></p>
<p style="font-size:11pt;font-family:Calibri;margin:0 0 0 0.75in;"><font color="#000000">//Create WPF Content</font></p>
<p style="font-size:11pt;font-family:Calibri;margin:0 0 0 0.75in;"><font color="#000000">Viewer viewer = new Viewer();</font></p>
<p style="font-size:11pt;font-family:Calibri;margin:0 0 0 0.75in;"><font color="#000000">elementHost.Child = viewer;</font></p>
<p style="font-size:11pt;font-family:Calibri;margin:0 0 0 0.375in;"><font color="#000000">}<br />
</font></p>
<p style="font-size:11pt;font-family:Calibri;margin:0;"><font color="#000000"></font></p>
<p style="font-weight:bold;font-size:11pt;font-family:Calibri;margin:0 0 0 0.375in;"><font color="#000000"></p>
<p>Note: Viewer is a User control I created in WPF. In order for me to use it I added a reference to the assembly where the Viewer control was defined. In the above example, I also named the instance of the ElementHost object I placed on the GUI as elementHost.</font></li>
</ol>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/guiguys.wordpress.com/6/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/guiguys.wordpress.com/6/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/guiguys.wordpress.com/6/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/guiguys.wordpress.com/6/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/guiguys.wordpress.com/6/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/guiguys.wordpress.com/6/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/guiguys.wordpress.com/6/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/guiguys.wordpress.com/6/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/guiguys.wordpress.com/6/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/guiguys.wordpress.com/6/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/guiguys.wordpress.com/6/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/guiguys.wordpress.com/6/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/guiguys.wordpress.com/6/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/guiguys.wordpress.com/6/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/guiguys.wordpress.com/6/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/guiguys.wordpress.com/6/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=guiguys.wordpress.com&amp;blog=2847328&amp;post=6&amp;subd=guiguys&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://guiguys.wordpress.com/2008/03/03/6/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/24eb013962689d808643ef5974801ee8?s=96&#38;d=identicon" medium="image">
			<media:title type="html">wpfguiblog</media:title>
		</media:content>
	</item>
		<item>
		<title>How Do You Change the Cursor of a WPF App?</title>
		<link>http://guiguys.wordpress.com/2008/02/20/how-do-you-change-the-cursor-of-a-wpf-app/</link>
		<comments>http://guiguys.wordpress.com/2008/02/20/how-do-you-change-the-cursor-of-a-wpf-app/#comments</comments>
		<pubDate>Wed, 20 Feb 2008 18:26:09 +0000</pubDate>
		<dc:creator>wpfguiblog</dc:creator>
				<category><![CDATA[WPF]]></category>
		<category><![CDATA[XAML]]></category>

		<guid isPermaLink="false">http://guiguys.wordpress.com/?p=5</guid>
		<description><![CDATA[Changing the cursor of a WPF app is pretty simple. You can do it through procedural code as follows: this.Cursor = Cursors.None; There are several built in cursors such as a pen, cross, scroll, etc. You can also use a custom cursor as follows: this.Cursor = new Cursor("CustomCursorImage.jpg");  Because Cursor is a dependency property, it can [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=guiguys.wordpress.com&amp;blog=2847328&amp;post=5&amp;subd=guiguys&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p align="left">Changing the cursor of a WPF app is pretty simple. You can do it through procedural code as follows:</p>
<p><code></code><code></p>
<p align="left">this.Cursor = Cursors.None;</p>
<p></code></p>
<p align="left"><font size="2">There are several built in cursors such as a pen, cross, scroll, etc. You can also use a custom cursor as follows:</font><font size="2"> </font></p>
<p align="left"><code>this.Cursor = new Cursor("CustomCursorImage.jpg"); <br />
</code><font size="2" color="#000000">Because Cursor is a dependency property, it can also be used in XAML. Here are two  examples on how to use custom cursors via XAML:</font></p>
<p align="left"><code>&lt;Button Content="Wait" Cursor="Wait"/&gt;&lt;Button Content="CustomCursorImage.jpg"/&gt;<br />
</code></p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/guiguys.wordpress.com/5/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/guiguys.wordpress.com/5/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/guiguys.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/guiguys.wordpress.com/5/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/guiguys.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/guiguys.wordpress.com/5/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/guiguys.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/guiguys.wordpress.com/5/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/guiguys.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/guiguys.wordpress.com/5/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/guiguys.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/guiguys.wordpress.com/5/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/guiguys.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/guiguys.wordpress.com/5/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/guiguys.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/guiguys.wordpress.com/5/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=guiguys.wordpress.com&amp;blog=2847328&amp;post=5&amp;subd=guiguys&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://guiguys.wordpress.com/2008/02/20/how-do-you-change-the-cursor-of-a-wpf-app/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/24eb013962689d808643ef5974801ee8?s=96&#38;d=identicon" medium="image">
			<media:title type="html">wpfguiblog</media:title>
		</media:content>
	</item>
		<item>
		<title>A Few WPF Dos and Don&#8217;ts</title>
		<link>http://guiguys.wordpress.com/2008/02/14/a-few-wpf-dos-and-donts/</link>
		<comments>http://guiguys.wordpress.com/2008/02/14/a-few-wpf-dos-and-donts/#comments</comments>
		<pubDate>Thu, 14 Feb 2008 17:34:11 +0000</pubDate>
		<dc:creator>wpfguiblog</dc:creator>
				<category><![CDATA[WPF]]></category>

		<guid isPermaLink="false">http://guiguys.wordpress.com/?p=4</guid>
		<description><![CDATA[Do Not&#8230; Use absolute positioning When laying out a UI, try to minimize the use of the Canvas panel. This panel uses absolute positioning. Using absolute positioning is not a very flexible way of laying out UIs. It is better to use relative positioning. This aids in localization of applications because the application can adapt [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=guiguys.wordpress.com&amp;blog=2847328&amp;post=4&amp;subd=guiguys&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><font face="Calibri"><strong>Do Not&#8230; Use absolute positioning</strong></font></p>
<p align="left" style="margin:0 0 10pt;" class="MsoNormal"><font face="Calibri">When laying out a UI, try to minimize the use of the Canvas panel. This panel uses absolute positioning. Using absolute positioning is not a very flexible way of laying out UIs. It is better to use relative positioning. This aids in localization of applications because the application can adapt to changes in size, and flow direction of the application. A Grid control is a much better choise for a localized application&#8217;s layout panel.</font></p>
<p align="left" style="margin:0 0 10pt;" class="MsoNormal"><font face="Calibri"></font></p>
<p align="left" style="margin:0 0 10pt;" class="MsoNormal"><font face="Calibri"><strong></strong></font></p>
<p align="left" style="margin:0 0 10pt;" class="MsoNormal"><font face="Calibri"><strong>Do Not&#8230; Set a fixed size for GUI components</strong> </font></p>
<p align="left" style="margin:0 0 10pt;" class="MsoNormal"><font face="Calibri">Instead of setting an element’s size explicitly, use the margin, padding, and alignment properties. This allows the controls to size according to their content, which is desirable when creating globalized applications. When possible, provide extra space in margins to better accommodate longer strings.</font></p>
<p align="left" style="margin:0 0 10pt;" class="MsoNormal"><font face="Calibri"></font></p>
<p align="left" style="margin:0 0 10pt;" class="MsoNormal"><font face="Calibri"><strong></strong></font></p>
<p align="left" style="margin:0 0 10pt;" class="MsoNormal"><font face="Calibri"><strong>Do&#8230; Use the appropriate visibility</strong> </font></p>
<p align="left" style="margin:0 0 10pt;" class="MsoNormal"><font face="Calibri">There are three values which may be used for an object’s visibility – Visibility.Visible, Visibility.Hidden and Visibility.Collapsed.</font></p>
<p align="left" style="margin:0 0 10pt;" class="MsoNormal"><font face="Calibri">Visibility.Visible maps to <em>visible = true.</em> This means the object will be drawn on the screen.</font></p>
<p align="left" style="margin:0 0 10pt;" class="MsoNormal"><font face="Calibri">Visibility.Collapsed maps to <i>visible=false</i>. When an object’s visibility is set to collapsed, it is not drawn on the screen. The area it would originally take up is collapsed.<span>  </span>For increased performance, it is recommended to use collapsed over hidden whenever possible.</font></p>
<p align="left" style="margin:0 0 10pt;" class="MsoNormal"><font face="Calibri">Visibility.Hidden maps to <i>visible=true</i>. When an object’s visibility is set to hidden, it is not removed from its container. It still occupies the same area, but it is not visible. If the object is a large, complex object, you may notice a performance increase by hiding the object with Visibility.Collapsed instead of Visibility.Hidden.</font></p>
<p align="left" style="margin:0 0 10pt;" class="MsoNormal"><font face="Calibri"></font></p>
<p align="left" style="margin:0 0 10pt;" class="MsoNormal"><font face="Calibri"><strong></strong></font></p>
<p align="left" style="margin:0 0 10pt;" class="MsoNormal"><font face="Calibri"><strong>Do&#8230; Use only one level of interoperability</strong> </font></p>
<p align="left" style="margin:0 0 10pt;" class="MsoNormal"><font face="Calibri">Although it is possible to host a WPF control inside a Win32 control which is in turn hosted inside a WPF application and vice-versa, it is not recommended. <span> </span>Microsoft suggests keeping the level of interoperability to one (a WPF control hosted in a Win32 application or a Win32 control hosted in a WPF application). The way events are handled and messages queued is only intended to support a single level of interoperability. Messages and/or events may be lost or mishandled if more interoperability levels exist.</font></p>
<p align="left" style="margin:0 0 10pt;" class="MsoNormal"><font face="Calibri"><span class="MsoIntenseEmphasis"><span style="font-weight:normal;"><strong></strong></span></span></font></p>
<p align="left" style="margin:0 0 10pt;" class="MsoNormal"><font face="Calibri"><span class="MsoIntenseEmphasis"><span style="font-weight:normal;"><strong></strong></span></span></font></p>
<p align="left" style="margin:0 0 10pt;" class="MsoNormal"><font face="Calibri"><span class="MsoIntenseEmphasis"><span style="font-weight:normal;"><strong>Do&#8230; Know the difference between Binary Resources and Logical Resources</strong> </span></span></font></p>
<p><font face="Calibri"><span class="MsoIntenseEmphasis"><span style="font-weight:normal;">WPF introduces the concept of logical resources. They should not be confused with binary resources. Binary resources are what the rest of the .Net Framework considers a resource. These are traditionally items like image, video and audio files.  Logical resources are WPF-specific. Logical resources are .Net objects that can be stored within an element&#8217;s &#8217;Resources&#8217; property. This property is of type System.Windows.ResourceDictionary. Logical resources are typically used to define styles and templates. </span></span></font><font face="Calibri"></font><font face="Calibri"></font><font face="Calibri"></font><font face="Calibri"></font><font face="Calibri"></p>
<p align="left" style="margin:0 0 10pt;" class="MsoNormal"><font face="Calibri"><strong></strong></font></p>
<p align="left" style="margin:0 0 10pt;" class="MsoNormal"><font face="Calibri"><strong></strong></font></p>
<p align="left" style="margin:0 0 10pt;" class="MsoNormal"><font face="Calibri"><strong>Do Not&#8230; Use the Embedded Resources build action</strong> </font></p>
<p align="left" style="margin:0 0 10pt;" class="MsoNormal"><font face="Calibri">Visual Studio provides several ways for defining the Build Action of a file that has been added to a project. If you are used to writing Windows Forms applications, you may be tempted to use the Embedded Resource Build Action. This is the appropriate method for embedding resources in a Windows Forms project. However, resources embedded with this build action cannot be referenced by XAML. The two relevant Build Actions for WPF include &#8216;Resource&#8217; and &#8216;Content&#8217;.  The first embeds the resource into the assembly while the latter leaves it as a loose file but records the existence and relative location of the file.</font></p>
<p></font></p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/guiguys.wordpress.com/4/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/guiguys.wordpress.com/4/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/guiguys.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/guiguys.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/guiguys.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/guiguys.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/guiguys.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/guiguys.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/guiguys.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/guiguys.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/guiguys.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/guiguys.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/guiguys.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/guiguys.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/guiguys.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/guiguys.wordpress.com/4/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=guiguys.wordpress.com&amp;blog=2847328&amp;post=4&amp;subd=guiguys&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://guiguys.wordpress.com/2008/02/14/a-few-wpf-dos-and-donts/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/24eb013962689d808643ef5974801ee8?s=96&#38;d=identicon" medium="image">
			<media:title type="html">wpfguiblog</media:title>
		</media:content>
	</item>
	</channel>
</rss>
