<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://www.windows-now.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Zhanbo Sun [MS]</title><link>http://www.windows-now.com/blogs/zhanbos/default.aspx</link><description>Realize .NET &amp; Windows Vista Potential</description><dc:language>en</dc:language><generator>CommunityServer 2008 SP2 (Build: 31104.93)</generator><item><title>Silverlight QuickStart Using Microsoft Expression Blend 2</title><link>http://www.windows-now.com/blogs/zhanbos/silverlight-quickstart-using-microsoft-expression-blend-2.aspx</link><pubDate>Sun, 08 Jul 2007 02:16:00 GMT</pubDate><guid isPermaLink="false">20f58a17-7e15-440c-89b3-dfe02fe74bcd:26531</guid><dc:creator>zhanbos</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://www.windows-now.com/blogs/zhanbos/rsscomments.aspx?PostID=26531</wfw:commentRss><comments>http://www.windows-now.com/blogs/zhanbos/silverlight-quickstart-using-microsoft-expression-blend-2.aspx#comments</comments><description>&lt;P&gt;&lt;A class="" title="Silverlight QuickStart Using Microsoft Expression Blend 2" href="http://silverlight.net/quickstarts/blend_quickstart/default.aspx" target=_blank&gt;Silverlight QuickStart Using Microsoft Expression Blend 2&lt;/A&gt; is live now. It is similar to the the &lt;A class="" href="http://silverlight.net/quickstarts/silverlight10/default.aspx"&gt;Silverlight 1.0 Beta QuickStart&lt;/A&gt; except that it focuses on using the designer tool Microsoft Expression Blend 2 to create Silverlight graphics and UI rather than working directly in XAML code. This tutorial consists of step-by-step instructions of how to use Blend 2 to create a media player, with detailed&amp;nbsp;explanation and complete screenshots. &lt;/P&gt;
&lt;P&gt;Download Microsoft Expression Blend 2 at &lt;A href="http://www.microsoft.com/expression/products/download.aspx?key=blend2maypreview"&gt;http://www.microsoft.com/expression/products/download.aspx?key=blend2maypreview&lt;/A&gt;. &lt;/P&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://www.windows-now.com/aggbug.aspx?PostID=26531" width="1" height="1"&gt;</description><category domain="http://www.windows-now.com/blogs/zhanbos/archive/tags/SilverLight/default.aspx">SilverLight</category></item><item><title>5 Intensive Nights, 1.1 Silverlight Game</title><link>http://www.windows-now.com/blogs/zhanbos/five-intensive-nights-one-silverlight-game.aspx</link><pubDate>Fri, 06 Jul 2007 08:49:00 GMT</pubDate><guid isPermaLink="false">20f58a17-7e15-440c-89b3-dfe02fe74bcd:26498</guid><dc:creator>zhanbos</dc:creator><slash:comments>1</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://www.windows-now.com/blogs/zhanbos/rsscomments.aspx?PostID=26498</wfw:commentRss><comments>http://www.windows-now.com/blogs/zhanbos/five-intensive-nights-one-silverlight-game.aspx#comments</comments><description>&lt;P&gt;Vincent Vergonjeanne just posted BubbleFactory game written with Microsoft Silverlight 1.1 Alpha. You can play with it at &lt;A href="http://cosmik.members.winisp.net/BubbleFactory/"&gt;http://cosmik.members.winisp.net/BubbleFactory/&lt;/A&gt;. And if you are really good at this game, you can get yourself in its scoreboard (top 10 scores). &lt;/P&gt;
&lt;P&gt;Vincent spent five nights working tirelessly on this game. We have to agree: It is very cool!&lt;/P&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://www.windows-now.com/aggbug.aspx?PostID=26498" width="1" height="1"&gt;</description><category domain="http://www.windows-now.com/blogs/zhanbos/archive/tags/SilverLight/default.aspx">SilverLight</category></item><item><title>Windows Vista Tips (1-3)</title><link>http://www.windows-now.com/blogs/zhanbos/windows-vista-tips-1-3.aspx</link><pubDate>Wed, 04 Jul 2007 21:34:00 GMT</pubDate><guid isPermaLink="false">20f58a17-7e15-440c-89b3-dfe02fe74bcd:26435</guid><dc:creator>zhanbos</dc:creator><slash:comments>1</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://www.windows-now.com/blogs/zhanbos/rsscomments.aspx?PostID=26435</wfw:commentRss><comments>http://www.windows-now.com/blogs/zhanbos/windows-vista-tips-1-3.aspx#comments</comments><description>&lt;P&gt;I would like to share a few tips in using Windows Vista. I verified them in both Windows Vista Ultimate and Windows Vista Business, but they should be applicable to other versions as well. Maybe you have found one or two, but most of my friends&amp;nbsp;were unaware of them until I did a quick demo. &lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;For the &lt;EM&gt;Date and Time&lt;/EM&gt; dialog&amp;nbsp;that pops up when you single click&amp;nbsp;the Clock icon on the task bar, it shows view for the current month. But you can change it to be 12-month view by clicking on the month hypertext between left and right arrows. For example:&lt;BR&gt;&lt;BR&gt;&lt;IMG id=ViewPicture_ascx_GalleryImage style="BORDER-RIGHT:black 2px solid;BORDER-TOP:black 2px solid;BORDER-LEFT:black 2px solid;WIDTH:344px;BORDER-BOTTOM:black 2px solid;HEIGHT:253px;" alt=Clock src="http://blog.joycode.com/images/blog.joycode.com/zhanbos/737/r_clock.jpg"&gt;&lt;BR&gt;&lt;BR&gt;And if you click on year (e.g. 2007) hypertext, you enter view for 2000-2009. The transition is quite sleek. And it can help you navigate calendars back and forth more efficiently. &lt;BR&gt;&lt;/LI&gt;
&lt;LI&gt;Search box on Control Panel is aware of many keywords associated with various applets. Try typing the following words to see if it can save you time: &lt;EM&gt;DPI&lt;/EM&gt;, &lt;EM&gt;battery&lt;/EM&gt;, or &lt;EM&gt;User&lt;/EM&gt;.&lt;BR&gt;&lt;/LI&gt;
&lt;LI&gt;Flip (Alt+Tab) and Flip 3d (Window + Tab) mode can be made stay on the screen&amp;nbsp;when you also use &lt;STRONG&gt;&lt;EM&gt;Ctrl &lt;/EM&gt;&lt;/STRONG&gt;key. &lt;/LI&gt;&lt;/OL&gt;
&lt;P&gt;Do you have your favorite Windows Vista tips to share? &lt;/P&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://www.windows-now.com/aggbug.aspx?PostID=26435" width="1" height="1"&gt;</description><category domain="http://www.windows-now.com/blogs/zhanbos/archive/tags/Windows/default.aspx">Windows</category></item><item><title>Just .NET (1): CurrentCulture or CurrentUICulture as IFormatProvider in String.Format()?</title><link>http://www.windows-now.com/blogs/zhanbos/archive/2006/02/10/15798.aspx</link><pubDate>Fri, 10 Feb 2006 12:32:00 GMT</pubDate><guid isPermaLink="false">20f58a17-7e15-440c-89b3-dfe02fe74bcd:15798</guid><dc:creator>zhanbos</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://www.windows-now.com/blogs/zhanbos/rsscomments.aspx?PostID=15798</wfw:commentRss><comments>http://www.windows-now.com/blogs/zhanbos/archive/2006/02/10/15798.aspx#comments</comments><description>&lt;P&gt;Either Thread.CurrentCulture or Thread.CurrentUICulture can serve as value for the first parameter in &lt;A href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemstringclassformattopic3.asp"&gt;String.Format Method (IFormatProvider, String, Object[])&lt;/A&gt;. But they are not interchangeable. We should use Thread.CurrentCulture here instead of Thread.CurrentUICulture.&lt;/P&gt;
&lt;P&gt;The .NET Framework uses the terminology “culture” to represent what might have traditionally been called the “locale”. The .NET Framework has two concepts of the active culture.&lt;BR&gt;&amp;nbsp;&lt;BR&gt;UICulture, which is indicated by the Thread.CurrentUICulture property, corresponds to the language of the OS by default, or the selected language on a multi-language version of Windows. This affects which resources get loaded, so it determines which strings and pictures the user sees. &lt;/P&gt;
&lt;P&gt;CurrentUICulture is used almost exclusively for loading resources through the resource manager. If you don’t specify a culture to the resource manager, it defaults to CurrentUICulture. &lt;/P&gt;
&lt;P&gt;Culture, which is indicated by the Thread.CurrentCulture property, corresponds to the selection in Regional Options in the control panel by default. CurrentCulture affects how numbers, dates and times are formatted, and this is also what determines which sorting and casing rules to use. &lt;/P&gt;
&lt;P&gt;For String.Format(), it should use CurrentCulture. Since users are most comfortable in their own culture, CurrentCulture helps ensure that information is presented to users in the format they most prefer.&lt;/P&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://www.windows-now.com/aggbug.aspx?PostID=15798" width="1" height="1"&gt;</description><category domain="http://www.windows-now.com/blogs/zhanbos/archive/tags/.NET+Framework/default.aspx">.NET Framework</category></item><item><title>Happy Lunar New Year 2006</title><link>http://www.windows-now.com/blogs/zhanbos/archive/2006/01/29/15745.aspx</link><pubDate>Sun, 29 Jan 2006 08:00:00 GMT</pubDate><guid isPermaLink="false">20f58a17-7e15-440c-89b3-dfe02fe74bcd:15745</guid><dc:creator>zhanbos</dc:creator><slash:comments>1</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://www.windows-now.com/blogs/zhanbos/rsscomments.aspx?PostID=15745</wfw:commentRss><comments>http://www.windows-now.com/blogs/zhanbos/archive/2006/01/29/15745.aspx#comments</comments><description>&lt;P&gt;&lt;FONT face=Verdana&gt;For people like me who also celebrate lunar New Year,&amp;nbsp;one of its benefits is that I can make&amp;nbsp;my New Year Resolutions again. &lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana&gt;One of my (Lunar) New Year Resolutions is to write more in longhornblogs. And I start with this post right after midnight of New Year's Eve (Pacific Time).&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana&gt;2006 is the year Windows Vista (codenamed Longhorn) ships and I am really excited about this release. 2006 also happened to be my office number while I was working with&amp;nbsp;Windows Presentation Foundation (codenamed Avalon) in building 10.&amp;nbsp;Starting from the end of December 2005, I am with Visual Designer for Windows Presentation Foundation (codenamed Cider) team. &lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana&gt;If you need an introduction of Cider, you can start with this &lt;/FONT&gt;&lt;A href="http://channel9.msdn.com/Showpost.aspx?postid=129619"&gt;&lt;FONT face=Verdana&gt;Channel 9 video &lt;/FONT&gt;&lt;/A&gt;&lt;FONT face=Verdana&gt;featuring Mark Boulter and Brian Pepin. We have already&amp;nbsp;released two CTPs (Community Technical Preview): &lt;/FONT&gt;&lt;A href="http://www.microsoft.com/downloads/details.aspx?FamilyId=D1336F3E-E677-426B-925C-C84A54654414&amp;amp;displaylang=en"&gt;&lt;FONT face=Verdana&gt;December&amp;nbsp;CTP&amp;nbsp;&lt;/FONT&gt;&lt;/A&gt;&lt;FONT face=Verdana&gt;and &lt;/FONT&gt;&lt;A href="http://www.microsoft.com/downloads/details.aspx?familyid=5A0AE4CD-DC79-4B12-8A05-B6195F89FFA2&amp;amp;displaylang=en"&gt;&lt;FONT face=Verdana&gt;January CTP&lt;/FONT&gt;&lt;/A&gt;&lt;FONT face=Verdana&gt;, with more to come. &lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana&gt;Going forward, I&amp;nbsp;plan to&amp;nbsp;write more on what I have learnt&amp;nbsp;about Cider, Avalon,&amp;nbsp;as well as&amp;nbsp;.NET in general. Realizing the full potential of .NET can only be achieved by small progress we make day in and day out. Sharing knowledge goes a long way toward the goal.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana&gt;Have a Happy Lunar New Year!&lt;/FONT&gt;&lt;/P&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://www.windows-now.com/aggbug.aspx?PostID=15745" width="1" height="1"&gt;</description><category domain="http://www.windows-now.com/blogs/zhanbos/archive/tags/General/default.aspx">General</category></item><item><title>Avalon Q&amp;A 101-102 (on XAML)</title><link>http://www.windows-now.com/blogs/zhanbos/avalon-q-a-101-102-on-xaml.aspx</link><pubDate>Fri, 27 May 2005 08:44:00 GMT</pubDate><guid isPermaLink="false">20f58a17-7e15-440c-89b3-dfe02fe74bcd:14133</guid><dc:creator>zhanbos</dc:creator><slash:comments>2</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://www.windows-now.com/blogs/zhanbos/rsscomments.aspx?PostID=14133</wfw:commentRss><comments>http://www.windows-now.com/blogs/zhanbos/avalon-q-a-101-102-on-xaml.aspx#comments</comments><description>&lt;P class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY:'Franklin Gothic Book';"&gt;Q101: In XAML file, what can be used as x:Key value within Resources section?&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY:'Franklin Gothic Book';"&gt;Answer: A key for a dictionary can be String, LiteralExtension, TypeExtension and StaticExtension. You will get this error message from parsing the following XAML:&lt;BR&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE:10pt;COLOR:blue;FONT-FAMILY:'Courier New';mso-no-proof:yes;"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE:10pt;COLOR:maroon;FONT-FAMILY:'Courier New';mso-no-proof:yes;"&gt;Grid&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE:10pt;COLOR:blue;FONT-FAMILY:'Courier New';mso-no-proof:yes;"&gt; &lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE:10pt;COLOR:red;FONT-FAMILY:'Courier New';mso-no-proof:yes;"&gt;xmlns&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE:10pt;COLOR:blue;FONT-FAMILY:'Courier New';mso-no-proof:yes;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE:10pt;FONT-FAMILY:'Courier New';mso-no-proof:yes;"&gt;"&lt;SPAN style="COLOR:blue;"&gt;http://schemas.microsoft.com/winfx/avalon/2005&lt;/SPAN&gt;"&lt;SPAN style="COLOR:blue;"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR:red;"&gt;xmlns:x&lt;/SPAN&gt;&lt;SPAN style="COLOR:blue;"&gt;=&lt;/SPAN&gt;"&lt;SPAN style="COLOR:blue;"&gt;http://schemas.microsoft.com/winfx/xaml/2005&lt;/SPAN&gt;"&lt;SPAN style="COLOR:blue;"&gt;&amp;gt;&lt;BR&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE:10pt;COLOR:blue;FONT-FAMILY:'Courier New';mso-no-proof:yes;"&gt;&lt;SPAN style="mso-spacerun:yes;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE:10pt;COLOR:maroon;FONT-FAMILY:'Courier New';mso-no-proof:yes;"&gt;Grid.Resources&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE:10pt;COLOR:blue;FONT-FAMILY:'Courier New';mso-no-proof:yes;"&gt;&amp;gt;&lt;BR&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE:10pt;COLOR:blue;FONT-FAMILY:'Courier New';mso-no-proof:yes;"&gt;&lt;SPAN style="mso-spacerun:yes;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE:10pt;COLOR:maroon;FONT-FAMILY:'Courier New';mso-no-proof:yes;"&gt;SolidColorBrush&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE:10pt;COLOR:blue;FONT-FAMILY:'Courier New';mso-no-proof:yes;"&gt; &lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE:10pt;COLOR:red;FONT-FAMILY:'Courier New';mso-no-proof:yes;"&gt;Color&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE:10pt;COLOR:blue;FONT-FAMILY:'Courier New';mso-no-proof:yes;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE:10pt;FONT-FAMILY:'Courier New';mso-no-proof:yes;"&gt;"&lt;SPAN style="COLOR:blue;"&gt;LightBlue&lt;/SPAN&gt;"&lt;SPAN style="COLOR:blue;"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR:red;"&gt;x:Key&lt;/SPAN&gt;&lt;SPAN style="COLOR:blue;"&gt;=&lt;/SPAN&gt;"&lt;SPAN style="COLOR:blue;"&gt;{x:Null}&lt;/SPAN&gt;"&lt;SPAN style="COLOR:blue;"&gt;/&amp;gt;&lt;BR&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE:10pt;COLOR:blue;FONT-FAMILY:'Courier New';mso-no-proof:yes;"&gt;&lt;SPAN style="mso-spacerun:yes;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE:10pt;COLOR:maroon;FONT-FAMILY:'Courier New';mso-no-proof:yes;"&gt;Grid.Resources&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE:10pt;COLOR:blue;FONT-FAMILY:'Courier New';mso-no-proof:yes;"&gt;&amp;gt;&lt;BR&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE:10pt;COLOR:blue;FONT-FAMILY:'Courier New';mso-no-proof:yes;"&gt;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE:10pt;COLOR:maroon;FONT-FAMILY:'Courier New';mso-no-proof:yes;"&gt;Grid&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE:10pt;COLOR:blue;FONT-FAMILY:'Courier New';mso-no-proof:yes;"&gt;&amp;gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE:10pt;COLOR:blue;FONT-FAMILY:'Courier New';mso-no-proof:yes;"&gt;&lt;O:P&gt;&amp;nbsp;&lt;/O:P&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY:'Franklin Gothic Book';"&gt;Q102: What if I want to treat {x:Null} as string literal, instead of MarkupExtension?&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY:'Franklin Gothic Book';"&gt;Answer: {} is used in XAML file as escape sequence for this purpose. Parser will take whatever follows {} as string literal (with leading and trailing spaces trimmed). Try the sample below in which {}{x:Null} is used. Note: {} must be the first and second character. &lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;SPAN style="FONT-SIZE:10pt;COLOR:blue;FONT-FAMILY:'Courier New';mso-no-proof:yes;"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE:10pt;COLOR:maroon;FONT-FAMILY:'Courier New';mso-no-proof:yes;"&gt;Grid&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE:10pt;COLOR:blue;FONT-FAMILY:'Courier New';mso-no-proof:yes;"&gt; &lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE:10pt;COLOR:red;FONT-FAMILY:'Courier New';mso-no-proof:yes;"&gt;xmlns&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE:10pt;COLOR:blue;FONT-FAMILY:'Courier New';mso-no-proof:yes;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE:10pt;FONT-FAMILY:'Courier New';mso-no-proof:yes;"&gt;"&lt;SPAN style="COLOR:blue;"&gt;http://schemas.microsoft.com/winfx/avalon/2005&lt;/SPAN&gt;"&lt;SPAN style="COLOR:blue;"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR:red;"&gt;xmlns:x&lt;/SPAN&gt;&lt;SPAN style="COLOR:blue;"&gt;=&lt;/SPAN&gt;"&lt;SPAN style="COLOR:blue;"&gt;http://schemas.microsoft.com/winfx/xaml/2005&lt;/SPAN&gt;"&lt;SPAN style="COLOR:blue;"&gt;&amp;gt;&lt;BR&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE:10pt;COLOR:blue;FONT-FAMILY:'Courier New';mso-no-proof:yes;"&gt;&lt;SPAN style="mso-spacerun:yes;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE:10pt;COLOR:maroon;FONT-FAMILY:'Courier New';mso-no-proof:yes;"&gt;Grid.Resources&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE:10pt;COLOR:blue;FONT-FAMILY:'Courier New';mso-no-proof:yes;"&gt;&amp;gt;&lt;BR&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE:10pt;COLOR:blue;FONT-FAMILY:'Courier New';mso-no-proof:yes;"&gt;&lt;SPAN style="mso-spacerun:yes;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE:10pt;COLOR:maroon;FONT-FAMILY:'Courier New';mso-no-proof:yes;"&gt;SolidColorBrush&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE:10pt;COLOR:blue;FONT-FAMILY:'Courier New';mso-no-proof:yes;"&gt; &lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE:10pt;COLOR:red;FONT-FAMILY:'Courier New';mso-no-proof:yes;"&gt;Color&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE:10pt;COLOR:blue;FONT-FAMILY:'Courier New';mso-no-proof:yes;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE:10pt;FONT-FAMILY:'Courier New';mso-no-proof:yes;"&gt;"&lt;SPAN style="COLOR:blue;"&gt;LightBlue&lt;/SPAN&gt;"&lt;SPAN style="COLOR:blue;"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR:red;"&gt;x:Key&lt;/SPAN&gt;&lt;SPAN style="COLOR:blue;"&gt;=&lt;/SPAN&gt;"&lt;SPAN style="COLOR:blue;"&gt;{}{x:Null}&lt;/SPAN&gt;"&lt;SPAN style="COLOR:blue;"&gt;/&amp;gt;&lt;BR&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE:10pt;COLOR:blue;FONT-FAMILY:'Courier New';mso-no-proof:yes;"&gt;&lt;SPAN style="mso-spacerun:yes;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE:10pt;COLOR:maroon;FONT-FAMILY:'Courier New';mso-no-proof:yes;"&gt;Grid.Resources&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE:10pt;COLOR:blue;FONT-FAMILY:'Courier New';mso-no-proof:yes;"&gt;&amp;gt;&lt;BR&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE:10pt;COLOR:blue;FONT-FAMILY:'Courier New';mso-no-proof:yes;"&gt;&lt;SPAN style="mso-spacerun:yes;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE:10pt;COLOR:maroon;FONT-FAMILY:'Courier New';mso-no-proof:yes;"&gt;Button&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE:10pt;COLOR:blue;FONT-FAMILY:'Courier New';mso-no-proof:yes;"&gt; &lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE:10pt;COLOR:red;FONT-FAMILY:'Courier New';mso-no-proof:yes;"&gt;Content&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE:10pt;COLOR:blue;FONT-FAMILY:'Courier New';mso-no-proof:yes;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE:10pt;FONT-FAMILY:'Courier New';mso-no-proof:yes;"&gt;"&lt;SPAN style="COLOR:blue;"&gt;Sample 102&lt;/SPAN&gt;"&lt;SPAN style="COLOR:blue;"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR:red;"&gt;Background&lt;/SPAN&gt;&lt;SPAN style="COLOR:blue;"&gt;=&lt;/SPAN&gt;"&lt;SPAN style="COLOR:blue;"&gt;{StaticResource {}{x:Null}}&lt;/SPAN&gt;"&lt;SPAN style="COLOR:blue;"&gt;/&amp;gt;&lt;BR&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE:10pt;COLOR:blue;FONT-FAMILY:'Courier New';mso-no-proof:yes;"&gt;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE:10pt;COLOR:maroon;FONT-FAMILY:'Courier New';mso-no-proof:yes;"&gt;Grid&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE:10pt;COLOR:blue;FONT-FAMILY:'Courier New';mso-no-proof:yes;"&gt;&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;EM&gt;(This posting is provided "AS IS" with no warranties, and confers no rights.)&lt;/EM&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://www.windows-now.com/aggbug.aspx?PostID=14133" width="1" height="1"&gt;</description></item><item><title>Bill Gates Keynote from WinHEC 2005</title><link>http://www.windows-now.com/blogs/zhanbos/archive/2005/04/25/13899.aspx</link><pubDate>Mon, 25 Apr 2005 23:56:00 GMT</pubDate><guid isPermaLink="false">20f58a17-7e15-440c-89b3-dfe02fe74bcd:13899</guid><dc:creator>zhanbos</dc:creator><slash:comments>1</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://www.windows-now.com/blogs/zhanbos/rsscomments.aspx?PostID=13899</wfw:commentRss><comments>http://www.windows-now.com/blogs/zhanbos/archive/2005/04/25/13899.aspx#comments</comments><description>&lt;SPAN class=label&gt;&lt;/SPAN&gt;
&lt;P class=blurb&gt;&lt;B&gt;&lt;/B&gt;&lt;/P&gt;
&lt;P class=blurb&gt;In his keynote presentation (April 25th, 2005), Microsoft Chairman and Chief Software Architect Bill Gates reflects upon the hardware industry over the last 20 years and how the introduction of 64-bit and multicore computing will create a wave of industry innovation. Gates also provides a view into the foundation being laid for the release of Microsoft Windows "Longhorn."&lt;/P&gt;
&lt;P class=blurb&gt;The on-demand webcast links are posted at &lt;A href="http://www.microsoft.com/events/executives/billgates.mspx"&gt;http://www.microsoft.com/events/executives/billgates.mspx&lt;/A&gt;&lt;/P&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://www.windows-now.com/aggbug.aspx?PostID=13899" width="1" height="1"&gt;</description></item><item><title>WinHEC 2005 Starts</title><link>http://www.windows-now.com/blogs/zhanbos/archive/2005/04/25/13893.aspx</link><pubDate>Mon, 25 Apr 2005 11:06:00 GMT</pubDate><guid isPermaLink="false">20f58a17-7e15-440c-89b3-dfe02fe74bcd:13893</guid><dc:creator>zhanbos</dc:creator><slash:comments>2</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://www.windows-now.com/blogs/zhanbos/rsscomments.aspx?PostID=13893</wfw:commentRss><comments>http://www.windows-now.com/blogs/zhanbos/archive/2005/04/25/13893.aspx#comments</comments><description>&lt;P class=MsoNormal&gt;The annual Microsoft conference on computer hardware and drivers, WinHEC 2005 starts today. It also hosts the launch event for Windows &lt;A href="http://www.microsoft.com/windowsserver2003/64bit/x64/overview.mspx"&gt;x64&lt;/A&gt;. (More &lt;A href="http://www.microsoft.com/whdc/winhec/highlights05.mspx"&gt;highlights&lt;/A&gt;.) Of course, many people are very interested in previewing latest longhorn build. Attendants received Longhorn build &lt;a href="http://www.longhornblogs.com/winhec/archive/2005/04/25/13892.aspx"&gt;5048&lt;/A&gt;.&amp;nbsp;&lt;BR&gt;&lt;BR&gt;In today’s Wall Street Journal article, &lt;A href="http://online.wsj.com/article/0,,SB111437876629915410,00.html"&gt;Microsoft Puts Early Spotlight On Next Windows Version&lt;/A&gt;, it discusses almost exclusively on UI improvement in Longhorn. Of course, Longhorn has much more to offer to be “touted as the most significant product upgrade since Windows 95 a decade ago” (from WSJ article paragraph 16). Just take a moment to open &lt;A href="http://www.microsoft.com/whdc/winhec/tracks2005/w05tracks.mspx"&gt;WinHEC 2005 sessions&lt;/A&gt; and search for &lt;I&gt;longhorn.&amp;nbsp;&lt;BR&gt;&lt;BR&gt;&lt;/I&gt;And if you also search for &lt;I&gt;Avalon&lt;/I&gt;, you can find two relevant sessions: Avalon Imaging Codec Architecture, and Advances in Display and Composition Architecture for Windows. Not too many sessions in WinHEC. Wait until PDC 2005 for much more Avalon coverage.&amp;nbsp;&lt;BR&gt;&lt;BR&gt;I end this post with a question for my reader. The Wall Street Journal article says “The interface enhancements, based on an underlying technology called Avalon, are designed to give users more immediate visual cues about the nature and number of files they have.” (Paragraph 8) Do you see anything inaccurate here?&lt;/P&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://www.windows-now.com/aggbug.aspx?PostID=13893" width="1" height="1"&gt;</description></item><item><title>DockPanel.DockProperty, of type DependencyProperty, is a CLR field</title><link>http://www.windows-now.com/blogs/zhanbos/archive/2005/04/24/13888.aspx</link><pubDate>Sun, 24 Apr 2005 10:45:00 GMT</pubDate><guid isPermaLink="false">20f58a17-7e15-440c-89b3-dfe02fe74bcd:13888</guid><dc:creator>zhanbos</dc:creator><slash:comments>4</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://www.windows-now.com/blogs/zhanbos/rsscomments.aspx?PostID=13888</wfw:commentRss><comments>http://www.windows-now.com/blogs/zhanbos/archive/2005/04/24/13888.aspx#comments</comments><description>&lt;P class=MsoNormal&gt;In Avalon property system, DockPanel.DockProperty is an instance of DependencyProperty. DependencyProperty is a CLR class, and DockProperty is a CLR field defined within DockPanel class:&lt;BR&gt;&lt;BR&gt;&lt;I&gt;.field public static initonly [WindowsBase]System.Windows.DependencyProperty DockProperty&lt;BR&gt;&lt;BR&gt;&lt;/I&gt;To be accurate, DockProperty is a public static read-only field. Because it is public and static, any code can access it via DockPanel.DockProperty. Because it is read-only, no code can change its value (to be another DependencyProperty instance, or null) after it is initialized within static constructor.&amp;nbsp;&lt;BR&gt;&lt;BR&gt;Being a read-only field does &lt;STRONG&gt;not&lt;/STRONG&gt; make DockProperty a read-only Dependency Property. My discussion about read-only dependency property appears in the next blog.&amp;nbsp;&lt;BR&gt;&lt;BR&gt;In brief, DockPanel.DockProperty is &lt;/P&gt;
&lt;TABLE class=MsoTableGrid cellSpacing=0 cellPadding=0&gt;

