提示控制項: ProgressRing; 範圍控制項: ProgressBar, Slider
介紹
重新想象 Windows 8 Store Apps 之提示控制項
ProgressRing - 進度圈控制項
重新想象 Windows 8 Store Apps 之範圍控制項
ProgressBar - 進度條控制項
Slider - 滑動條控制項
樣本
1、ProgressRing 的 Demo
ProgressRingDemo.xaml
<Page x:Class="XamlDemo.Controls.ProgressRingDemo" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:local="using:XamlDemo.Controls" 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"> <!-- ProgressRing - 進度圈控制項 IsActive - 是否顯示 --> <ProgressRing IsActive="{Binding IsChecked, ElementName=chkRunning}" Width="200" Height="200" HorizontalAlignment="Left" /> <CheckBox Name="chkRunning" Content="Running" IsChecked="True" /> </StackPanel> </Grid> </Page>
2、ProgressBar 的 Demo
ProgressBarDemo.xaml
<Page x:Class="XamlDemo.Controls.ProgressBarDemo" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:local="using:XamlDemo.Controls" 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"> <!-- ProgressBar - 進度條控制項 IsIndeterminate - 是否是無法確定進度的進度條 Minimum - 進度條的最小值 Maximum - 進度條的最大值 Value - 進度條的當前值 ShowPaused - 顯示暫停狀態 ShowError - 顯示錯誤狀態 ValueChanged - 進度條的當前值發生變化後所觸發的事件 --> <ProgressBar IsIndeterminate="True" Width="200" HorizontalAlignment="Left" ShowPaused="{Binding IsChecked, ElementName=radPaused}" ShowError="{Binding IsChecked, ElementName=radError}" /> <ProgressBar IsIndeterminate="False" Width="200" Minimum="0" Maximum="100" Value="50" HorizontalAlignment="Left" Margin="0 20 0 0" ShowPaused="{Binding IsChecked, ElementName=radPaused}" ShowError="{Binding IsChecked, ElementName=radError}"/> <StackPanel Orientation="Horizontal" Margin="0 20 0 0"> <RadioButton x:Name="radRunning" GroupName="ProgressState" Content="Running" IsChecked="True"/> <RadioButton x:Name="radPaused" GroupName="ProgressState" Content="Paused"/> <RadioButton x:Name="radError" GroupName="ProgressState" Content="Error"/> </StackPanel> </StackPanel> </Grid> </Page>