【问题标题】:XAML Error during build - tag does not exist构建期间的 XAML 错误 - 标记不存在
【发布时间】:2012-02-09 07:33:21
【问题描述】:
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 xaml


    【解决方案1】:

    在 WPF 中,您不需要为 TreeView 使用 sdk:。简单把&lt;TreeView ... 这应该工作。

    【讨论】:

    • 它确实有效。我用过:&lt;TreeView Height="197" HorizontalAlignment="Left" Margin="242,80,0,0" Name="treeView1" VerticalAlignment="Top" Width="175" DataContext="{Binding}"&gt;
    猜你喜欢
    • 2017-05-09
    • 1970-01-01
    • 2017-05-20
    • 1970-01-01
    • 2012-10-14
    • 2018-09-20
    • 1970-01-01
    • 2020-05-22
    • 1970-01-01
    相关资源
    最近更新 更多