【问题标题】:Failed to assign to property 'Windows.UI.Xaml.FrameworkElement.MinHeight'未能分配给属性“Windows.UI.Xaml.FrameworkElement.MinHeight”
【发布时间】:2014-07-18 03:57:48
【问题描述】:

我正在尝试使用 Visual Studio 2013 Update 2 在我的 Windows Phone 8.1 应用程序上添加一个 CommandBar。这是 XAML 代码:

<Page
    x:Class="App1.MainPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="using:App1"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d"
    Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">

    <Page.BottomAppBar>
        <CommandBar>
            <AppBarButton Icon="Accept" Label="appbarbutton"/>
        </CommandBar>
    </Page.BottomAppBar>

    <Grid>

    </Grid>
</Page>

&lt;CommandBar&gt;...&lt;/CommandBar&gt; 标签有蓝色波浪线,错误如下:

错误 1 ​​找不到与此错误代码相关的文本。

未能分配给属性“Windows.UI.Xaml.FrameworkElement.MinHeight”。 [行:6 位置:9]

如何解决此错误?我对 Windows Phone 和 C# 比较陌生,上周才开始。任何帮助将不胜感激!

谢谢,

托尼

【问题讨论】:

  • 设置MinHeight 可能不是实际问题。您能否发布有关该错误的更多详细信息,例如。整个xaml,堆栈跟踪等?或者也许是一个可以重现相同内容的工作样本。
  • 我已经更新了 xaml 并删除了 MinHeight,我得到了同样的错误。我刚刚创建了一个空白 Windows Phone 应用程序 (Visual C#)。然后在 MainPage.xaml 上,文档大纲 > BottomAppBar -> 添加命令栏。与上述相同的错误...
  • 如果您删除 CommandBar,错误是否仍然存在?检查 Mainpage.g.cs 中的 Line: 6 Position: 9 并查看是否有有趣的东西(通常在 obj 文件夹中的某处)。因为我现在不使用 windows phone env,所以我只能提示你。
  • 我已按照以下步骤操作:Blank App、DocumentOutline、AddCommandBar - 似乎有效。也许您的代码中还有其他问题?也许尝试清理您的解决方案/重新启动 VS。
  • 感谢 cmets 伙计们。 @pushpraj 如果我删除 Page.BottomAppBar 块,错误就会消失。 Mainpage.g.cs 文件似乎没有任何价值。 @Romasz这与我遵循的步骤相同。除了 CommandBar 块之外,我的解决方案是干净的。此外,无论我选择哪个 Windows Phone 应用程序模板(非 Silverlight),似乎都会发生此错误。我猜这是我的 VS2013 安装的问题?

标签: c# wpf xaml visual-studio-2013 windows-phone-8.1


【解决方案1】:

对于那些在 Visual Studio Express 2013 Update 2 中遇到相同问题的用户,可以通过将 Visual Studio 2013 更新到 Update 3 RC 来解决此错误。

这是download link

【讨论】:

    猜你喜欢
    • 2016-02-25
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-08-01
    • 1970-01-01
    • 2016-09-27
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多