shi 的个人资料白驹过隙照片日志列表更多 工具 帮助

日志


6月8日

Dump control's default Style

    Windows SDK provides sample styles for WPF common controls. (located at WinFX Development / Windows Presentation Foundation / Controls / Control Customization / Overviews). But it's not the real style. If you want to see the actual style of WPF controls, please try the following code (We use button as sample here):
 
            Style style = FindResources(typeof(Button)) as Style; //Get button's default Style
            if (style != null)
            {
                XmlWriterSettings settings = new XmlWriterSettings();
                settings.Indent = true;
                settings.IndentChars = new string(' ', 4);
                StringBuilder strbuild = new StringBuilder();
                XmlWriter xmlwrite = XmlWriter.Create(strbuild, settings);
                XamlWriter.Save(style, xmlwrite);//Use XamlWriter to dump the style
                return strbuild.ToString();
            }
 
 
    The basic idea is to use FindResources(typeof(<controlname>)) to get the control's default style, then use XamlWriter to dump the style to XAML code.
6月3日

My demo is shown in Vista's introduction website

In 2004, Hong and me built a demo for ConnectUX team which can show the relationship of an organization. Because the re-org of Longhorn, our project is cut.
Today, in microsoft vista introduction website(http://www.seewindowsvista.com/), I saw the demo again. ("Turning Inform into Action"-->"Hierarchical Carousel View Prototype")
It's really exciting to see it again.