<UserControl xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d" x:Class="BeWo.View.PercentageDisplay" d:DesignWidth="200" xmlns:Microsoft_Windows_Themes="clr-namespace:Microsoft.Windows.Themes;assembly=PresentationFramework.Aero">
	<UserControl.Resources>
		<LinearGradientBrush x:Key="ProgressBarBackground" EndPoint="1,0" StartPoint="0,0">
			<GradientStop Color="#BABABA" Offset="0" />
			<GradientStop Color="#C7C7C7" Offset="0.5" />
			<GradientStop Color="#BABABA" Offset="1" />
		</LinearGradientBrush>
		<LinearGradientBrush x:Key="ProgressBarBorderBrush" EndPoint="0,1" StartPoint="0,0">
			<GradientStop Color="#B2B2B2" Offset="0" />
			<GradientStop Color="#8C8C8C" Offset="1" />
		</LinearGradientBrush>
		<LinearGradientBrush x:Key="ProgressBarGlassyHighlight" EndPoint="0,1" StartPoint="0,0">
			<GradientStop Color="#50FFFFFF" Offset="0.5385" />
			<GradientStop Color="#00FFFFFF" Offset="0.5385" />
		</LinearGradientBrush>
		<LinearGradientBrush x:Key="ProgressBarTopHighlight" EndPoint="0,1" StartPoint="0,0">
			<GradientStop Color="#80FFFFFF" Offset="0.05" />
			<GradientStop Color="#00FFFFFF" Offset="0.25" />
		</LinearGradientBrush>
		<LinearGradientBrush x:Key="ProgressBarIndicatorAnimatedFill" EndPoint="0,0" StartPoint="-100,0" MappingMode="Absolute">
			<GradientStop Color="#00000000" Offset="0" />
			<GradientStop Color="#FF000000" Offset="0.4" />
			<GradientStop Color="#FF000000" Offset="0.6" />
			<GradientStop Color="#00000000" Offset="1" />
		</LinearGradientBrush>
		<LinearGradientBrush x:Key="ProgressBarIndicatorDarkEdgeLeft" EndPoint="1,0" StartPoint="0,0">
			<GradientStop Color="#0C000000" Offset="0" />
			<GradientStop Color="#20000000" Offset="0.3" />
			<GradientStop Color="#00000000" Offset="1" />
		</LinearGradientBrush>
		<LinearGradientBrush x:Key="ProgressBarIndicatorDarkEdgeRight" EndPoint="1,0" StartPoint="0,0">
			<GradientStop Color="#00000000" Offset="0" />
			<GradientStop Color="#20000000" Offset="0.7" />
			<GradientStop Color="#0C000000" Offset="1" />
		</LinearGradientBrush>
		<RadialGradientBrush x:Key="ProgressBarIndicatorLightingEffectLeft" RadiusX="1" RadiusY="1" RelativeTransform="1,0,0,1,0.5,0.5">
			<GradientStop Color="#60FFFFC4" Offset="0" />
			<GradientStop Color="#00FFFFC4" Offset="1" />
		</RadialGradientBrush>
		<LinearGradientBrush x:Key="ProgressBarIndicatorLightingEffect" EndPoint="0,0" StartPoint="0,1">
			<GradientStop Color="#60FFFFC4" Offset="0" />
			<GradientStop Color="#00FFFFC4" Offset="1" />
		</LinearGradientBrush>
		<RadialGradientBrush x:Key="ProgressBarIndicatorLightingEffectRight" RadiusX="1" RadiusY="1" RelativeTransform="1,0,0,1,-0.5,0.5">
			<GradientStop Color="#60FFFFC4" Offset="0" />
			<GradientStop Color="#00FFFFC4" Offset="1" />
		</RadialGradientBrush>
		<LinearGradientBrush x:Key="ProgressBarIndicatorGlassyHighlight" EndPoint="0,1" StartPoint="0,0">
			<GradientStop Color="#90FFFFFF" Offset="0.5385" />
			<GradientStop Color="#00FFFFFF" Offset="0.5385" />
		</LinearGradientBrush>
		<Style x:Key="ProgressBarStyleOverflowLeft" TargetType="{x:Type ProgressBar}">
			<Setter Property="Foreground" Value="#01D328" />
			<Setter Property="Background" Value="{StaticResource ProgressBarBackground}" />
			<Setter Property="BorderBrush" Value="{StaticResource ProgressBarBorderBrush}" />
			<Setter Property="BorderThickness" Value="1" />
			<Setter Property="Template">
				<Setter.Value>
					<ControlTemplate TargetType="{x:Type ProgressBar}">
						<Grid x:Name="Background" SnapsToDevicePixels="true">
							<Border Background="{TemplateBinding Background}" CornerRadius="2,0,0,2" />
							<Border Margin="1,1,0,1" Background="{StaticResource ProgressBarGlassyHighlight}" CornerRadius="2" />
							<Border Margin="1,1,0,1" Background="{StaticResource ProgressBarTopHighlight}" BorderBrush="#80FFFFFF" BorderThickness="1,1,1,1" CornerRadius="2,0,0,2" />
							<Border Margin="1,1,0,1" x:Name="PART_Track" CornerRadius="0,0,0,0" />
							<Decorator HorizontalAlignment="Left" Margin="1,1,0,1" x:Name="PART_Indicator" OpacityMask="#FF000000">
								<Grid x:Name="Foreground">
									<Grid.ColumnDefinitions>
										<ColumnDefinition MaxWidth="15" />
										<ColumnDefinition Width="0.1*" />
										<ColumnDefinition MaxWidth="15" />
									</Grid.ColumnDefinitions>
									<Grid.RowDefinitions>
										<RowDefinition />
										<RowDefinition />
									</Grid.RowDefinitions>
									<Border Background="{TemplateBinding Foreground}" x:Name="Indicator" Grid.ColumnSpan="3" Grid.RowSpan="2" CornerRadius="2,0,0,2" />

									<Rectangle Fill="{StaticResource ProgressBarIndicatorDarkEdgeLeft}" RadiusX="1" RadiusY="1" Margin="1,1,0,1" x:Name="LeftDark" Grid.RowSpan="2" />
									<Rectangle Fill="{StaticResource ProgressBarIndicatorLightingEffectLeft}" x:Name="LeftLight" Grid.Column="0" Grid.Row="2" />
									<Rectangle Fill="{StaticResource ProgressBarIndicatorLightingEffect}" x:Name="CenterLight" Grid.Column="1" Grid.Row="2" Grid.ColumnSpan="2" />
									<Border x:Name="Highlight1" Grid.ColumnSpan="3" Grid.RowSpan="2" Background="{StaticResource ProgressBarIndicatorGlassyHighlight}" CornerRadius="2,0,0,2" />
									<Border x:Name="Highlight2" Grid.ColumnSpan="3" Grid.RowSpan="2" Background="{StaticResource ProgressBarTopHighlight}" CornerRadius="2,0,0,2" />
								</Grid>
							</Decorator>
							<Border BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="2" />
						</Grid>
						<ControlTemplate.Triggers>
							<Trigger Property="Orientation" Value="Vertical">
								<Setter Property="LayoutTransform" TargetName="Background">
									<Setter.Value>
										<RotateTransform Angle="-90" />
									</Setter.Value>
								</Setter>
								<Setter Property="LayoutTransform" TargetName="PART_Track">
									<Setter.Value>
										<RotateTransform Angle="90" />
									</Setter.Value>
								</Setter>
								<Setter Property="LayoutTransform" TargetName="PART_Indicator">
									<Setter.Value>
										<RotateTransform Angle="90" />
									</Setter.Value>
								</Setter>
								<Setter Property="LayoutTransform" TargetName="Foreground">
									<Setter.Value>
										<RotateTransform Angle="-90" />
									</Setter.Value>
								</Setter>
							</Trigger>
							<Trigger Property="IsIndeterminate" Value="true">
								<Setter Property="Visibility" TargetName="LeftDark" Value="Collapsed" />
								<Setter Property="Visibility" TargetName="LeftLight" Value="Collapsed" />
								<Setter Property="Visibility" TargetName="CenterLight" Value="Collapsed" />
								<Setter Property="Visibility" TargetName="Indicator" Value="Collapsed" />
							</Trigger>
						</ControlTemplate.Triggers>
					</ControlTemplate>
				</Setter.Value>
			</Setter>
		</Style>
		<Style x:Key="ProgressBarStyleOverflowRight" TargetType="{x:Type ProgressBar}">
			<Setter Property="Foreground" Value="#01D328" />
			<Setter Property="Background" Value="{StaticResource ProgressBarBackground}" />
			<Setter Property="BorderBrush" Value="{StaticResource ProgressBarBorderBrush}" />
			<Setter Property="BorderThickness" Value="1" />
			<Setter Property="Template">
				<Setter.Value>
					<ControlTemplate TargetType="{x:Type ProgressBar}">
						<Grid x:Name="Background" SnapsToDevicePixels="true">
							<Border Background="{TemplateBinding Background}" CornerRadius="0,2,2,0" />
							<Border Margin="0,1,1,1" Background="{StaticResource ProgressBarGlassyHighlight}" CornerRadius="2" />
							<Border Margin="0,1,1,1" Background="{StaticResource ProgressBarTopHighlight}" BorderBrush="#80FFFFFF" BorderThickness="1,1,1,1" CornerRadius="0,2,2,0" />
							<Border Margin="0,1,1,1" x:Name="PART_Track" CornerRadius="0,0,0,0" />
							<Decorator HorizontalAlignment="Left" Margin="0,1,1,1" x:Name="PART_Indicator" OpacityMask="#FF000000">
								<Grid x:Name="Foreground">
									<Grid.ColumnDefinitions>
										<ColumnDefinition MaxWidth="15" />
										<ColumnDefinition Width="0.1*" />
										<ColumnDefinition MaxWidth="15" />
									</Grid.ColumnDefinitions>
									<Grid.RowDefinitions>
										<RowDefinition />
										<RowDefinition />
									</Grid.RowDefinitions>
									<Border Background="{TemplateBinding Foreground}" x:Name="Indicator" Grid.ColumnSpan="3" Grid.RowSpan="2" CornerRadius="0,2,2,0" />
									<Rectangle Fill="{StaticResource ProgressBarIndicatorDarkEdgeRight}" RadiusX="1" RadiusY="1" Margin="0,1,1,1" x:Name="RightDark" Grid.Column="2" Grid.RowSpan="2" />
									<Rectangle Fill="{StaticResource ProgressBarIndicatorLightingEffect}" x:Name="CenterLight" Grid.Column="0" Grid.Row="2" Grid.ColumnSpan="2" />
									<Rectangle Fill="{StaticResource ProgressBarIndicatorLightingEffectRight}" x:Name="RightLight" Grid.Column="2" Grid.Row="2" />
									<Border x:Name="Highlight1" Grid.ColumnSpan="3" Grid.RowSpan="2" Background="{StaticResource ProgressBarIndicatorGlassyHighlight}" CornerRadius="0,2,2,0" />
									<Border x:Name="Highlight2" Grid.ColumnSpan="3" Grid.RowSpan="2" Background="{StaticResource ProgressBarTopHighlight}" CornerRadius="0,2,2,0" />
								</Grid>
							</Decorator>
							<Border BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="2" />
						</Grid>
						<ControlTemplate.Triggers>
							<Trigger Property="Orientation" Value="Vertical">
								<Setter Property="LayoutTransform" TargetName="Background">
									<Setter.Value>
										<RotateTransform Angle="-90" />
									</Setter.Value>
								</Setter>
								<Setter Property="LayoutTransform" TargetName="PART_Track">
									<Setter.Value>
										<RotateTransform Angle="90" />
									</Setter.Value>
								</Setter>
								<Setter Property="LayoutTransform" TargetName="PART_Indicator">
									<Setter.Value>
										<RotateTransform Angle="90" />
									</Setter.Value>
								</Setter>
								<Setter Property="LayoutTransform" TargetName="Foreground">
									<Setter.Value>
										<RotateTransform Angle="-90" />
									</Setter.Value>
								</Setter>
							</Trigger>
							<Trigger Property="IsIndeterminate" Value="true">
								<Setter Property="Visibility" TargetName="RightDark" Value="Collapsed" />
								<Setter Property="Visibility" TargetName="CenterLight" Value="Collapsed" />
								<Setter Property="Visibility" TargetName="RightLight" Value="Collapsed" />
								<Setter Property="Visibility" TargetName="Indicator" Value="Collapsed" />
							</Trigger>
						</ControlTemplate.Triggers>
					</ControlTemplate>
				</Setter.Value>
			</Setter>
		</Style>
	</UserControl.Resources>


	<Grid x:Name="LayoutRoot">
		<Grid x:Name="grid_twoBars">
			<Grid.ColumnDefinitions>
				<ColumnDefinition Width="100*" />
				<ColumnDefinition Width="100*" />
			</Grid.ColumnDefinitions>
			<ProgressBar x:Name="leftBar" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" BorderThickness="0,0,0,0" Value="100" Style="{DynamicResource ProgressBarStyleOverflowLeft}" />
			<ProgressBar x:Name="rightBar" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" BorderThickness="0,0,0,0" Value="100" Grid.Column="1" Foreground="#FFFF2101" Style="{DynamicResource ProgressBarStyleOverflowRight}" />
		</Grid>
		<ProgressBar HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Grid.ColumnSpan="1" Grid.RowSpan="1" Maximum="100" x:Name="bar_to100" d:IsHidden="True" />
		<TextBlock HorizontalAlignment="Center" VerticalAlignment="Center" Text="TextBlock" TextWrapping="Wrap" x:Name="textblock_percent" />
	</Grid>
</UserControl>