views:

16

answers:

0

Using WCF i get data from server. Data contains Folders and these folders contain queries. I need to set folder icon(expanded collapsed) on the folder node and another icon on query.
TreeView is bound to this collection using HierarchicalDataTemplate. I tryed to do it with converter but failed. I also want it to be MVVM compliant.

<sdk:TreeView ItemsSource="{Binding Folders}" >
        <sdk:TreeView.ItemTemplate>
            <sdk:HierarchicalDataTemplate ItemsSource="{Binding Queries}">
                <StackPanel Orientation="Horizontal">
                    <ContentPresenter Content="{Binding Converter={StaticResource IconConverter}}" />
                    <TextBlock Text="{Binding Name}"   />
                </StackPanel>
            </sdk:HierarchicalDataTemplate>
        </sdk:TreeView.ItemTemplate>
    </sdk:TreeView>

Any solutions?