Lew*_*rin 4 c# wpf xaml datatemplate
<Grid>
<ItemsControl ItemsSource="{Binding ScreenViewModelCollection}">
<ItemsControl.Resources>
<DataTemplate x:Key="SomeKey" TargetType="{x:Type local:RedScreenObject}">
<local:RedScreenObject/>
</DataTemplate>
</ItemsControl.Resources>
</ItemsControl>
</Grid>
Run Code Online (Sandbox Code Playgroud)
我不知道它为什么看不到TargetType属性.应该在Resources或ItemTemplate下?我试过它两种方式都找不到它.
编辑:为了被更多的downvotes轰炸ha ha它是参考这个:http: //chat.stackoverflow.com/transcript/message/4295316#4295316
| 归档时间: |
|
| 查看次数: |
3571 次 |
| 最近记录: |