【问题标题】:WinRT XAML StoryBoard is missingWinRT XAML 故事板丢失
【发布时间】:2016-04-23 22:09:28
【问题描述】:

当我在 XAML 中输入 <StoryBoard> 时,我得到以下信息:

Windows 应用项目不支持 StoryBoard。

我开始这个项目如下:

新建项目 > 模板 > Visual C# > Windows > Windows 8 > Windows > 空白应用(Windows 8.1)

这是 MainPage.xaml:

<Page
    x:Class="TestApp.MainPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="using:TestApp"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d">
    <Grid>
        <StoryBoard></StoryBoard>
    </Grid>

第一个智能感知不显示 StoryBoard,当我添加标签时,IDE 会在标签下方显示一行,表明该标签不受支持。

我需要添加外部参考吗?

【问题讨论】:

  • 这真的不能告诉我们太多。当您在 XAML 中键入什么时?你有办法重现吗?
  • 在 之间的 MainPage.xaml 中,我试图将 标记用于动画,并且当我将鼠标悬停在标记下方时,我得到了一条线,我收到上述消息。
  • 您如何将 Storyboard 放入您的网格中?显示您的 xaml。
  • 问题已编辑
  • 是的,Storyboard 不是这样工作的。你的错误是意料之中的。您可能想重新访问教程。 :)

标签: xaml winrt-xaml


【解决方案1】:

故事板不能是 UIElemenent 集合的子项:

    <Grid.Resources>
        <Storyboard x:Key="BestStoryboardEver"></Storyboard>
    </Grid.Resources>

我建议使用 blend for Visual Studio 来创建故事板。您还可以将您的故事板添加到&lt;Page.Resources。 我希望这会有所帮助。

【讨论】:

  • 谢谢。我需要它用于 WinRT xaml 中的汉堡菜单,但我最终使用了具有自动宽度的网格并添加和清除子项。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2021-02-16
  • 2017-01-19
  • 1970-01-01
  • 2017-02-09
  • 1970-01-01
相关资源
最近更新 更多