人生是一场不能存盘的RPG,我只能尽量多搞几个Screenshot

December 21, 2006

WPF之窗体模型

Filed under: Windows platform

编程
1. MyApp.xaml
Define Start up window(StartupUri) for the application
<Application StartupUri = “MyWindow.xaml”/>

2.MyWindow.xaml

<Window x:Class=”MyWindow” Width=”300″ Height=”200″ Title=”">
<Button Click=”ButtonClick”>
</Button>
</Window>

3.MyWindow.cs

4.myProj.csproj

5.msbuild myProj.csproj

编译过程:
Layout,Control的设定被转化为 BAML(Binary App Markup Language), 再嵌入到resources中
BAML+ C# -> exe

实验1: 查看obj目录,包含编译的中间结果:
MyWindow.cs
MyWindow.g.cs
MyWindow.baml

实验2:查看msbuild 编译时在控制台的输出

执行流程:
SourceInitialized
Activated
Loaded
ContentRendered
Deactivated/Acrivated
Closing
Closed

交互
WindowsFormsHost(将windows control放到wpf form)
ElementHost(将wpf control 放到 windows from)
HwndHost, HwndSource(与Win32和MFC窗体/控件进行交互)

Reference
www.techjie.com

Comments »

The URI to TrackBack this entry is: http://recordsome.blogsome.com/2006/12/21/p209/trackback/

No comments yet.

RSS feed for comments on this post.

Leave a comment

Line and paragraph breaks automatic, e-mail address never displayed, HTML allowed: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <code> <em> <i> <strike> <strong>



Anti-spam measure: please retype the above text into the box provided.






















Get free blog up and running in minutes with Blogsome
Theme designed by Hadley Wickham