Windows 8 Store Apps学习(10) ScrollViewer控件特性

介绍

重新想象 Windows 8 Store Apps 之 ScrollViewer

Chaining - 锁链

Rail - 轨道

Inertia - 惯性

Snap - 对齐

Zoom - 缩放

示例

1、演示 ScrollViewer 的 Chaining 特性

ScrollViewer/Chaining.xaml

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

    <Grid Background="Transparent">
        <StackPanel Margin="120 0 0 0">

            <ScrollViewer>
                <StackPanel>

                    <TextBlock Text="我是参照物" FontSize="14.667" />

                    <!--
                        Chaining: 锁链,在触摸模式下,滚动本 ScrollViewer 如果超出了边界,则滚动其父 ScrollViewer
                            本例的测试方法:在触摸模式下,滚动 ScrollViewer 内的内容直至超出边界,超出边界后不要停下来继续滚动,通过“我是参照物”观察父 ScrollViewer 是否也被滚动

                        IsHorizontalScrollChainingEnabled - 是否启用水平方向上的 Chaining,默认值为 true
                        IsVerticalScrollChainingEnabled - 是否启用垂直方向上的 Chaining,默认值为 true
                    -->

                    <ScrollViewer Name="scrollViewer" Width="400" Height="400" Margin="0 10 0 0" HorizontalAlignment="Left"
                          HorizontalScrollMode="Enabled" VerticalScrollMode="Enabled"
                          HorizontalScrollBarVisibility="Visible" VerticalScrollBarVisibility="Visible"
                          IsHorizontalScrollChainingEnabled="{Binding IsChecked, ElementName=chkIsHorizontalScrollChainingEnabled}"
                          IsVerticalScrollChainingEnabled="{Binding IsChecked, ElementName=chkIsVerticalScrollChainingEnabled}">
                        <Image Source="/Assets/Logo.png" Width="1000" />
                    </ScrollViewer>

                    <StackPanel Orientation="Horizontal">
                        <CheckBox Name="chkIsHorizontalScrollChainingEnabled" Content="IsHorizontalScrollChainingEnabled" IsChecked="True" Margin="10 0 0 0" />
                        <CheckBox Name="chkIsVerticalScrollChainingEnabled" Content="IsVerticalScrollChainingEnabled" IsChecked="True" Margin="10 0 0 0" />
                    </StackPanel>

                </StackPanel>
            </ScrollViewer>

        </StackPanel>
    </Grid>
</Page>

以上是小编为您精心准备的的内容,在的博客、问答、公众号、人物、课程等栏目也有的相关内容,欢迎继续使用右上角搜索按钮进行搜索windows
, scrollviewer
, scrollview
, windows store app
, store
, 特性
, scrollview 
, apps
, scrollview反弹
Chaining
,以便于您获取更多的相关知识。

时间: 2024-08-17 14:52:27

Windows 8 Store Apps学习(10) ScrollViewer控件特性的相关文章

Windows 8 Store Apps学习(9) ScrollViewer控件基础

介绍 重新想象 Windows 8 Store Apps 之 ScrollViewer 演示 ScrollViewer 的基本应用 演示 ScrollBar 的基本应用 演示 ScrollContentPresenter 的基本应用 示例 1. ScrollViewer 的基本应用 ScrollViewer/Demo.xaml <Page x:Class="XamlDemo.Controls.ScrollViewer.Demo" xmlns="http://schema

Windows 8 Store Apps学习(12) GridView控件特性

GridView控件特性: 拖动项, 项尺寸可变, 分组显示 介绍 重新想象 Windows 8 Store Apps 之 GridView 拖动项 - 在 GridView 内拖动 item 以对 item 排序, 拖动 item 到 GridView 外的指定位置以删除 item 项尺寸可变 - 指定 GirdView 中每个 item 所占尺寸 分组显示 - 分组显示集合数据 示例 1.演示如何在 GridView 内拖动 item 以对 item 排序,以及如何拖动 item 到 Gri

Windows 8 Store Apps学习(11) ListView控件和 GridView控件

介绍 重新想象 Windows 8 Store Apps 之 ListView 和 GridView ListView - 列表控件 GridView - 网格控件 示例 1.ListView 的 Demo ListViewDemo.xaml <Page x:Class="XamlDemo.Controls.ListViewDemo" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation&quo

Windows 8 Store Apps学习(7) 布局控件

Canvas, Grid, StackPanel, VirtualizingS 介绍 重新想象 Windows 8 Store Apps 之布局控件 Canvas - 绝对定位式布局 Grid - 网格式布局 StackPanel - 流式布局 VirtualizingStackPanel - 仅能用于 ItemsControl WrapGrid - 仅能用于 ItemsControl VariableSizedWrapGrid - 用于 Wrap 子元素集合 示例 1.Canvas 的 Dem

Windows 8 Store Apps学习(8) WebView控件

介绍 重新想象 Windows 8 Store Apps 之 WebView 演示 WebView 的基本应用 演示 WebView 如何与 JavaScript 交互 通过 Share Contract 分享 WebView 中的内容 如何全屏 WebView 示例 1.WebView 的基本应用 WebView/Demo.xaml <Page x:Class="XamlDemo.Controls.WebView.Demo" xmlns="http://schemas

Windows 8 Store Apps学习(6) 媒体控件

Image, MediaElement 介绍 重新想象 Windows 8 Store Apps 之媒体控件 Image - 图片控件 MediaElement - 播放视频或音频的控件 示例 1.Image 的 Demo ImageDemo.xaml <Page x:Class="XamlDemo.Controls.ImageDemo" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation&q

Windows 8 Store Apps学习(5) 集合控件

ComboBox, ListBox, FlipView, ItemsContr 介绍 重新想象 Windows 8 Store Apps 之集合控件 ComboBox - 下拉框 ListBox - 列表框 FlipView - 滑动视图控件 ItemsControl ItemsPresenter - ItemsPresenter 用来呈现 ItemsControl 的 Items 示例 1.ComboBox 的 Demo ComboBoxDemo.xaml <Page x:Class="

Windows 8 Store Apps学习(4) 提示控件和范围控件

提示控件: ProgressRing; 范围控件: ProgressBar, Slider 介绍 重新想象 Windows 8 Store Apps 之提示控件 ProgressRing - 进度圈控件 重新想象 Windows 8 Store Apps 之范围控件 ProgressBar - 进度条控件 Slider - 滑动条控件 示例 1.ProgressRing 的 Demo ProgressRingDemo.xaml <Page x:Class="XamlDemo.Control

Windows 8 Store Apps学习(3) 内容控件

ToolTip, Frame, AppBar, ContentControl 介绍 重新想象 Windows 8 Store Apps 之内容控件 ToolTip - 提示框控件 Frame - 框架控件,用于导航内容 AppBar - 应用程序栏控件 ContentControl ContentPresenter - ContentPresenter 用来呈现 ContentControl 的 Content 重新想象 Windows 8 Store Apps 之容器控件 Border - 边