2
votes
xmlns:sdk="http://schemas.microsoft.com/winfx/2006/xaml/presentation/sdk"
        Title="MainWindow" Height="350" Width="525">
    <Grid>

        <sdk:TreeView Height="197" HorizontalAlignment="Left" Margin="242,80,0,0" Name="treeView1" VerticalAlignment="Top" Width="175" DataContext="{Binding}">
            <sdk:TreeView.ItemTemplate>
                <sdk:HierarchicalDataTemplate ItemsSource="{Binding Path=Childen}">
                    <StackPanel>
                        <TextBlock Text="{Binding Path=Value}"/>
                    </StackPanel>
                </sdk:HierarchicalDataTemplate>
            </sdk:TreeView.ItemTemplate>
        </sdk:TreeView>

I keep getting this error when I build the solution.

The tag 'TreeView' does not exist in XML namespace 'http://schemas.microsoft.com/winfx/2006/xaml/presentation/sdk'. Line 8 Position 10.

1

1 Answers

4
votes

In WPF you don't need to use sdk: for TreeView. Simple put <TreeView ... this should work.