﻿<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"><channel><title>博客园-Volunteer .NET Evangelist</title><link>http://www.cnblogs.com/sheva/</link><description>A well oiled machine can’t run efficiently, if you grease it with water.</description><language>zh-cn</language><lastBuildDate>Thu, 21 Aug 2008 15:25:29 GMT</lastBuildDate><pubDate>Thu, 21 Aug 2008 15:25:29 GMT</pubDate><ttl>60</ttl><item><title>Two Xaml Tricks</title><link>http://www.cnblogs.com/sheva/archive/2006/10/03/520583.html</link><dc:creator>Sheva</dc:creator><author>Sheva</author><pubDate>Tue, 03 Oct 2006 07:18:00 GMT</pubDate><guid>http://www.cnblogs.com/sheva/archive/2006/10/03/520583.html</guid><wfw:comment>http://www.cnblogs.com/sheva/comments/520583.html</wfw:comment><comments>http://www.cnblogs.com/sheva/archive/2006/10/03/520583.html#Feedback</comments><slash:comments>2</slash:comments><wfw:commentRss>http://www.cnblogs.com/sheva/comments/commentRss/520583.html</wfw:commentRss><trackback:ping>http://www.cnblogs.com/sheva/services/trackbacks/520583.html</trackback:ping><description><![CDATA[<font face="Verdana">1. Declare array object in xaml:<br><br></font><div style="border: 1px solid rgb(204, 204, 204); padding: 4px 5px 4px 4px; background-color: rgb(238, 238, 238); font-size: 13px; width: 98%;"><!--<br><br>Code highlighting produced by Actipro CodeHighlighter (freeware)<br>http://www.CodeHighlighter.com/<br><br>--><font face="Verdana"><span style="color: rgb(0, 0, 255);">&lt;</span><span style="color: rgb(128, 0, 0);">Page&nbsp;</span><span style="color: rgb(255, 0, 0);">xmlns</span><span style="color: rgb(0, 0, 255);">="http://schemas.microsoft.com/winfx/2006/xaml/presentation"</span><span style="color: rgb(255, 0, 0);"><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;xmlns:x</span><span style="color: rgb(0, 0, 255);">="http://schemas.microsoft.com/winfx/2006/xaml"</span><span style="color: rgb(255, 0, 0);"><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;xmlns:sys</span><span style="color: rgb(0, 0, 255);">="clr-namespace:System;assembly=mscorlib"</span><span style="color: rgb(0, 0, 255);">&gt;</span><span style="color: rgb(0, 0, 0);"><br><br>&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">&lt;</span><span style="color: rgb(128, 0, 0);">Grid</span><span style="color: rgb(0, 0, 255);">&gt;</span><span style="color: rgb(0, 0, 0);"><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">&lt;</span><span style="color: rgb(128, 0, 0);">ListBox&nbsp;</span><span style="color: rgb(255, 0, 0);">Width</span><span style="color: rgb(0, 0, 255);">="200"</span><span style="color: rgb(255, 0, 0);">&nbsp;Height</span><span style="color: rgb(0, 0, 255);">="200"</span><span style="color: rgb(255, 0, 0);">&nbsp;BorderBrush</span><span style="color: rgb(0, 0, 255);">="Navy"</span><span style="color: rgb(255, 0, 0);">&nbsp;BorderThickness</span><span style="color: rgb(0, 0, 255);">="1"</span><span style="color: rgb(0, 0, 255);">&gt;</span><span style="color: rgb(0, 0, 0);"><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">&lt;</span><span style="color: rgb(128, 0, 0);">ListBox</span><span style="color: rgb(255, 0, 0);">.ItemsSource</span><span style="color: rgb(0, 0, 255);">&gt;</span><span style="color: rgb(0, 0, 0);"><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">&lt;</span><span style="color: rgb(128, 0, 0);">x:Array&nbsp;</span><span style="color: rgb(255, 0, 0);">Type</span><span style="color: rgb(0, 0, 255);">="{x:Type&nbsp;sys:String}"</span><span style="color: rgb(0, 0, 255);">&gt;</span><span style="color: rgb(0, 0, 0);"><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">&lt;</span><span style="color: rgb(128, 0, 0);">sys:String</span><span style="color: rgb(0, 0, 255);">&gt;</span><span style="color: rgb(0, 0, 0);">Paviel&nbsp;Dedved</span><span style="color: rgb(0, 0, 255);">&lt;/</span><span style="color: rgb(128, 0, 0);">sys:String</span><span style="color: rgb(0, 0, 255);">&gt;</span><span style="color: rgb(0, 0, 0);"><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">&lt;</span><span style="color: rgb(128, 0, 0);">sys:String</span><span style="color: rgb(0, 0, 255);">&gt;</span><span style="color: rgb(0, 0, 0);">Andriy&nbsp;Shevchenko</span><span style="color: rgb(0, 0, 255);">&lt;/</span><span style="color: rgb(128, 0, 0);">sys:String</span><span style="color: rgb(0, 0, 255);">&gt;</span><span style="color: rgb(0, 0, 0);"><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">&lt;</span><span style="color: rgb(128, 0, 0);">sys:String</span><span style="color: rgb(0, 0, 255);">&gt;</span><span style="color: rgb(0, 0, 0);">Paolo&nbsp;Maldini</span><span style="color: rgb(0, 0, 255);">&lt;/</span><span style="color: rgb(128, 0, 0);">sys:String</span><span style="color: rgb(0, 0, 255);">&gt;</span><span style="color: rgb(0, 0, 0);"><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">&lt;</span><span style="color: rgb(128, 0, 0);">sys:String</span><span style="color: rgb(0, 0, 255);">&gt;</span><span style="color: rgb(0, 0, 0);">Robert&nbsp;Baggio</span><span style="color: rgb(0, 0, 255);">&lt;/</span><span style="color: rgb(128, 0, 0);">sys:String</span><span style="color: rgb(0, 0, 255);">&gt;</span><span style="color: rgb(0, 0, 0);"><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">&lt;</span><span style="color: rgb(128, 0, 0);">sys:String</span><span style="color: rgb(0, 0, 255);">&gt;</span><span style="color: rgb(0, 0, 0);">Alessandro&nbsp;Del&nbsp;Piero</span><span style="color: rgb(0, 0, 255);">&lt;/</span><span style="color: rgb(128, 0, 0);">sys:String</span><span style="color: rgb(0, 0, 255);">&gt;</span><span style="color: rgb(0, 0, 0);"><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">&lt;/</span><span style="color: rgb(128, 0, 0);">x:Array</span><span style="color: rgb(0, 0, 255);">&gt;</span><span style="color: rgb(0, 0, 0);"><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">&lt;/</span><span style="color: rgb(128, 0, 0);">ListBox.ItemsSource</span><span style="color: rgb(0, 0, 255);">&gt;</span><span style="color: rgb(0, 0, 0);"><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">&lt;/</span><span style="color: rgb(128, 0, 0);">ListBox</span><span style="color: rgb(0, 0, 255);">&gt;</span><span style="color: rgb(0, 0, 0);"><br>&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">&lt;/</span><span style="color: rgb(128, 0, 0);">Grid</span><span style="color: rgb(0, 0, 255);">&gt;</span><span style="color: rgb(0, 0, 0);"><br></span><span style="color: rgb(0, 0, 255);">&lt;/</span><span style="color: rgb(128, 0, 0);">Page</span><span style="color: rgb(0, 0, 255);">&gt;</span></font></div><font face="Verdana"><br>2. </font><font face="Verdana">Declare </font><font face="Verdana">inline code in Xaml:<br><br></font><div style="border: 1px solid rgb(204, 204, 204); padding: 4px 5px 4px 4px; background-color: rgb(238, 238, 238); font-size: 13px; width: 98%;"><!--<br><br>Code highlighting produced by Actipro CodeHighlighter (freeware)<br>http://www.CodeHighlighter.com/<br><br>--><font face="Verdana"><span style="color: rgb(0, 0, 255);">&lt;</span><span style="color: rgb(128, 0, 0);">Page&nbsp;</span><span style="color: rgb(255, 0, 0);">xmlns</span><span style="color: rgb(0, 0, 255);">="http://schemas.microsoft.com/winfx/2006/xaml/presentation"</span><span style="color: rgb(255, 0, 0);">&nbsp;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;xmlns:x</span><span style="color: rgb(0, 0, 255);">="http://schemas.microsoft.com/winfx/2006/xaml"</span><span style="color: rgb(255, 0, 0);">&nbsp;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;x:Class</span><span style="color: rgb(0, 0, 255);">="MyPage"</span><span style="color: rgb(0, 0, 255);">&gt;</span><span style="color: rgb(0, 0, 0);"><br>&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">&lt;</span><span style="color: rgb(128, 0, 0);">x:Code</span><span style="color: rgb(0, 0, 255);">&gt;</span><span style="color: rgb(0, 0, 0);"><br>&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">&lt;![CDATA[</span><span style="color: rgb(128, 128, 128);"><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;private&nbsp;void&nbsp;ButtonClickEventHandler(Object&nbsp;sender,&nbsp;RoutedEventArgs&nbsp;e)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;MessageBox.Show("Hello&nbsp;Xaml!");<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br>&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">]]&gt;</span><span style="color: rgb(0, 0, 0);"><br>&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">&lt;/</span><span style="color: rgb(128, 0, 0);">x:Code</span><span style="color: rgb(0, 0, 255);">&gt;</span><span style="color: rgb(0, 0, 0);"><br>&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">&lt;</span><span style="color: rgb(128, 0, 0);">Grid</span><span style="color: rgb(0, 0, 255);">&gt;</span><span style="color: rgb(0, 0, 0);"><br>&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">&lt;</span><span style="color: rgb(128, 0, 0);">Button&nbsp;</span><span style="color: rgb(255, 0, 0);">Width</span><span style="color: rgb(0, 0, 255);">="200"</span><span style="color: rgb(255, 0, 0);">&nbsp;Height</span><span style="color: rgb(0, 0, 255);">="60"</span><span style="color: rgb(255, 0, 0);">&nbsp;Content</span><span style="color: rgb(0, 0, 255);">="Click&nbsp;Me"</span><span style="color: rgb(255, 0, 0);">&nbsp;Click</span><span style="color: rgb(0, 0, 255);">="ButtonClickEventHandler"</span><span style="color: rgb(0, 0, 255);">/&gt;</span><span style="color: rgb(0, 0, 0);"><br>&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">&lt;/</span><span style="color: rgb(128, 0, 0);">Grid</span><span style="color: rgb(0, 0, 255);">&gt;</span><span style="color: rgb(0, 0, 0);"><br></span><span style="color: rgb(0, 0, 255);">&lt;/</span><span style="color: rgb(128, 0, 0);">Page</span><span style="color: rgb(0, 0, 255);">&gt;</span></font></div><font face="Verdana"><br>&nbsp;&nbsp;&nbsp; Note that, when specifying inline code in xaml, you also need to specify the x:Class and the Xaml should be compiled before getting execution, which means that XamlReader.Load() method cannot intepret the xaml which contains inline code.<br><br></font><img src ="http://www.cnblogs.com/sheva/aggbug/520583.html?type=1" width = "1" height = "1" /><br><br><a href="http://news.cnblogs.com/n/41822/" target="_blank">[新闻]第一财经周刊:当前互联网世界正处无秩序时代</a>]]></description></item><item><title>I See Cool Stuff Today</title><link>http://www.cnblogs.com/sheva/archive/2006/09/26/515567.html</link><dc:creator>Sheva</dc:creator><author>Sheva</author><pubDate>Tue, 26 Sep 2006 12:54:00 GMT</pubDate><guid>http://www.cnblogs.com/sheva/archive/2006/09/26/515567.html</guid><wfw:comment>http://www.cnblogs.com/sheva/comments/515567.html</wfw:comment><comments>http://www.cnblogs.com/sheva/archive/2006/09/26/515567.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cnblogs.com/sheva/comments/commentRss/515567.html</wfw:commentRss><trackback:ping>http://www.cnblogs.com/sheva/services/trackbacks/515567.html</trackback:ping><description><![CDATA[&nbsp;&nbsp;&nbsp; Just paste the following xaml into the XamlPad shipped with Microsoft Windows SDK or the XamlPad I create myself, you will get some unexpected surprise, really cool indeed:<br><br><div style="border: 1px solid rgb(204, 204, 204); padding: 4px 5px 4px 4px; background-color: rgb(238, 238, 238); font-size: 13px; width: 98%;"><!--<br><br>Code highlighting produced by Actipro CodeHighlighter (freeware)<br>http://www.CodeHighlighter.com/<br><br>--><span style="color: rgb(0, 0, 255);">&lt;</span><span style="color: rgb(128, 0, 0);">Viewbox&nbsp;</span><span style="color: rgb(255, 0, 0);">xmlns</span><span style="color: rgb(0, 0, 255);">="http://schemas.microsoft.com/winfx/2006/xaml/presentation"</span><span style="color: rgb(255, 0, 0);"><br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; xmlns:x</span><span style="color: rgb(0, 0, 255);">="http://schemas.microsoft.com/winfx/2006/xaml"</span><span style="color: rgb(255, 0, 0);"> <br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; Margin</span><span style="color: rgb(0, 0, 255);">="10"</span><span style="color: rgb(255, 0, 0);"> <br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; OpacityMask</span><span style="color: rgb(0, 0, 255);">="#99000000"</span><span style="color: rgb(0, 0, 255);">&gt;<br>&nbsp;&nbsp;&nbsp; &lt;</span><span style="color: rgb(128, 0, 0);">Button</span><span style="color: rgb(0, 0, 255);">/&gt;<br>&lt;/</span><span style="color: rgb(128, 0, 0);">Viewbox</span><span style="color: rgb(0, 0, 255);">&gt;</span></div><br>&nbsp;&nbsp;&nbsp; This is what I get in my own XamlPad:<br><br><img src="http://www.cnblogs.com/images/cnblogs_com/sheva/48805/r_CoolStuff.JPG"><br><br><img src ="http://www.cnblogs.com/sheva/aggbug/515567.html?type=1" width = "1" height = "1" /><br><br><a href="http://news.cnblogs.com/n/41820/" target="_blank">[新闻]Visual Studio 2008 SDK 1.1 发布</a>]]></description></item><item><title>DataTemplate Is A Bit Naughtier To Play With</title><link>http://www.cnblogs.com/sheva/archive/2006/09/23/512977.html</link><dc:creator>Sheva</dc:creator><author>Sheva</author><pubDate>Sat, 23 Sep 2006 15:05:00 GMT</pubDate><guid>http://www.cnblogs.com/sheva/archive/2006/09/23/512977.html</guid><wfw:comment>http://www.cnblogs.com/sheva/comments/512977.html</wfw:comment><comments>http://www.cnblogs.com/sheva/archive/2006/09/23/512977.html#Feedback</comments><slash:comments>2</slash:comments><wfw:commentRss>http://www.cnblogs.com/sheva/comments/commentRss/512977.html</wfw:commentRss><trackback:ping>http://www.cnblogs.com/sheva/services/trackbacks/512977.html</trackback:ping><description><![CDATA[摘要:  Some one pointed out on MSDN WPF forum post that FindName breaks on DataTemplate, when we want to reference the visual elements inside the data template, we cannot use FindName, then what we can use?&nbsp;&nbsp;<a href='http://www.cnblogs.com/sheva/archive/2006/09/23/512977.html'>阅读全文</a><img src ="http://www.cnblogs.com/sheva/aggbug/512977.html?type=1" width = "1" height = "1" /><br><br><a href="http://news.cnblogs.com/n/41821/" target="_blank">[新闻]死敌VMware变身微软认证计划新成员</a>]]></description></item><item><title>XmlnsDefinitionAttribute Is Pretty Nifty</title><link>http://www.cnblogs.com/sheva/archive/2006/08/28/488915.html</link><dc:creator>Sheva</dc:creator><author>Sheva</author><pubDate>Mon, 28 Aug 2006 15:37:00 GMT</pubDate><guid>http://www.cnblogs.com/sheva/archive/2006/08/28/488915.html</guid><wfw:comment>http://www.cnblogs.com/sheva/comments/488915.html</wfw:comment><comments>http://www.cnblogs.com/sheva/archive/2006/08/28/488915.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cnblogs.com/sheva/comments/commentRss/488915.html</wfw:commentRss><trackback:ping>http://www.cnblogs.com/sheva/services/trackbacks/488915.html</trackback:ping><description><![CDATA[<font face="Verdana">&nbsp;&nbsp;&nbsp; When we want to declaratively use our custom controls or reference the types we defined in XAML, we should declare the XML namespace to map to the CLR namespace in which the controls and types are defined as the following XAML snippt demonstrates:<br><br><div style="border: 1px solid rgb(204, 204, 204); padding: 4px 5px 4px 4px; background-color: rgb(238, 238, 238); font-size: 13px; width: 98%;"><!--<br><br>Code highlighting produced by Actipro CodeHighlighter (freeware)<br>http://www.CodeHighlighter.com/<br><br>--><span style="color: rgb(0, 0, 255);">&lt;Page</span><span style="color: rgb(255, 0, 0);"> x:Class</span><span style="color: rgb(0, 0, 255);">="Test.MainWindow"</span><span style="color: rgb(255, 0, 0);"><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; xmlns</span><span style="color: rgb(0, 0, 255);">="http://schemas.microsoft.com/winfx/2006/xaml/presentation"</span><span style="color: rgb(255, 0, 0);">&nbsp;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; xmlns:x</span><span style="color: rgb(0, 0, 255);">="http://schemas.microsoft.com/winfx/2006/xaml"</span><span style="color: rgb(255, 0, 0);"><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; xmlns:cc</span><span style="color: rgb(0, 0, 255);">="clr-namespace:Sheva.Windows.Controls;assembly=AvalonLib"</span><span style="color: rgb(255, 0, 0);"></span><span style="color: rgb(0, 0, 255);"></span><span style="color: rgb(255, 0, 0);"></span><span style="color: rgb(0, 0, 255);"></span><span style="color: rgb(255, 0, 0);"></span><span style="color: rgb(255, 0, 0);"><br></span><span style="color: rgb(0, 0, 255);"></span><span style="color: rgb(255, 0, 0);"></span><span style="color: rgb(0, 0, 255);">/&gt;</span></div><br>&nbsp;&nbsp;&nbsp; Recently, I am heavily engaged with writing a resuable WPF control library, and quite often I need to create some pages to test those controls I create, so ever now and then I have to use the cumbersome syntax like above to declare the XML namespace, personally I don't like the syntax, and I thought Microsoft WPF team should come up with a more elegant way of doing it, and in actuality, they did introduce an alternative to do it since the CTP releases. there is a custom attribute called XmlnsDefinitionAttribute in the System.Windows.Markup namespace which allows you to apply to the assembly which contains the types and controls the XAML code would reference.the built-in WPF assemblies such as WindowsBase.dll, PresentationCore.dll, and PresentationFramework.dll all have this attribute applied, and all have <a href="xmlns=%22http://schemas.microsoft.com/winfx/2006/xaml/presentation%22">http://schemas.microsoft.com/winfx/2006/xaml/presentation</a> namespace mapped with the CLR namespaces introduced by them. and of cause you can use this attribute in your own project, just open the AssemblyInfo.cs file, and append the following directive:<br><br><div style="border: 1px solid rgb(204, 204, 204); padding: 4px 5px 4px 4px; background-color: rgb(238, 238, 238); font-size: 13px; width: 98%;"><!--<br><br>Code highlighting produced by Actipro CodeHighlighter (freeware)<br>http://www.CodeHighlighter.com/<br><br>--><span style="color: rgb(0, 0, 0);">[assembly:&nbsp;XmlnsDefinition(</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">http://schemas.sheva.com/wpf/</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">,&nbsp;</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">Sheva.Windows.Controls</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">)]</span></div><br>&nbsp;&nbsp;&nbsp; Then you can declare the namespace alias in XAML this way:<br><br></font><div style="border: 1px solid rgb(204, 204, 204); padding: 4px 5px 4px 4px; background-color: rgb(238, 238, 238); font-size: 13px; width: 98%;"><!--<br><br>Code highlighting produced by Actipro CodeHighlighter (freeware)<br>http://www.CodeHighlighter.com/<br><br>--><font face="Verdana"><span style="color: rgb(0, 0, 255);">&lt;</span><span style="color: rgb(128, 0, 0);">Page&nbsp;</span><span style="color: rgb(255, 0, 0);">x:Class</span><span style="color: rgb(0, 0, 255);">="Test.MainWindow"</span><span style="color: rgb(255, 0, 0);"><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; xmlns</span><span style="color: rgb(0, 0, 255);">="http://schemas.microsoft.com/winfx/2006/xaml/presentation"</span><span style="color: rgb(255, 0, 0);">&nbsp;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; xmlns:x</span><span style="color: rgb(0, 0, 255);">="http://schemas.microsoft.com/winfx/2006/xaml"</span><span style="color: rgb(255, 0, 0);"><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; xmlns:cc</span><span style="color: rgb(0, 0, 255);">="http://schemas.sheva.com/wpf/"</span><span style="color: rgb(255, 0, 0);"><br></span><span style="color: rgb(0, 0, 255);">/&gt;</span></font></div><font face="Verdana">&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; Wow, this is a bit like the built-in xmlns declaration indeed, really really cool indeed:)<br></font><font face="Verdana"><span style="color: rgb(0, 0, 255);"></span></font><img src ="http://www.cnblogs.com/sheva/aggbug/488915.html?type=1" width = "1" height = "1" /><br><br><a href="http://news.cnblogs.com/n/41819/" target="_blank">[新闻]英特尔雅虎开发网络计算机频道</a>]]></description></item><item><title>Application.DoEvents In WPF</title><link>http://www.cnblogs.com/sheva/archive/2006/08/24/485790.html</link><dc:creator>Sheva</dc:creator><author>Sheva</author><pubDate>Thu, 24 Aug 2006 15:56:00 GMT</pubDate><guid>http://www.cnblogs.com/sheva/archive/2006/08/24/485790.html</guid><wfw:comment>http://www.cnblogs.com/sheva/comments/485790.html</wfw:comment><comments>http://www.cnblogs.com/sheva/archive/2006/08/24/485790.html#Feedback</comments><slash:comments>2</slash:comments><wfw:commentRss>http://www.cnblogs.com/sheva/comments/commentRss/485790.html</wfw:commentRss><trackback:ping>http://www.cnblogs.com/sheva/services/trackbacks/485790.html</trackback:ping><description><![CDATA[<font face="Verdana">&nbsp;&nbsp;&nbsp; Recently, I am tied up writing a custom WPF control called FolderPicker, and I come to the scenario that when I update the data source, I want to let the UI thread to update the control UI, basically, at this time, I should force the dispatcher to process the layout message, in Windows Forms application, If we want to process the windows message such as WM_SIZE, WM_PAINT messages in an event handler, we can call the Application.DoEvents(), then how about in WPF?<br>&nbsp;&nbsp;&nbsp; Actually, WPF doesn't provide such an API, the reason is a bit complicated, and really worth a new post contributing to it, then how to implement such kinda API in WPF, after some examination on this problem, and thanks to Kevin Moore's WPF samples code and Ian Griffiths helpful tips, I finally come up with my own implementation of Application.DoEvents logic.<br>&nbsp;&nbsp;  </font>
<div style="background: white none repeat scroll 0%; font-family: Verdana; font-size: 9pt; color: black; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;">
<p style="margin: 0px;"><span style="color: blue;">using</span> System;</p>
<p style="margin: 0px;"><span style="color: blue;">using</span> System.Windows;</p>
<p style="margin: 0px;"><span style="color: blue;">using</span> System.Windows.Threading;</p>
<p style="margin: 0px;">&nbsp;</p>
<p style="margin: 0px;"><span style="color: blue;">namespace</span> Sheva.Windows</p>
<p style="margin: 0px;">{</p>
<p style="margin: 0px;">&nbsp;&nbsp;&nbsp; <span style="color: gray;">///</span><span style="color: green;"> </span><span style="color: gray;">&lt;summary&gt;</span></p>
<p style="margin: 0px;">&nbsp;&nbsp;&nbsp; <span style="color: gray;">///</span><span style="color: green;"> Designates a Windows Presentation Foundation application model with added functionalities.</span></p>
<p style="margin: 0px;">&nbsp;&nbsp;&nbsp; <span style="color: gray;">///</span><span style="color: green;"> </span><span style="color: gray;">&lt;/summary&gt;</span></p>
<p style="margin: 0px;">&nbsp;&nbsp;&nbsp; <span style="color: blue;">public</span> <span style="color: blue;">class</span> <span style="color: teal;">WpfApplication</span> : Application</p>
<p style="margin: 0px;">&nbsp;&nbsp;&nbsp; {</p>
<p style="margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <span style="color: blue;">private</span> <span style="color: blue;">static</span> DispatcherOperationCallback exitFrameCallback = <span style="color: blue;">new</span> </p>
<p style="margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; DispatcherOperationCallback(ExitFrame);</p>
<p style="margin: 0px;">&nbsp;</p>
<p style="margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <span style="color: gray;">///</span><span style="color: green;"> </span><span style="color: gray;">&lt;summary&gt;</span></p>
<p style="margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <span style="color: gray;">///</span><span style="color: green;"> Processes all UI messages currently in the message queue.</span></p>
<p style="margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <span style="color: gray;">///</span><span style="color: green;"> </span><span style="color: gray;">&lt;/summary&gt;</span></p>
<p style="margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <span style="color: blue;">public</span> <span style="color: blue;">static</span> <span style="color: blue;">void</span> DoEvents()</p>
<p style="margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; {</p>
<p style="margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <span style="color: green;">// Create new nested message pump.</span></p>
<p style="margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; DispatcherFrame nestedFrame = <span style="color: blue;">new</span> DispatcherFrame();</p>
<p style="margin: 0px;">&nbsp;</p>
<p style="margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <span style="color: green;">// Dispatch a callback to the current message queue, when getting called, </span></p>
<p style="margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <span style="color: green;">// this callback will end the nested message loop.</span></p>
<p style="margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <span style="color: green;">// note that the priority of this callback should be lower than the that of UI event messages.</span></p>
<p style="margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; DispatcherOperation exitOperation = Dispatcher.CurrentDispatcher.BeginInvoke(</p>
<p style="margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp; DispatcherPriority.Background, exitFrameCallback, nestedFrame);</p>
<p style="margin: 0px;">&nbsp;</p>
<p style="margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <span style="color: green;">// pump the nested message loop, the nested message loop will </span></p>
<p style="margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <span style="color: green;">// immediately process the messages left inside the message queue.</span></p>
<p style="margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; Dispatcher.PushFrame(nestedFrame);</p>
<p style="margin: 0px;">&nbsp;</p>
<p style="margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <span style="color: green;">// If the "exitFrame" callback doesn't get finished, Abort it.</span></p>
<p style="margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <span style="color: blue;">if</span> (exitOperation.Status != DispatcherOperationStatus.Completed)</p>
<p style="margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; {</p>
<p style="margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; exitOperation.Abort();</p>
<p style="margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }</p>
<p style="margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }</p>
<p style="margin: 0px;">&nbsp;</p>
<p style="margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <span style="color: blue;">private</span> <span style="color: blue;">static</span> <span style="color: teal;">Object</span> ExitFrame(<span style="color: teal;">Object</span> state)</p>
<p style="margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; {</p>
<p style="margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; DispatcherFrame frame = state <span style="color: blue;">as</span> DispatcherFrame;</p>
<p style="margin: 0px;">&nbsp;</p>
<p style="margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <span style="color: green;">// Exit the nested message loop.</span></p>
<p style="margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; frame.Continue = <span style="color: blue;">false</span>;</p>
<p style="margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <span style="color: blue;">return</span> <span style="color: blue;">null</span>;</p>
<p style="margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }</p>
<p style="margin: 0px;">&nbsp;&nbsp;&nbsp; }</p>
<p style="margin: 0px;">}</p>
</div>

