0

Anyone can tell me, How do I implement ObjectBaseViewModel and ViewModel for this case ?

WPF TreeView: How to style selected items with rounded corners like in Explorer,

I just want to kill the corners from the TreeView but I never have used ViewModel Pattern.

thanks in advance...

Community
  • 1
  • 1
Manuel
  • 265
  • 3
  • 8

1 Answers1

0

It looks like his example uses a viewmodel already, specifically in the binding to the HierarchicalDataTemplate in this piece:

    <HierarchicalDataTemplate DataType="{x:Type viewmodels:ObjectBaseViewModel}" ItemsSource="{Binding Children}">
        <StackPanel Orientation="Horizontal" Margin="2,1,5,2">
            <Grid Margin="0,0,3,0">
                <Image Name="icon" Source="/ExplorerTreeView/Images/folder.png"/>
            </Grid>
            <TextBlock Text="{Binding Name}" />
        </StackPanel>
    </HierarchicalDataTemplate>

You would just bind your ViewModel to the ItemsSource like he is doing with "Children".

Xcalibur37
  • 2,305
  • 1
  • 17
  • 20