GridView水平标头,带有自己的ItemsPanelTemlate Windows应用商店应用

时间:2015-03-12 08:34:38

标签: windows-store-apps wpf-controls windows-8.1

我定义了自己的ItemsPanelTemplate:

public sealed class ItemsPanel : Panel
{
    ...

    protected override Size MeasureOverride(Size availableSize)
    {
        Size s = base.MeasureOverride(availableSize);
       ...
        return s;
    }

    protected override Size ArrangeOverride(Size finalSize)
    {
        ...
        return finalSize;
    }
}

而不是我在GridView中使用它:

<GridView x:Name="itemGridView"
                          ItemsSource="{Binding Items}"
                          IsItemClickEnabled="True"
                          ItemClick="ItemView_ItemClick"
                          ItemTemplate="{StaticResource CalendarItemTemplate}">
                    <GridView.HeaderTemplate>
                        <DataTemplate>
                            <StackPanel Background="#182945"
                                        Orientation="Horizontal">
                                ...
                            </StackPanel>
                        </DataTemplate>
                    </GridView.HeaderTemplate>
                    <GridView.ItemsPanel>
                        <ItemsPanelTemplate>
                            <controls:ItemsPanel />
                        </ItemsPanelTemplate>
                    </GridView.ItemsPanel>
                </GridView>

I have this

我的问题是标题显示在左侧垂直,但我希望它们在网格水平顶部。

0 个答案:

没有答案