[Windows ストア アプリ] FlipViewで縦方向にページをめくる

スポンサーリンク

FlipViewでは縦方向にページをめくることができます。

縦方向にページをめくるには、項目のレイアウトを制御するItemsPanel を配置し、<VirtualizationStackPane>のOrientation属性にVerticalを設定します(3〜7行目)。

XAMLの例は下記の通りです。

<Grid Grid.Row="1">
    <FlipView HorizontalAlignment="Left" VerticalAlignment="Top" >
        <FlipView.ItemsPanel>
            <ItemsPanelTemplate>
                <VirtualizingStackPanel Orientation="Vertical" />
            </ItemsPanelTemplate>
        </FlipView.ItemsPanel>

        <Image Source="Assets/flower1.jpg"></Image>
        <Image Source="Assets/flower2.jpg"></Image>
        <Image Source="Assets/flower3.jpg"></Image>
        <Image Source="Assets/flower4.jpg"></Image>
        <Image Source="Assets/flower5.jpg"></Image>
    </FlipView>
</Grid>

下図は、上記XAMLを設定した例です。

縦方向にめくるようにする例縦方向にページをめくる例

Please follow and like us:

コメント

タイトルとURLをコピーしました