&lt;TR&gt;
&lt;TD&gt;
&lt;P class=MsoNormal&gt;&lt;FONT color=#0000ff&gt;Within Avalon Property System&lt;/FONT&gt;&lt;/P&gt;&lt;/TD&gt;
&lt;TD&gt;
&lt;P class=MsoNormal&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;FONT color=#008000&gt; An attached read-write dependency property&lt;/FONT&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;
&lt;P class=MsoNormal&gt;&lt;FONT color=#0000ff&gt;Within CLR&lt;/FONT&gt;&lt;/P&gt;&lt;/TD&gt;
&lt;TD&gt;
&lt;P class=MsoNormal&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;FONT color=#008000&gt;A public static read-only field&lt;/FONT&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TABLE&gt;&lt;BR&gt;
&lt;P class=MsoNormal&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;I end this post with a question for my reader. There is another DependencyProperty defined/owned by DockPanel: LastChildFillProperty. Does the table above apply to it as well?&lt;BR&gt;&lt;BR&gt;&lt;EM&gt;(This posting is provided "AS IS" with no warranties, and confers no rights.)&lt;/EM&gt;&lt;/P&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://www.windows-now.com/aggbug.aspx?PostID=13888" width="1" height="1"&gt;</description></item><item><title>Locally set value takes precedence over Style value</title><link>http://www.windows-now.com/blogs/zhanbos/archive/2005/04/22/13874.aspx</link><pubDate>Fri, 22 Apr 2005 10:27:00 GMT</pubDate><guid isPermaLink="false">20f58a17-7e15-440c-89b3-dfe02fe74bcd:13874</guid><dc:creator>zhanbos</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://www.windows-now.com/blogs/zhanbos/rsscomments.aspx?PostID=13874</wfw:commentRss><comments>http://www.windows-now.com/blogs/zhanbos/archive/2005/04/22/13874.aspx#comments</comments><description>&lt;P&gt;&lt;STRONG&gt;(Note: Whoever has a better tool to post code into this blog system please contact me. )&lt;BR&gt;&lt;BR&gt;&lt;/STRONG&gt;If a DependencyProperty’s value is locally set, this value takes precedence over whatever value specified in Style. For example, the only button’s Background is LightGreen instead of LightBlue:&lt;/P&gt;
&lt;P&gt;Read more, at &lt;A href="http://blogs.msdn.com/zhanbos/archive/2005/04/22/410683.aspx"&gt;http://blogs.msdn.com/zhanbos/archive/2005/04/22/410683.aspx&lt;/A&gt;.&lt;/P&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://www.windows-now.com/aggbug.aspx?PostID=13874" width="1" height="1"&gt;</description></item><item><title>FrameworkPropertyMetadata.Inherits</title><link>http://www.windows-now.com/blogs/zhanbos/archive/2005/04/21/13872.aspx</link><pubDate>Thu, 21 Apr 2005 20:45:09 GMT</pubDate><guid isPermaLink="false">20f58a17-7e15-440c-89b3-dfe02fe74bcd:13872</guid><dc:creator>zhanbos</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://www.windows-now.com/blogs/zhanbos/rsscomments.aspx?PostID=13872</wfw:commentRss><comments>http://www.windows-now.com/blogs/zhanbos/archive/2005/04/21/13872.aspx#comments</comments><description>&lt;P class=MsoNormal&gt;FrameworkPropertyMetadata.Inherits indicates whether the DependencyProperty registered with this metadata is inheritable or not. For example, Binding.DataContextProperty is inheritable, yet DockPanel.DockProperty is not. &lt;BR&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;
&lt;P class=MsoNormal&gt;The demo code below firstly creates a DockPanel, a StackPanel, and a Button. To differentiate between getting a value from inheritance and getting the default value, we then set DockProperty value for stackPanel1 to be Dock.Top. We also set DataContextProperty for stackPanel1 to be dockPanel1. (Default values for DockProperty and DataContextProperty are Dock.Left and null respectively.)&lt;BR&gt;&lt;BR&gt;Before and after we add button1 into tree, we print out its values for DockProperty and DataContextProperty. It clearly shows the effect of property inheritance.&amp;nbsp;&lt;BR&gt;&lt;BR&gt;You can put all the code inside Click event handler for a button.&lt;BR&gt;&lt;BR&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: gray"&gt;// Sample event handler:&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&lt;BR&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;private&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;void&lt;/SPAN&gt; ButtonClick(&lt;SPAN style="COLOR: blue"&gt;object&lt;/SPAN&gt; sender, &lt;SPAN style="COLOR: teal"&gt;RoutedEventArgs&lt;/SPAN&gt; e)&lt;BR&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;{&lt;BR&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: teal"&gt;DockPanel&lt;/SPAN&gt; dockpanel1 = &lt;SPAN style="COLOR: blue"&gt;new&lt;/SPAN&gt; &lt;SPAN style="COLOR: teal"&gt;DockPanel&lt;/SPAN&gt;();&lt;BR&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: teal"&gt;StackPanel&lt;/SPAN&gt; stackPanel1 = &lt;SPAN style="COLOR: blue"&gt;new&lt;/SPAN&gt; &lt;SPAN style="COLOR: teal"&gt;StackPanel&lt;/SPAN&gt;();&lt;BR&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: teal"&gt;Button&lt;/SPAN&gt; button1 = &lt;SPAN style="COLOR: blue"&gt;new&lt;/SPAN&gt; &lt;SPAN style="COLOR: teal"&gt;Button&lt;/SPAN&gt;();&lt;BR&gt;&lt;BR&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: teal"&gt;DockPanel&lt;/SPAN&gt;.SetDock(stackPanel1, &lt;SPAN style="COLOR: teal"&gt;Dock&lt;/SPAN&gt;.Top);&lt;BR&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: teal"&gt;Binding&lt;/SPAN&gt;.SetDataContext(stackPanel1, dockpanel1);&lt;BR&gt;&lt;BR&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;System.Diagnostics.&lt;SPAN style="COLOR: teal"&gt;Debug&lt;/SPAN&gt;.WriteLine(&lt;SPAN style="COLOR: maroon"&gt;"button1.DockProperty is "&lt;/SPAN&gt; + &lt;SPAN style="COLOR: teal"&gt;DockPanel&lt;/SPAN&gt;.GetDock(button1).ToString());&lt;BR&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;object&lt;/SPAN&gt; value1 = &lt;SPAN style="COLOR: teal"&gt;Binding&lt;/SPAN&gt;.GetDataContext(button1);&lt;BR&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;System.Diagnostics.&lt;SPAN style="COLOR: teal"&gt;Debug&lt;/SPAN&gt;.WriteLine(&lt;SPAN style="COLOR: maroon"&gt;"button1.DataContextProperty is "&lt;/SPAN&gt; + (value1==&lt;SPAN style="COLOR: blue"&gt;null&lt;/SPAN&gt;?&lt;SPAN style="COLOR: maroon"&gt;"null"&lt;/SPAN&gt;:value1.ToString()));&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;dockpanel1.Children.Add(stackPanel1);&lt;BR&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;stackPanel1.Children.Add(button1);&lt;BR&gt;&lt;BR&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;System.Diagnostics.&lt;SPAN style="COLOR: teal"&gt;Debug&lt;/SPAN&gt;.WriteLine(&lt;SPAN style="COLOR: maroon"&gt;"button1.DockProperty is "&lt;/SPAN&gt; + &lt;SPAN style="COLOR: teal"&gt;DockPanel&lt;/SPAN&gt;.GetDock(button1).ToString());&lt;BR&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;value1 = &lt;SPAN style="COLOR: teal"&gt;Binding&lt;/SPAN&gt;.GetDataContext(button1);&lt;BR&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;System.Diagnostics.&lt;SPAN style="COLOR: teal"&gt;Debug&lt;/SPAN&gt;.WriteLine(&lt;SPAN style="COLOR: maroon"&gt;"button1.DataContextProperty is "&lt;/SPAN&gt; + (value1 == &lt;SPAN style="COLOR: blue"&gt;null&lt;/SPAN&gt; ? &lt;SPAN style="COLOR: maroon"&gt;"null"&lt;/SPAN&gt; : value1.ToString()));&lt;BR&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;}&lt;BR&gt;&lt;BR&gt;&lt;/SPAN&gt;The output is as follows:&lt;BR&gt;&lt;SPAN style="FONT-SIZE: 8pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;button1.DockProperty is Left&lt;BR&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 8pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;button1.DataContextProperty is null&lt;BR&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 8pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;button1.DockProperty is Left&lt;BR&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 8pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;button1.DataContextProperty is System.Windows.Controls.DockPanel&lt;BR&gt;&lt;BR&gt;&lt;/SPAN&gt;There are various other ways to affect a DependencyProeprty’s value. More blogs to come. &lt;BR&gt;&lt;BR&gt;&lt;FONT size=2&gt;&lt;EM&gt;(This posting is provided "AS IS" with no warranties, and confers no rights. Use of included script samples are subject to the terms specified at http://www.microsoft.com/info/cpyright.htm)&lt;/EM&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://www.windows-now.com/aggbug.aspx?PostID=13872" width="1" height="1"&gt;</description><category domain="http://www.windows-now.com/blogs/zhanbos/archive/tags/Core/default.aspx">Core</category></item><item><title>Visual Studio 2005 Shortcut Keys</title><link>http://www.windows-now.com/blogs/zhanbos/archive/2005/04/09/13831.aspx</link><pubDate>Sun, 10 Apr 2005 05:17:00 GMT</pubDate><guid isPermaLink="false">20f58a17-7e15-440c-89b3-dfe02fe74bcd:13831</guid><dc:creator>zhanbos</dc:creator><slash:comments>1</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://www.windows-now.com/blogs/zhanbos/rsscomments.aspx?PostID=13831</wfw:commentRss><comments>http://www.windows-now.com/blogs/zhanbos/archive/2005/04/09/13831.aspx#comments</comments><description>&lt;SPAN style="FONT-SIZE: 12pt; FONT-FAMILY: 'Times New Roman'; mso-fareast-font-family: SimSun; mso-ansi-language: EN-US; mso-fareast-language: ZH-CN; mso-bidi-language: AR-SA"&gt;
&lt;P class=MsoNormal&gt;The more you play with March 2005 CTP with VS2005, the more likely you will pick up new shortcut keys to speed up your programming. Here are just five of them (for Visual C# projects):&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;
&lt;DIV class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;Ctrl+K, Ctrk+X: Insert Snippet &lt;/DIV&gt;
&lt;LI&gt;
&lt;DIV class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;Ctrl+K, Ctrl+S: Surround With &lt;/DIV&gt;
&lt;LI&gt;
&lt;DIV class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;Ctrl+R, Ctrl+R: Rename (One commonly used Refactor operations) &lt;/DIV&gt;
&lt;LI&gt;
&lt;DIV class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;Ctrl+Alt+&lt;SPAN style="FONT-FAMILY: SimSun; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'"&gt;↓(the down arrow key)&lt;/SPAN&gt;: Show &lt;SPAN style="FONT-FAMILY: SimSun; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'"&gt;“&lt;/SPAN&gt;Active files&lt;SPAN style="FONT-FAMILY: SimSun; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'"&gt;”&lt;/SPAN&gt; dropdown menu &lt;/DIV&gt;
&lt;LI&gt;
&lt;DIV class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;Ctrl+Tab: Show active files and tool windows for easy navigation among them&lt;/DIV&gt;&lt;/LI&gt;&lt;/OL&gt;
&lt;P class=MsoNormal&gt;There are plentifully more and they are subject to change. Of course, many existing shortcut keys in VS.NET 2002/2003 should continue to work in VS2005. For example, pressing Ctrl+Alt+O gives focus to Output window. In future code snippets where &lt;FONT face="Courier New"&gt;System.Diagnostics.&lt;FONT color=#a52a2a&gt;Debug&lt;/FONT&gt;.WriteLine()&lt;/FONT&gt;gets used, you can see the result in Output window.&amp;nbsp;&lt;BR&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;(This posting is provided "AS IS" with no warranties, and confers no rights.)&lt;/SPAN&gt;&lt;/P&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://www.windows-now.com/aggbug.aspx?PostID=13831" width="1" height="1"&gt;</description></item><item><title>What’s New in Avalon March 2005 CTP</title><link>http://www.windows-now.com/blogs/zhanbos/archive/2005/04/06/13826.aspx</link><pubDate>Wed, 06 Apr 2005 09:11:00 GMT</pubDate><guid isPermaLink="false">20f58a17-7e15-440c-89b3-dfe02fe74bcd:13826</guid><dc:creator>zhanbos</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://www.windows-now.com/blogs/zhanbos/rsscomments.aspx?PostID=13826</wfw:commentRss><comments>http://www.windows-now.com/blogs/zhanbos/archive/2005/04/06/13826.aspx#comments</comments><description>&lt;P class=MsoNormal&gt;For people who are following WinFX in general and Avalon in particular, this MSDN technical article is very informative: &lt;A href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnlong/html/avalonmarch2005ctp.asp"&gt;Introducing the March 2005 CTP: What's New in "Avalon".&lt;/A&gt; It provides two sample projects you can download and play with while you are reading it.&amp;nbsp;&lt;BR&gt;&lt;BR&gt;One correction though: We do not have &lt;B&gt;Parser.LoadXAML() &lt;/B&gt;method. It should be &lt;B&gt;Parser.LoadXml()&lt;/B&gt;. This method is not new in March CTP, but the removal of loose XAML activation support is. &lt;BR&gt;&lt;BR&gt;(This posting is provided "AS IS" with no warranties, and confers no rights.)&lt;/P&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://www.windows-now.com/aggbug.aspx?PostID=13826" width="1" height="1"&gt;</description></item><item><title>CLR Event vs. Routed Event: Two Demo Applications</title><link>http://www.windows-now.com/blogs/zhanbos/archive/2005/04/02/13820.aspx</link><pubDate>Sat, 02 Apr 2005 14:08:00 GMT</pubDate><guid isPermaLink="false">20f58a17-7e15-440c-89b3-dfe02fe74bcd:13820</guid><dc:creator>zhanbos</dc:creator><slash:comments>1</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://www.windows-now.com/blogs/zhanbos/rsscomments.aspx?PostID=13820</wfw:commentRss><comments>http://www.windows-now.com/blogs/zhanbos/archive/2005/04/02/13820.aspx#comments</comments><description>&lt;P&gt;&lt;STRONG&gt;&lt;FONT style="BACKGROUND-COLOR: #ffffff" color=#000000&gt;Because it is extremely difficult to paste code snippet into longhornblogs' new rich text editor, I have to move the bulk of my post into msdn blogs. &lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;As you may have already known, you can define and use Dependency Property as well as CLR Property in Avalon. (If you want to know more about Avalon’s property system, stay tuned in this blog.) Same thing can be said about CLR Event and Routed Event. By supporting routed event in Avalon, the parent element can participate in events sourcing from its child elements. This blog post presents two applications to show the differences between CLR event and RoutedEvent. &lt;/P&gt;
&lt;P class=MsoNormal&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;FONT face=Verdana color=#006400&gt;Complete post at &lt;/FONT&gt;&lt;A href="http://blogs.msdn.com/zhanbos/archive/2005/04/02/404901.aspx"&gt;&lt;FONT face=Verdana color=#006400&gt;http://blogs.msdn.com/zhanbos/archive/2005/04/02/404901.aspx&lt;/FONT&gt;&lt;/A&gt;&lt;/P&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://www.windows-now.com/aggbug.aspx?PostID=13820" width="1" height="1"&gt;</description></item><item><title>Raise Routed Event through RaiseEvent</title><link>http://www.windows-now.com/blogs/zhanbos/archive/2004/11/25/7662.aspx</link><pubDate>Fri, 26 Nov 2004 05:53:00 GMT</pubDate><guid isPermaLink="false">20f58a17-7e15-440c-89b3-dfe02fe74bcd:7662</guid><dc:creator>zhanbos</dc:creator><slash:comments>1</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://www.windows-now.com/blogs/zhanbos/rsscomments.aspx?PostID=7662</wfw:commentRss><comments>http://www.windows-now.com/blogs/zhanbos/archive/2004/11/25/7662.aspx#comments</comments><description>&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;(Version: Avalon CTP 2004 November)&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;Both &lt;SPAN style="FONT-SIZE: 10pt; COLOR: teal; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;UIElement &lt;/SPAN&gt;and &lt;SPAN style="FONT-SIZE: 10pt; COLOR: teal; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;ContentElement&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt; &lt;/SPAN&gt;implement &lt;SPAN style="FONT-SIZE: 10pt; COLOR: teal; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;IInputElement &lt;/SPAN&gt;interface, which defines &lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;A href="http://winfx.msdn.microsoft.com/winfx/ref/ns/system.windows/i/iinputelement/m/raiseevent.aspx"&gt;RaiseEvent&lt;/A&gt;&lt;/SPAN&gt; method.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;This post gives you an example of using it.&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;We start with a simple Xaml file:&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: maroon; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;Window&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt; &lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: red; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;x:Class&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;=&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;"&lt;SPAN style="COLOR: blue"&gt;AvalonApplication1.Window1&lt;/SPAN&gt;"&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: red; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;xmlns&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;=&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;"&lt;SPAN style="COLOR: blue"&gt;http://schemas.microsoft.com/2003/xaml&lt;/SPAN&gt;"&lt;SPAN style="COLOR: blue"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: red"&gt;xmlns:x&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;=&lt;/SPAN&gt;"&lt;SPAN style="COLOR: blue"&gt;Definition&lt;/SPAN&gt;"&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: red; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;Text&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;=&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;"&lt;SPAN style="COLOR: blue"&gt;AvalonApplication1&lt;/SPAN&gt;"&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: maroon"&gt;DockPanel&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: maroon"&gt;Button&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: red"&gt;ID&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;=&lt;/SPAN&gt;"&lt;SPAN style="COLOR: blue"&gt;btn1&lt;/SPAN&gt;"&lt;SPAN style="COLOR: blue"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: red"&gt;Content&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;=&lt;/SPAN&gt;"&lt;SPAN style="COLOR: blue"&gt;Button 1&lt;/SPAN&gt;"&lt;SPAN style="COLOR: blue"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: red"&gt;Click&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;=&lt;/SPAN&gt;"&lt;SPAN style="COLOR: blue"&gt;ButtonClick1&lt;/SPAN&gt;"&lt;SPAN style="COLOR: blue"&gt;/&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: maroon"&gt;Button&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: red"&gt;ID&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;=&lt;/SPAN&gt;"&lt;SPAN style="COLOR: blue"&gt;btn2&lt;/SPAN&gt;"&lt;SPAN style="COLOR: blue"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: red"&gt;Content&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;=&lt;/SPAN&gt;"&lt;SPAN style="COLOR: blue"&gt;Button 2&lt;/SPAN&gt;"&lt;SPAN style="COLOR: blue"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: red"&gt;Click&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;=&lt;/SPAN&gt;"&lt;SPAN style="COLOR: blue"&gt;ButtonClick2&lt;/SPAN&gt;"&lt;SPAN style="COLOR: blue"&gt;/&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="COLOR: maroon"&gt;DockPanel&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: maroon; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;Window&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;Two event handlers are defined as follows:&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;private&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt; &lt;SPAN style="COLOR: blue"&gt;void&lt;/SPAN&gt; ButtonClick1(&lt;SPAN style="COLOR: blue"&gt;object&lt;/SPAN&gt; sender, &lt;SPAN style="COLOR: teal"&gt;RoutedEventArgs&lt;/SPAN&gt; args)&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: gray; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;//Do Nothing&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;private&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt; &lt;SPAN style="COLOR: blue"&gt;void&lt;/SPAN&gt; ButtonClick2(&lt;SPAN style="COLOR: blue"&gt;object&lt;/SPAN&gt; sender, &lt;SPAN style="COLOR: teal"&gt;RoutedEventArgs&lt;/SPAN&gt; args)&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: teal; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;MessageBox&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;.Show(&lt;SPAN style="COLOR: maroon"&gt;"Button2 Just Received Click Event"&lt;/SPAN&gt;);&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;So when you click on &lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;btn2&lt;/SPAN&gt;, you see a &lt;SPAN style="FONT-SIZE: 10pt; COLOR: teal; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;MessageBox&lt;/SPAN&gt;. But when you click on &lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;btn1&lt;/SPAN&gt;, you do not see anything in particular. &lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;Now we are going to add code into &lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;ButtonClick1 &lt;/SPAN&gt;so that it will raise &lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;Click &lt;/SPAN&gt;event on &lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;btn2&lt;/SPAN&gt;. As a result, the same &lt;SPAN style="FONT-SIZE: 10pt; COLOR: teal; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;MessageBox&lt;/SPAN&gt; shows up when you click on &lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;btn1&lt;/SPAN&gt;. The code below makes use of &lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;RaiseEvent&lt;/SPAN&gt;:&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;private&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt; &lt;SPAN style="COLOR: blue"&gt;void&lt;/SPAN&gt; ButtonClick1(&lt;SPAN style="COLOR: blue"&gt;object&lt;/SPAN&gt; sender, &lt;SPAN style="COLOR: teal"&gt;RoutedEventArgs&lt;/SPAN&gt; args)&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: teal; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;RoutedEventArgs&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt; evtArgs = &lt;SPAN style="COLOR: blue"&gt;new&lt;/SPAN&gt; &lt;SPAN style="COLOR: teal"&gt;RoutedEventArgs&lt;/SPAN&gt;();&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;evtArgs.SetRoutedEventID(&lt;SPAN style="COLOR: teal"&gt;Button&lt;/SPAN&gt;.ClickEventID);&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;btn2.RaiseEvent(evtArgs);&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;Note we do not call &lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;ButtonClick2 &lt;/SPAN&gt;directly. Instead, we raise the &lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;Click &lt;/SPAN&gt;event on &lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;btn2&lt;/SPAN&gt;. &lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;ButtonClick2 &lt;/SPAN&gt;is called to handle that event.&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;I end this post with a question for my reader: What will happen if we change &lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;ButtonClick1 &lt;/SPAN&gt;code again? Are you going to see a &lt;SPAN style="FONT-SIZE: 10pt; COLOR: teal; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;MessageBox&lt;/SPAN&gt;, a &lt;SPAN style="FONT-SIZE: 10pt; COLOR: teal; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;ContextMenu&lt;/SPAN&gt; , an &lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;Exception&lt;/SPAN&gt;, or nothing at all?&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;private&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt; &lt;SPAN style="COLOR: blue"&gt;void&lt;/SPAN&gt; ButtonClick1(&lt;SPAN style="COLOR: blue"&gt;object&lt;/SPAN&gt; sender, &lt;SPAN style="COLOR: teal"&gt;RoutedEventArgs&lt;/SPAN&gt; args)&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: teal; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;RoutedEventArgs&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt; evtArgs = &lt;SPAN style="COLOR: blue"&gt;new&lt;/SPAN&gt; &lt;SPAN style="COLOR: teal"&gt;RoutedEventArgs&lt;/SPAN&gt;();&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;evtArgs.SetRoutedEventID(&lt;SPAN style="COLOR: teal"&gt;ContextMenu&lt;/SPAN&gt;.OpenedEventID);&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;btn2.RaiseEvent(evtArgs);&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;}&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT face="Times New Roman" size=3&gt;(This posting is provided "AS IS" with no warranties, and confers no rights. Use of included script samples are subject to the terms specified at http://www.microsoft.com/info/cpyright.htm)&lt;/FONT&gt;&lt;/P&gt;&lt;/SPAN&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://www.windows-now.com/aggbug.aspx?PostID=7662" width="1" height="1"&gt;</description><category domain="http://www.windows-now.com/blogs/zhanbos/archive/tags/WPF/default.aspx">WPF</category><category domain="http://www.windows-now.com/blogs/zhanbos/archive/tags/Core/default.aspx">Core</category></item></channel></rss>