-2
有TabControl,它绑定到数组,需要添加到TabItem不同的图标/图像。 HAML代码:WPF,TabItem图像
<Grid>
<TabControl VirtualizingPanel.VirtualizationMode="Recycling" Style="{StaticResource TabControl}"
ItemsSource="{Binding Workspaces}" SelectedIndex="{Binding CurrentPage,UpdateSourceTrigger=PropertyChanged,Mode=TwoWay}">
<TabControl.ItemContainerStyle>
<Style BasedOn="{StaticResource TabItem}" TargetType="{x:Type TabItem}">
<Setter Property="Header" Value="{Binding HeaderText}"/>
</Style>
</TabControl.ItemContainerStyle>
<TabControl.ContentTemplate>
<DataTemplate>
<ContentPresenter Content="{Binding Content}" />
</DataTemplate>
</TabControl.ContentTemplate>
</TabControl>
</Grid>
什么题?你到目前为止尝试了什么?发布您的代码!当你运行它时发生了什么?你预期会发生什么?你有什么特别的问题? – Robert