【问题标题】:change the 'container grid' of an elements in xaml ( VisualState )更改 xaml ( VisualState ) 中元素的“容器网格”
【发布时间】:2014-01-24 17:13:33
【问题描述】:

我正在为 Windows 应用商店应用程序使用 C#。 我的 FullScreenPortrait 页面的“网格”中有一个“MediaElement”。 现在!当应用程序切换到 Snapped Mode 时,我想更改我的“MediaElement”的位置以将其定位在另一个“网格”中。 我该怎么做?

【问题讨论】:

    标签: c# xaml windows-8


    【解决方案1】:

    你可以这样做

    [YourGridName].Children.Remove([YourMediaElement]);
    [YourOtherGridName].Children.Add([YourMediaElement]);
    

    拥有一个包含多列和/或多行的网格可能更容易,然后您可以使用轻松移动元素

    Grid.SetColumn([YourMediaElement], [Column number]);
    Grid.SetRow([YourMediaElement], [Column number]);
    

    希望有帮助

    【讨论】:

    • 你有例子吗?
    猜你喜欢
    • 2014-07-26
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多