添加自定义控件时如何解决命名空间冲突?

时间:2015-10-29 16:49:44

标签: c# xaml namespaces windows-8.1 win-universal-app

我一直在关注本教程modern UI radial gauge Win 8,为我的Windows 8项目添加自定义仪表控件。但是在引用控件时我一直遇到名称空间冲突错误。

有人可以就此问题提出建议/或调试冲突时采取的措施吗?

我厌倦了重建/清理/重新启动,因为SO上的其他解决方案建议,也尝试重新添加命名空间和xaml声明无济于事。

声明命名空间与教程中的命名空间相同,并且在我的项目中以相同的方式定义规范:

xmlns:controls="using:U2UConsult.WinRT.Modern.Controls"

<Border Grid.Row="3"
                Grid.RowSpan="3"
                Grid.Column="1"
                Margin="0"
                Background="Black">
            <controls:Gauge Width="540"
                            Height="320"
                            Maximum="100"
                            Minimum="0"
                            NeedleBrush="Transparent"
                            ScaleBrush="DarkSlateGray"
                            ScaleTickBrush="Black"
                            TickBrush="Transparent"
                            TrailBrush="DarkSeaGreen"
                            Unit="° Fahrenheit"
                            UnitBrush="DarkGray"
                            ValueBrush="DarkSeaGreen"
                            ValueStringFormat="N1"
                            Value="{Binding TotalPoints,
                                            Mode=TwoWay}" />
        </Border>

我得到的错误如下,说明在xmlns中找不到Gauge。该项目的目标是Windows 8.1,但我不确定这是否会导致冲突。

Error   4   The name "Gauge" does not exist in the namespace "using:U2UConsult.WinRT.Modern.Controls".  

Error   1   The type 'controls:Gauge' was not found. Verify that you are not missing an assembly reference and that all referenced assemblies have been built.  

这是通用项目的Windows 8部分的回购以供完整参考: GitHub Repo

0 个答案:

没有答案