- <ResourceDictionary
- xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
- xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
- xmlns:local="clr-namespace:ESRI.ArcGIS.Samples"
- xmlns:vsm="clr-namespace:System.Windows;assembly=System.Windows">
- <Style TargetType="ProgressBar" x:Name="GrayProgressBar">
- <Setter Property="Template">
- <Setter.Value>
- <ControlTemplate TargetType="ProgressBar" xmlns:vsm="clr-namespace:System.Windows;assembly=System.Windows">
- <Grid x:Name="Root" >
- <vsm:VisualStateManager.VisualStateGroups>
- <vsm:VisualStateGroup x:Name="CommonStates">
- <vsm:VisualState x:Name="Determinate" />
- <vsm:VisualState x:Name="Indeterminate">
- <Storyboard RepeatBehavior="Forever">
- <DoubleAnimation Storyboard.TargetName="IndeterminateGradientFill" Storyboard.TargetProperty="(Shape.Fill).(LinearGradientBrush.Transform).(TransformGroup.Children)[0].X" Duration="00:00:.5" From="0" To="20" />
- <ObjectAnimationUsingKeyFrames Duration="00:00:00" Storyboard.TargetName="IndeterminateRoot" Storyboard.TargetProperty="(UIElement.Visibility)">
- <DiscreteObjectKeyFrame KeyTime="00:00:00">
- <DiscreteObjectKeyFrame.Value>
- <Visibility>Visible</Visibility>
- </DiscreteObjectKeyFrame.Value>
- </DiscreteObjectKeyFrame>
- </ObjectAnimationUsingKeyFrames>
- <ObjectAnimationUsingKeyFrames Duration="00:00:00" Storyboard.TargetName="DeterminateRoot" Storyboard.TargetProperty="(UIElement.Visibility)">
- <DiscreteObjectKeyFrame KeyTime="00:00:00">
- <DiscreteObjectKeyFrame.Value>
- <Visibility>Collapsed</Visibility>
- </DiscreteObjectKeyFrame.Value>
- </DiscreteObjectKeyFrame>
- </ObjectAnimationUsingKeyFrames>
- </Storyboard>
- </vsm:VisualState>
- </vsm:VisualStateGroup>
- </vsm:VisualStateManager.VisualStateGroups>
- <!--Default Root Visuals for either type of ProgressBar-->
- <Border Name="ProgressBarTrack" CornerRadius="3" Background="{TemplateBinding Background}" BorderThickness="{TemplateBinding BorderThickness}" BorderBrush="{TemplateBinding BorderBrush}" />
- <Grid x:Name="ProgressBarRootGrid">
- <!-- Beginning of Gradient over all visuals -->
- <Rectangle Canvas.ZIndex="1" x:Name="ProgressBarRootGradient" StrokeThickness="1" Margin="{TemplateBinding BorderThickness}" Stroke="#FFFFFFFF" RadiusX="1.5" RadiusY="1.5">
- <Rectangle.Fill>
- <LinearGradientBrush EndPoint=".7,1" StartPoint=".7,0">
- <GradientStop Color="#8BFFFFFF" Offset="0"/>
- <GradientStop Color="#A8FFFFFF" Offset="0.15"/>
- <GradientStop Color="#B3FFFFFF" Offset="0.275"/>
- <GradientStop Color="#A7FFFFFF" Offset="0.4"/>
- <GradientStop Color="#93FFFFFF" Offset="0.641"/>
- <GradientStop Color="#8BFFFFFF" Offset="0.75"/>
- <GradientStop Color="#7BFFFFFF" Offset="0.85"/>
- <GradientStop Color="#59FFFFFF" Offset="1"/>
- </LinearGradientBrush>
- </Rectangle.Fill>
- </Rectangle>
- <!-- Beginning of Indeterminate Progress Bar Visuals-->
- <Grid x:Name="IndeterminateRoot" Visibility="Collapsed">
- <Rectangle x:Name="IndeterminateSolidFill" Stroke="#FF448DCA" RadiusX="2" RadiusY="2" StrokeThickness="0" Margin="{TemplateBinding BorderThickness}" Fill="{TemplateBinding Foreground}" Opacity="1" RenderTransformOrigin="0.5,0.5" />
- <Rectangle x:Name="IndeterminateGradientFill" RadiusX="2" RadiusY="2" StrokeThickness="1" Margin="{TemplateBinding BorderThickness}" Opacity="1">
- <Rectangle.Fill>
- <LinearGradientBrush SpreadMethod="Repeat" MappingMode="Absolute" EndPoint="0,1" StartPoint="20,1">
- <LinearGradientBrush.Transform>
- <TransformGroup>
- <TranslateTransform X="0" />
- <SkewTransform AngleX="-30" />
- </TransformGroup>
- </LinearGradientBrush.Transform>
- <GradientStop Color="#FF000000" Offset="0" />
- <GradientStop Color="#00000000" Offset=".25" />
- <GradientStop Color="#FF000000" Offset="0.85" />
- </LinearGradientBrush>
- </Rectangle.Fill>
- </Rectangle>
- </Grid>
- <!-- Beginning of Determinate Progress Bar Visuals-->
- <Grid x:Name="DeterminateRoot" Margin="1">
- <!--Background -->
- <Rectangle HorizontalAlignment="Left" x:Name="ProgressBarIndicator" Margin="{TemplateBinding BorderThickness}" StrokeThickness="0.5" RadiusX="1.5" RadiusY="1.5" Fill="{TemplateBinding Foreground}" />
- </Grid>
- </Grid>
- </Grid>
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- </Style>
- <Style TargetType="local:MapProgress">
- <Setter Property="Template">
- <Setter.Value>
- <ControlTemplate TargetType="local:MapProgress">
- <Grid x:Name="root">
- <vsm:VisualStateManager.VisualStateGroups>
- <vsm:VisualStateGroup x:Name="CommonStates">
- <vsm:VisualState x:Name="Show">
- <Storyboard>
- <DoubleAnimation Storyboard.TargetName="root" Storyboard.TargetProperty="Opacity"
- To="1" Duration="0:0:.5" BeginTime="0:0:0.25" />
- </Storyboard>
- </vsm:VisualState>
- <vsm:VisualState x:Name="Hide">
- <Storyboard>
- <DoubleAnimation Storyboard.TargetName="root" Storyboard.TargetProperty="Opacity"
- To="0" Duration="0:0:0.2" />
- </Storyboard>
- </vsm:VisualState>
- </vsm:VisualStateGroup>
- </vsm:VisualStateManager.VisualStateGroups>
- <ProgressBar Minimum="0" Maximum="100" x:Name="Progress" Background="Gray" Foreground="Black" BorderBrush="Black"
- Width="150" Height="12" Style="{StaticResource GrayProgressBar}" />
- <TextBlock x:Name="ValueText" HorizontalAlignment="Center" VerticalAlignment="Center"
- FontWeight="Bold" FontSize="10" FontFamily="Arial" />
- </Grid>
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- </Style>
- </ResourceDictionary>