ComboBoxEdit 数据绑定 使用模板

1)定义模板资源

   <UserControl.Resources>
<local:StatusConvertor x:Key="StatusConvertor"></local:StatusConvertor>
<cvt:FullNameConverter x:Key="fullNameConverter"></cvt:FullNameConverter> <DataTemplate x:Key="doctorTemplate">
<TextBlock Text="{Binding .,Converter={StaticResource ResourceKey=fullNameConverter}}" Margin="4,0,0,0"></TextBlock>
</DataTemplate> </UserControl.Resources>

2)使用模板资源

<dxe:ComboBoxEdit Name="comboBoxEdit_Doctor"
ApplyItemTemplateToSelectedItem="True"
ItemTemplate="{StaticResource ResourceKey=doctorTemplate}"
IsTextEditable="False" ShowCustomItems="True"
Margin="0,1" Width="300" HorizontalAlignment="Left"
SelectedIndexChanged="comboBoxEdit_Doctor_SelectedIndexChanged" />
上一篇:浅析python中socketserver模块使用


下一篇:LLVM在静态分析上的增强 @ WWDC 2013