<br><font face="Verdana">&nbsp;&nbsp;&nbsp; The theory behind the code shown above is that when pushing a nested message 
loop, the nested message loop will immediately process the messages in the 
queue, so the layout or other window messages can get processed. But you should 
avoid using nested message loop if at all possible, because as Ian Griffths 
says:"</font><font color="#ff0000" face="Verdana">bad things happen when you nest message pumps.</font><font face="Verdana">" 
what does this mean? let me save it for another day:)<br>&nbsp;&nbsp;&nbsp; Edit: <a href="http://blogs.msdn.com/jfoscoding/default.aspx">Jessica Fosler</a> has wrriten <a href="http://blogs.msdn.com/jfoscoding/archive/2005/08/06/448560.aspx">an awesome article</a> on Application.DoEvents which is really worth a read.<br></font><img src ="http://www.cnblogs.com/sheva/aggbug/485790.html?type=1" width = "1" height = "1" /><br><br><a href="http://news.cnblogs.com/n/41818/" target="_blank">[新闻]Windows Live视频邮件9月9日开始测试</a>]]></description></item><item><title>征召译者</title><link>http://www.cnblogs.com/sheva/archive/2006/08/17/479818.html</link><dc:creator>Sheva</dc:creator><author>Sheva</author><pubDate>Thu, 17 Aug 2006 12:25:00 GMT</pubDate><guid>http://www.cnblogs.com/sheva/archive/2006/08/17/479818.html</guid><wfw:comment>http://www.cnblogs.com/sheva/comments/479818.html</wfw:comment><comments>http://www.cnblogs.com/sheva/archive/2006/08/17/479818.html#Feedback</comments><slash:comments>21</slash:comments><wfw:commentRss>http://www.cnblogs.com/sheva/comments/commentRss/479818.html</wfw:commentRss><trackback:ping>http://www.cnblogs.com/sheva/services/trackbacks/479818.html</trackback:ping><description><![CDATA[<font face="Verdana">&nbsp;&nbsp;&nbsp; 现电子工业出版社急招四名翻译人员来翻译Charles Petzold刚刚出炉的新书《Applications = Code + Markup》，要求译者熟悉Windows桌面程序的开发，熟悉.NET编程，对WPF有一定的了解，并具有很强的英语翻译能力。稿费，翻译内容分工等具体事宜容日后再议，请有意者速与我或是</font><span id="_user_fordin@gmail.com">梁晶联系。</span><br><font face="Verdana">联系人：<br></font><span id="_user_fordin@gmail.com">梁晶</span><font face="Verdana">(Dinla) (电子工业出版社编辑)&nbsp; <br></font><font face="Verdana">email: fordin at gmail dot com<br>msn: ccnulj at msn dot com<br></font><font face="Verdana"><br>周勇(Sheva)<br></font><font face="Verdana">email: footballism at gmail dot com<br>msn : footballism at hotmail dot com<br><br>PS:往dudu让我把这个帖子搁在精华区几天:)，先谢过了！！！<br></font><img src ="http://www.cnblogs.com/sheva/aggbug/479818.html?type=1" width = "1" height = "1" /><br><br><a href="http://news.cnblogs.com/n/41817/" target="_blank">[新闻]Intel首次公开展示Nehalem架构迅驰3平台</a>]]></description></item><item><title>C# Trivia Test</title><link>http://www.cnblogs.com/sheva/archive/2006/05/06/392802.html</link><dc:creator>Sheva</dc:creator><author>Sheva</author><pubDate>Sat, 06 May 2006 12:28:00 GMT</pubDate><guid>http://www.cnblogs.com/sheva/archive/2006/05/06/392802.html</guid><wfw:comment>http://www.cnblogs.com/sheva/comments/392802.html</wfw:comment><comments>http://www.cnblogs.com/sheva/archive/2006/05/06/392802.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cnblogs.com/sheva/comments/commentRss/392802.html</wfw:commentRss><trackback:ping>http://www.cnblogs.com/sheva/services/trackbacks/392802.html</trackback:ping><description><![CDATA[&nbsp;<font face="Verdana">&nbsp;&nbsp; Eric Gunnerson just brings up <a href="http://blogs.msdn.com/ericgu/archive/2006/05/03/589203.aspx">a series of posts</a> on some C# trivia that probably most developers don't know about, I just quote some of them which are more relevant to the C# technicality:</font><br><p><font face="Verdana"><strong>Language Details</strong></font></p>



