
Untitled
By: a guest on
Jun 21st, 2012 | syntax:
None | size: 1.29 KB | hits: 14 | expires: Never
WPF how to combine dataTemplate and Toolbox
<TabControl x:Name="_ObjectsList">
<TabControl.ItemTemplate>
<DataTemplate x:Name="MainObjectDataTemplate">
<StackPanel Orientation="Horizontal" >
<Image Height="18" Source="{Binding m_ImagePath}" />
<TextBlock Text="{Binding m_Name}" Margin="2,0,0,0" />
</StackPanel>
</DataTemplate>
</TabControl.ItemTemplate>
<!-- Content -->
<TabControl.ContentTemplate>
<DataTemplate x:Name="sensorDataTemplate">
<!--<s:Toolbox>-->
<ListBox ItemsSource="{Binding m_ChildObjectList}">
<ListBox.ItemTemplate>
<DataTemplate DataType="ChildObject">
<StackPanel Orientation="Horizontal">
<Image Source="{Binding m_ThumbnailPath}" Height="60" ToolTip="{Binding m_ChildName}" IsHitTestVisible="false" Stretch="Uniform"/>
<TextBlock Text="{Binding m_ChildName}" VerticalAlignment="Center" HorizontalAlignment="Center"/>
</StackPanel>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
<!--</s:Toolbox>-->
</DataTemplate>
</TabControl.ContentTemplate>
</TabControl>