You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
103 lines
4.5 KiB
103 lines
4.5 KiB
<!--*********************************************************************
|
|
|
|
Extended WPF Toolkit
|
|
|
|
Copyright (C) 2010-2012 Xceed Software Inc.
|
|
|
|
This program is provided to you under the terms of the Microsoft Public
|
|
License (Ms-PL) as published at http://wpftoolkit.codeplex.com/license
|
|
|
|
This program can be provided to you by Xceed Software Inc. under a
|
|
proprietary commercial license agreement for use in non-Open Source
|
|
projects. The commercial version of Extended WPF Toolkit also includes
|
|
priority technical support, commercial updates, and many additional
|
|
useful WPF controls if you license Xceed Business Suite for WPF.
|
|
|
|
Visit http://xceed.com and follow @datagrid on Twitter.
|
|
|
|
********************************************************************-->
|
|
<sample:DemoView x:Class="Samples.Modules.Pie.Views.PieProgress"
|
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
|
xmlns:sample="clr-namespace:Samples.Infrastructure.Controls;assembly=Samples.Infrastructure"
|
|
xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit"
|
|
xmlns:local="clr-namespace:Samples.Modules.Pie.Views"
|
|
Title="Progress"
|
|
Description="The Pie control properties can be animated to create various effects and controls like this circular progress bar">
|
|
|
|
<sample:DemoView.Resources>
|
|
<ControlTemplate x:Key="PieProgressTemplate"
|
|
TargetType="{x:Type ProgressBar}">
|
|
<Grid>
|
|
<xctk:Pie x:Name="Pie"
|
|
Fill="#FF3F4A7F"
|
|
HorizontalAlignment="Stretch"
|
|
Width="Auto"
|
|
StrokeThickness="4"
|
|
Slice="{TemplateBinding Value}"
|
|
RenderTransformOrigin="0.5,0.5">
|
|
<xctk:Pie.RenderTransform>
|
|
<RotateTransform Angle="-90" />
|
|
</xctk:Pie.RenderTransform>
|
|
</xctk:Pie>
|
|
<Ellipse Fill="White"
|
|
HorizontalAlignment="Center"
|
|
VerticalAlignment="Center"
|
|
Width="100"
|
|
Height="100" />
|
|
<StackPanel HorizontalAlignment="Center"
|
|
VerticalAlignment="Center"
|
|
Orientation="Horizontal">
|
|
<TextBlock FontSize="24"
|
|
FontWeight="Bold"
|
|
Foreground="Black"
|
|
Text="{Binding ElementName=Pie, Path=Slice, StringFormat=#%}" />
|
|
</StackPanel>
|
|
</Grid>
|
|
</ControlTemplate>
|
|
<Storyboard x:Key="SimulateProgressStoryboard"
|
|
Duration="00:00:04"
|
|
AccelerationRatio="0.5"
|
|
DecelerationRatio="0.5">
|
|
<DoubleAnimationUsingKeyFrames BeginTime="00:00:00"
|
|
Storyboard.TargetName="progressBar"
|
|
Storyboard.TargetProperty="(RangeBase.Value)">
|
|
<SplineDoubleKeyFrame KeyTime="00:00:00"
|
|
Value="0" />
|
|
<SplineDoubleKeyFrame KeyTime="00:00:04"
|
|
Value="1" />
|
|
</DoubleAnimationUsingKeyFrames>
|
|
</Storyboard>
|
|
</sample:DemoView.Resources>
|
|
|
|
<sample:DemoView.Triggers>
|
|
<EventTrigger RoutedEvent="ButtonBase.Click"
|
|
SourceName="SimulateProgressButton">
|
|
<BeginStoryboard Storyboard="{StaticResource SimulateProgressStoryboard}" />
|
|
</EventTrigger>
|
|
</sample:DemoView.Triggers>
|
|
|
|
<Grid x:Name="LayoutRoot"
|
|
HorizontalAlignment="Center"
|
|
VerticalAlignment="Center">
|
|
<Grid.RowDefinitions>
|
|
<RowDefinition Height="0.66*" />
|
|
<RowDefinition Height="Auto" />
|
|
</Grid.RowDefinitions>
|
|
<ProgressBar x:Name="progressBar"
|
|
Template="{StaticResource PieProgressTemplate}"
|
|
Value="0"
|
|
Height="200"
|
|
Width="200"
|
|
Minimum="0"
|
|
Maximum="1" />
|
|
<Button x:Name="SimulateProgressButton"
|
|
Content="Simulate Progress"
|
|
HorizontalAlignment="Center"
|
|
Margin="0,20,0,0"
|
|
VerticalAlignment="Center"
|
|
Width="200"
|
|
Height="50"
|
|
Grid.Row="1" />
|
|
</Grid>
|
|
</sample:DemoView>
|
|
|