Chinaunix首页 | 论坛 | 博客
  • 博客访问: 5096787
  • 博文数量: 1696
  • 博客积分: 10870
  • 博客等级: 上将
  • 技术积分: 18357
  • 用 户 组: 普通用户
  • 注册时间: 2007-03-30 15:16
文章分类
文章存档

2017年(1)

2016年(1)

2015年(1)

2013年(1)

2012年(43)

2011年(17)

2010年(828)

2009年(568)

2008年(185)

2007年(51)

分类: 嵌入式

2010-09-27 19:20:23

先说点题外话:
写blog的缘由来自于自己学习的过程中诸多痛苦,看了就忘,忘了再看。唉真是人老了,记忆力不行了。
所以突然响了了blog,老做潜水员,这次也借机浮出水面一下。把学的过程中的一些东西记录下啦。

主要教材:
1. MSDN
2. Sams.Windows.Presentation.Foundation.Unleashed.Dec.2006
3. OReilly.Programming.WPF.2nd.Edition.Aug.2007.eBook-BBL

由于没太写过东西,加之时间较为紧张,很多东西直接转载MSDN,或翻译上述2本书。
希望没人骂我太懒就好。

=========================================================================

WPF程序集中使用多个XmlnsDefinitionAttribute的一个硬编码
NameSpace 定义支持向下嵌套

----------------------------------------------------------------------------------------------xmlns=""
对应的.NET的命名空间:
System.Windows.Markup

映射单独的可扩展应用程序标记语言 (XAML) 命名空间,通常将其映射为x:前缀。
xmlns:x=""

----------------------------------------------------------------------------------------------
xmlns=”/presentation”
将整个 Windows Presentation Foundation (WPF) 命名空间映射为默认命名空间:

对应的.NET的命名空间:
. System.Windows
. System.Windows.Automation
. System.Windows.Controls
. System.Windows.Controls.Primitives
. System.Windows.Data
. System.Windows.Documents
. System.Windows.Forms.Integration
. System.Windows.Ink
. System.Windows.Input
. System.Windows.Media
. System.Windows.Media.Animation
. System.Windows.Media.Effects
. System.Windows.Media.Imaging
. System.Windows.Media.Media3D
. System.Windows.Media.TextFormatting
. System.Windows.Navigation
. System.Windows.Shapes

----------------------------------------------------------------------------------------------
自定义增加NameSpace:
xmlns:custom="clr-namespace:SDKSample;assembly=SDKSampleLibrary"

Sample:

<my:WindowsFormsHost Height="100" Name="windowsFormsHost1" xmlns:my="clr-namespace:System.Windows.Forms.Integration;assembly=WindowsFormsIntegration" />

<Window x:Class="WpfApplication7.Window1"
xmlns
="/presentation"
xmlns:x
=""
Title
="Window1" Height="300" Width="300" >

----------------------------------------------------------------------------------------------
使用NameSpaceSample

1.  全局

<Window x:Class="NonRectangularWindowSample.Window1"
xmlns
="/presentation"
xmlns:x
=""
>
    
<Grid>
        
<Button >ButtonButton>
    
Grid>
Window>

 2. 独立使用

<Button xmlns="/presentation">
Button
Button>

3. 使用前缀

<y:Window
x:Class
="NonRectangularWindowSample.Window1"
xmlns:y
="/presentation"
xmlns:x
=""
Title
="Window1" Height="300" Width="300">
    
<y:Grid>
        
<y:Button>Buttony:Button>
    
y:Grid>
y:Window>
阅读(890) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~