<p><font face="Verdana">1) How is decimal different from other C# types?<br>2) What kind of constructor is not legal on structs? Why?<br>3) What’s the difference between “out” and “[out]”?<br>4) When you write </font><font face="Verdana">ulong, what does the runtime see?</font><br><font face="Verdana">5) When can a readonly field be assigned to?<br>6) How many loop constructs does C# have, and what are they?<br>7) What is the difference between “ref” and “out”?<br></font></p><font face="Verdana"></font>





<p><font face="Verdana"><strong>C# and the Runtime</strong><br><br>1) What interfaces does foreach use in C# 1.1? What about 2.0?<br>2) What is the name of the attribute that controls the usage of an attribute?<br>3) What does </font><font face="Verdana">[FieldOffset(12)] do?<br>4) What does [IndexerName(“Fred”)] do? Why would you use it?</font><br><font face="Verdana"><span style="font-size: 12pt; font-family: 'Times New Roman';"><span style="font-size: 12pt; font-family: 'Times New Roman';"></span></span><br>Do you know the answers?</font><br></p><img src ="http://www.cnblogs.com/sheva/aggbug/392802.html?type=1" width = "1" height = "1" /><br><br><a href="http://news.cnblogs.com/n/41816/" target="_blank">[新闻]Pogo浏览器</a>]]></description></item><item><title>CreateParams Is Pretty Cool!</title><link>http://www.cnblogs.com/sheva/archive/2006/04/29/389084.html</link><dc:creator>Sheva</dc:creator><author>Sheva</author><pubDate>Sat, 29 Apr 2006 15:30:00 GMT</pubDate><guid>http://www.cnblogs.com/sheva/archive/2006/04/29/389084.html</guid><wfw:comment>http://www.cnblogs.com/sheva/comments/389084.html</wfw:comment><comments>http://www.cnblogs.com/sheva/archive/2006/04/29/389084.html#Feedback</comments><slash:comments>7</slash:comments><wfw:commentRss>http://www.cnblogs.com/sheva/comments/commentRss/389084.html</wfw:commentRss><trackback:ping>http://www.cnblogs.com/sheva/services/trackbacks/389084.html</trackback:ping><description><![CDATA[<font face="Verdana">&nbsp;&nbsp;&nbsp; Probably I've been in the WPF world for so long that I need to try something different, yesterday, I come across a <a href="http://channel9.msdn.com/ShowPost.aspx?PostID=186469">Channel9 forum thread</a> on how to use windows forms' Control.CreateParams property, which give me some light on how to customize the style of classical Win32 window.<br>&nbsp;&nbsp;&nbsp; First thing I plan to do is make the System.Windows.Forms.Form window support dropshadow, then I write a custom NumberBox control which only accepts numbers, traditionaly if you want a TexBox to only accept numbers, you can hookup it's KeyDown event to verify the actual keyboard input, in this post, I will show another way to do it, aka using edit control style as the following code demonstrates:<div style="border: 1px solid rgb(204, 204, 204); padding: 4px 5px 4px 4px; background-color: rgb(238, 238, 238); font-size: 13px; width: 98%;"><!--<br><br>Code highlighting produced by Actipro CodeHighlighter (freeware)<br>http://www.CodeHighlighter.com/<br><br>--><span style="color: rgb(0, 0, 255);">using</span><span style="color: rgb(0, 0, 0);">&nbsp;System;<br></span><span style="color: rgb(0, 0, 255);">using</span><span style="color: rgb(0, 0, 0);">&nbsp;System.Windows.Forms;<br></span><span style="color: rgb(0, 0, 255);">using</span><span style="color: rgb(0, 0, 0);">&nbsp;System.Runtime.InteropServices;<br><br></span><span style="color: rgb(0, 0, 255);">namespace</span><span style="color: rgb(0, 0, 0);">&nbsp;CreateParamsDemo<br>{<br>&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">public</span><span style="color: rgb(0, 0, 0);">&nbsp;partial&nbsp;</span><span style="color: rgb(0, 0, 255);">class</span><span style="color: rgb(0, 0, 0);">&nbsp;MyCustomForm&nbsp;:&nbsp;Form<br>&nbsp;&nbsp;&nbsp;&nbsp;{<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">private</span><span style="color: rgb(0, 0, 0);">&nbsp;</span><span style="color: rgb(0, 0, 255);">static</span><span style="color: rgb(0, 0, 0);">&nbsp;Int32&nbsp;CS_DROPSHADOW&nbsp;</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">&nbsp;</span><span style="color: rgb(0, 0, 0);">0x00020000</span><span style="color: rgb(0, 0, 0);">;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">public</span><span style="color: rgb(0, 0, 0);">&nbsp;MyCustomForm()<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;InitializeComponent();<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;NumberBox&nbsp;box&nbsp;</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">&nbsp;</span><span style="color: rgb(0, 0, 255);">new</span><span style="color: rgb(0, 0, 0);">&nbsp;NumberBox();<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;box.Multiline&nbsp;</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">&nbsp;</span><span style="color: rgb(0, 0, 255);">true</span><span style="color: rgb(0, 0, 0);">;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;box.Dock&nbsp;</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">&nbsp;DockStyle.Fill;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">this</span><span style="color: rgb(0, 0, 0);">.Controls.Add(box);<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">protected</span><span style="color: rgb(0, 0, 0);">&nbsp;</span><span style="color: rgb(0, 0, 255);">override</span><span style="color: rgb(0, 0, 0);">&nbsp;CreateParams&nbsp;CreateParams<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">get</span><span style="color: rgb(0, 0, 0);"><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;CreateParams&nbsp;parameters&nbsp;</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">&nbsp;</span><span style="color: rgb(0, 0, 255);">base</span><span style="color: rgb(0, 0, 0);">.CreateParams;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;parameters.ClassStyle&nbsp;</span><span style="color: rgb(0, 0, 0);">|=</span><span style="color: rgb(0, 0, 0);">&nbsp;CS_DROPSHADOW;<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">return</span><span style="color: rgb(0, 0, 0);">&nbsp;parameters;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br>&nbsp;&nbsp;&nbsp;&nbsp;}<br><br>&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">public</span><span style="color: rgb(0, 0, 0);">&nbsp;</span><span style="color: rgb(0, 0, 255);">class</span><span style="color: rgb(0, 0, 0);">&nbsp;NumberBox&nbsp;:&nbsp;TextBox<br>&nbsp;&nbsp;&nbsp;&nbsp;{<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">private</span><span style="color: rgb(0, 0, 0);">&nbsp;</span><span style="color: rgb(0, 0, 255);">static</span><span style="color: rgb(0, 0, 0);">&nbsp;Int32&nbsp;ES_NUMBER&nbsp;</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">&nbsp;</span><span style="color: rgb(0, 0, 0);">0x2000</span><span style="color: rgb(0, 0, 0);">;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">protected</span><span style="color: rgb(0, 0, 0);">&nbsp;</span><span style="color: rgb(0, 0, 255);">override</span><span style="color: rgb(0, 0, 0);">&nbsp;CreateParams&nbsp;CreateParams<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">get</span><span style="color: rgb(0, 0, 0);"><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;CreateParams&nbsp;parameters&nbsp;</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">&nbsp;</span><span style="color: rgb(0, 0, 255);">base</span><span style="color: rgb(0, 0, 0);">.CreateParams;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;parameters.Style&nbsp;</span><span style="color: rgb(0, 0, 0);">|=</span><span style="color: rgb(0, 0, 0);">&nbsp;ES_NUMBER;<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">return</span><span style="color: rgb(0, 0, 0);">&nbsp;parameters;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br>&nbsp;&nbsp;&nbsp;&nbsp;}<br>}</span></div>&nbsp;&nbsp;  Now, the code is up and ready for running, here comes the screenshot:<br><br>&nbsp;<img src="http://www.cnblogs.com/images/cnblogs_com/sheva/48805/r_CreateParamsDemo.PNG"><br><br>&nbsp;&nbsp;&nbsp; Please pay closer attention to the shadow around the window border, you will get the dropshadow for the window, and if you press any key except number keys, a balloon tool tip will show up, saying "Unacceptable Character", the implementation is quite simple, but you can actually get your job done quickly, you know, sometimes, simple approach is the best:)<br><br><br></font><img src ="http://www.cnblogs.com/sheva/aggbug/389084.html?type=1" width = "1" height = "1" /><br><br><a href="http://news.cnblogs.com/n/41807/" target="_blank">[新闻]洪磊口述:番茄花园如何捆绑流氓软件月入十万</a>]]></description></item><item><title>In-Place Editing In WPF</title><link>http://www.cnblogs.com/sheva/archive/2006/04/27/387008.html</link><dc:creator>Sheva</dc:creator><author>Sheva</author><pubDate>Thu, 27 Apr 2006 15:03:00 GMT</pubDate><guid>http://www.cnblogs.com/sheva/archive/2006/04/27/387008.html</guid><wfw:comment>http://www.cnblogs.com/sheva/comments/387008.html</wfw:comment><comments>http://www.cnblogs.com/sheva/archive/2006/04/27/387008.html#Feedback</comments><slash:comments>6</slash:comments><wfw:commentRss>http://www.cnblogs.com/sheva/comments/commentRss/387008.html</wfw:commentRss><trackback:ping>http://www.cnblogs.com/sheva/services/trackbacks/387008.html</trackback:ping><description><![CDATA[摘要:  Several days ago, Dflying Chen just shown us how to implement in-place editing functionality using ASP.NET Atlas framework, and the custom control he writes called InPlaceEditingInput is pretty cool &nbsp;&nbsp;<a href='http://www.cnblogs.com/sheva/archive/2006/04/27/387008.html'>阅读全文</a><img src ="http://www.cnblogs.com/sheva/aggbug/387008.html?type=1" width = "1" height = "1" /><br><br><a href="http://news.cnblogs.com/n/41813/" target="_blank">[新闻]2008年8月21日IT博客精选：盖茨复出？</a>]]></description></item><item><title>SingleLinkedList Implementation</title><link>http://www.cnblogs.com/sheva/archive/2006/04/23/383052.html</link><dc:creator>Sheva</dc:creator><author>Sheva</author><pubDate>Sun, 23 Apr 2006 15:43:00 GMT</pubDate><guid>http://www.cnblogs.com/sheva/archive/2006/04/23/383052.html</guid><wfw:comment>http://www.cnblogs.com/sheva/comments/383052.html</wfw:comment><comments>http://www.cnblogs.com/sheva/archive/2006/04/23/383052.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cnblogs.com/sheva/comments/commentRss/383052.html</wfw:commentRss><trackback:ping>http://www.cnblogs.com/sheva/services/trackbacks/383052.html</trackback:ping><description><![CDATA[摘要: ILinkedList interface definitionCode highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->usingSystem;usingSystem.Collections.Generic;namespaceSheva.Collections&nbsp;&nbsp;<a href='http://www.cnblogs.com/sheva/archive/2006/04/23/383052.html'>阅读全文</a><img src ="http://www.cnblogs.com/sheva/aggbug/383052.html?type=1" width = "1" height = "1" /><br><br><a href="http://news.cnblogs.com/n/41812/" target="_blank">[新闻]微软宣布将斥资1亿美元购买Novell证书</a>]]></description></item></channel></rss>