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>
当我构建解决方案时,我不断收到此错误。
XML 命名空间“http://schemas.microsoft.com/winfx/2006/xaml/presentation/sdk”中不存在标记“TreeView”。第 8 行位置 10。
最佳答案
在 WPF 中,您不需要使用 sdk:
对于 TreeView 。简单来说<TreeView ...
这应该有效。
关于wpf - 构建期间 XAML 错误 - 标记不存在,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8844783/