XamlCompiler错误WMC0055:无法将文本值“帮助”分配给类型为“ IconElement”的属性“ Icon”

马上回来

我有一个C#/ XAML项目,该项目在Visual Studio 2013中构建,没有任何错误或警告,但是当我尝试从命令行运行msbuild时(在解决方案的目录中没有参数),构建失败。

我收到的错误是:

XamlCompiler error WMC0055: Cannot assign text value 'Help' into property 'Icon' of type 'IconElement'

有问题的代码如下:

<Page.BottomAppBar>
    <CommandBar x:Name="bottomAppBar" Background="#00b2f0">
        <AppBarButton Icon="Help" Label="Help" Click="HelpButton_Click"/>
    </CommandBar>
</Page.BottomAppBar>

根据MSDN文档,将文本值分配给Icon属性是有效的。http://msdn.microsoft.com/zh-CN/library/windows/apps/windows.ui.xaml.controls.appbarbutton.icon.aspx

关于VS和MSDN文档的观点似乎都同意这不是问题,但是msbuild可以解决吗?

召集点
<Page.BottomAppBar>
    <CommandBar x:Name="bottomAppBar" Background="#00b2f0">
        <AppBarButton Label="Help" Click="HelpButton_Click">
            <AppBarButton.Icon>
                <SymbolIcon Symbol="Help" />
            </AppBarButton.Icon>
        </AppBarButton>
    </CommandBar>
</Page.BottomAppBar>

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章