views:

36

answers:

2

Preview

alt text

On the highlighted item, the images still ordered vertically even I already use <StackPanel Orientation="Horizontal">. Am I missing something?

I don't want the images have ListBoxItem behavior (hover/click). I had added IsEnabled="False" to the list box, but the images' opacity decreased : ( Do you have any idea how to do this thing?

Data template

   <!-- FacilityTreeView data template -->
    <telerik:HierarchicalDataTemplate x:Key="FecilityTemplate" ItemsSource="{Binding Facilities}">
        <StackPanel Orientation="Horizontal">
            <ListBox ItemsSource="{Binding Icons}" BorderThickness="0" Background="Transparent">
                <ListBox.ItemTemplate>
                    <DataTemplate>
                        <StackPanel Orientation="Horizontal">
                            <Image Source="{Binding Source}" Margin=" 0,0,2,0" ToolTipService.ToolTip="{Binding Tooltip}" />
                        </StackPanel>
                    </DataTemplate>
                </ListBox.ItemTemplate>
            </ListBox>
            <TextBlock Text="{Binding Description}" VerticalAlignment="Center" />
        </StackPanel>
    </telerik:HierarchicalDataTemplate>
+2  A: 

You need to use <StackPanel Orientation="Horizontal"> as an ItemsPanelTemplate. Read more here.

Eugene Cheverda
+1  A: 

By using ItemsPanelTemplate.

<ListBox.ItemTemplate>
   <DataTemplate>
       <Image Source="{Binding Source}" Margin=" 0,0,2,0" ToolTipService.ToolTip="{Binding Tooltip}" />
   </DataTemplate>
</ListBox.ItemTemplate>

<ListBox.ItemsPanelTemplate>
   <StackPanel Orientation="Horizontal"/>
</ListBox.ItemsPanelTemplate>
Einarsson