WPF,请教x:Type标记扩展的用法 XAML中的x:Type标记扩展,是怎么用的?一般用在哪些地方?请老师一定举个小小的例子说明一下,本人就清楚了。谢谢了 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 举例子就行了,MSDN链接我有了 后面的字符串将被解释为Type类型,比如:<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:local="clr-namespace:WpfControlLibrary"> <Style TargetType="{x:Type local:BasePage}"> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="{x:Type local:BasePage}"> <Grid Background="White" Opacity="0.8"> <Grid Name="ToolbarGrid" Height="48" VerticalAlignment="Top" Background="Red"> <Label Content="这是父类模板里的内容" /> </Grid> <Grid Name="MainGrid" Margin="0,48,0,0"> <ContentPresenter /> </Grid> </Grid> </ControlTemplate> </Setter.Value> </Setter> </Style></ResourceDictionary>这里面的TargetType属性,需要传递一个Type类型的值,因此用x:Type来修饰。 关于窗体继承的内部实现. 能不能写一个WIN程序配置WCF的config文件? c#递归函数 电信的10M光纤到公司机房,要满足几样的需求,需要什么路由器? 关于case语句 treeview框架的数据更新 搜索文档中的文件 正则表达式的问题 web service 能用https 协议吗?怎么设置iis啊?? 这样从ORACLE里取数错了吗? 百思不得其解——一个很基础的问题,烦请大侠帮忙看看 【100分】遇到了一些说不清楚的问题,大家进来看看 出出主意吧
<ResourceDictionary
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:WpfControlLibrary">
<Style TargetType="{x:Type local:BasePage}">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type local:BasePage}">
<Grid Background="White" Opacity="0.8">
<Grid Name="ToolbarGrid" Height="48" VerticalAlignment="Top" Background="Red">
<Label Content="这是父类模板里的内容" />
</Grid>
<Grid Name="MainGrid" Margin="0,48,0,0">
<ContentPresenter />
</Grid>
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</ResourceDictionary>
这里面的TargetType属性,需要传递一个Type类型的值,因此用x:Type来修饰。