4

我正在开发一个应用程序来尝试掌握 Windows 8。我想在GridSplitter我的 XAML 表单中添加一个,但该控件似乎不可用。

我拥有的 XAML 是

<Page
    x:Class="TweetiCon.BlankPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="using:TweetiCon">

    <Grid Background="{StaticResource ApplicationPageBackgroundBrush}">
        <Grid.ColumnDefinitions>
            <ColumnDefinition/>
            <ColumnDefinition Width="auto"/>
            <ColumnDefinition/>
        </Grid.ColumnDefinitions>
        <GridSplitter Grid.Column="1" Orientation="Vertical"/>
    </Grid>
</Page>

但该GridSpliter元素导致应用程序无法编译,因为

名称 GridSplitter 不存在于命名空间http://schemas.microsoft.com/winfx/2006/xaml/presentation

但我很确定确实如此。这就是它在普通 WPF 应用程序中的位置。

我究竟做错了什么?

4

2 回答 2

3

RE:在 Windows Phone 或 WinRT 中

确实没有 GridSplitter,但直到现在……
如果您正在搜索 GridSplitter,您可以查看 CodePlex 上的 WinRT.Xaml.Toolkit。

http://winrtxamltoolkit.codeplex.com/

并寻找CustomGridSplitter控件。

我已经在 WinRT [RP 和 RTM] 版本中测试了代码,它完成了这项工作。
你可以试一试;)

于 2012-09-10T15:59:11.363 回答
1

从这篇博

Windows Phone 或 WinRT 中没有 GridSplitter。我检查了 MinWidth/MaxWidth 然后(在 Windows Phone 和 WinRT 中)在 Width=”Auto” 且内容可变大小的列上做了什么,看起来 MinWidth 确实可以使列保持给定大小 - 该列确实超出了MaxWidth,尽管文档说:“MinWidth 值优先于 MaxWidth 值,而 MaxWidth 值又优先于 Width 值”。

开始提到的“文档”是这个MSDN 页面

于 2012-05-06T17:35:13.600 回答