<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="clr-namespace:WindowsApplication1"
    >
  <Style x:Key="HeadingStyle" TargetType="{x:Type Label}">
    <Setter Property="Foreground" Value="Black"/>
    <Setter Property="FontSize" Value="30"/>
    <Setter Property="FontFamily" Value="Impact"/>
    <Setter Property="Padding" Value="0 5 0 0"/>
    <Setter Property="HorizontalAlignment" Value="Center"/>
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate>
          <!-- Imagine that this uses data binding to talk to a jive translator Web service! -->
          <TextBlock Text="Ładuj..."/>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
    <Setter Property="Effect">
      <Setter.Value>
        <DropShadowEffect Color="Yellow" ShadowDepth="0" BlurRadius="15"/>
      </Setter.Value>
    </Setter>

  </Style>

  <Style x:Key="DialogStyle" TargetType="{x:Type StackPanel}">
    <Setter Property="Margin" Value="0"/>
    <Setter Property="Background">
      <Setter.Value>
        <LinearGradientBrush StartPoint="0,0" EndPoint="0,1">
          <LinearGradientBrush.GradientStops>
            <GradientStop Offset="0" Color="Purple"/>
            <GradientStop Offset="1" Color="Gray"/>
          </LinearGradientBrush.GradientStops>
        </LinearGradientBrush>
      </Setter.Value>
    </Setter>
  </Style>

  <Style x:Key="CancelButtonStyle" TargetType="{x:Type Button}">
    <Setter Property="HorizontalAlignment" Value="Right"/>
    <Setter Property="RenderTransform">
      <Setter.Value>
        <TranslateTransform Y="-90"/>
      </Setter.Value>
    </Setter>
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate>
          <Label Content="x" FontFamily="Wingdings" FontSize="20">
            <Label.Effect>
              <DropShadowEffect Color="Yellow" ShadowDepth="0" BlurRadius="15"/>
            </Label.Effect>
          </Label>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>

<Style TargetType="{x:Type ProgressBar}">
  <Setter Property="Height" Value="100"/>
  <Setter Property="Foreground" Value="Yellow"/>
  <Setter Property="Effect">
    <Setter.Value>
      <DropShadowEffect Color="Yellow" ShadowDepth="0" BlurRadius="15"/>
    </Setter.Value>
  </Setter>
  <Setter Property="Template">
    <Setter.Value>
      <ControlTemplate TargetType="{x:Type ProgressBar}">

        <!-- Resources -->
        <ControlTemplate.Resources>
          <local:ValueMinMaxToPointConverter x:Key="converter1"/>
          <local:ValueMinMaxToIsLargeArcConverter x:Key="converter2"/>
        </ControlTemplate.Resources>

        <!-- Visual Tree -->
        <Viewbox>
          <Grid Width="20" Height="20">
            <Ellipse x:Name="background" Stroke="{TemplateBinding BorderBrush}"
            StrokeThickness="{TemplateBinding BorderThickness}"
            Width="20" Height="20" Fill="{TemplateBinding Background}"/>
            <Path x:Name="pie" Fill="{TemplateBinding Foreground}">
              <Path.Data>
                <PathGeometry>
                  <PathFigure StartPoint="10,10" IsClosed="True">
                    <LineSegment Point="10,0"/>
                    <ArcSegment Size="10,10" SweepDirection="Clockwise">
                      <ArcSegment.Point>
                        <MultiBinding Converter="{StaticResource converter1}">
                          <Binding RelativeSource="{RelativeSource TemplatedParent}"
                          Path="Value"/>
                          <Binding RelativeSource="{RelativeSource TemplatedParent}"
                          Path="Minimum"/>
                          <Binding RelativeSource="{RelativeSource TemplatedParent}"
                          Path="Maximum"/>
                        </MultiBinding>
                      </ArcSegment.Point>
                      <ArcSegment.IsLargeArc>
                        <MultiBinding Converter="{StaticResource converter2}">
                          <Binding RelativeSource="{RelativeSource TemplatedParent}"
                          Path="Value"/>
                          <Binding RelativeSource="{RelativeSource TemplatedParent}"
                          Path="Minimum"/>
                          <Binding RelativeSource="{RelativeSource TemplatedParent}"
                          Path="Maximum"/>
                        </MultiBinding>
                      </ArcSegment.IsLargeArc>
                    </ArcSegment>
                  </PathFigure>
                </PathGeometry>
              </Path.Data>
            </Path>
          </Grid>
        </Viewbox>

        <!-- Triggers -->
        <ControlTemplate.Triggers>
          <Trigger Property="IsIndeterminate" Value="True">
            <Setter TargetName="pie" Property="Visibility" Value="Hidden"/>
            <Setter TargetName="background" Property="Fill">
              <Setter.Value>
                <LinearGradientBrush StartPoint="0,0" EndPoint="1,1">
                  <GradientStop Offset="0" Color="Yellow"/>
                  <GradientStop Offset="1" Color="Brown"/>
                </LinearGradientBrush>
              </Setter.Value>
            </Setter>
          </Trigger>
          <Trigger Property="IsEnabled" Value="False">
            <Setter TargetName="pie" Property="Fill">
              <Setter.Value>
                <LinearGradientBrush StartPoint="0,0" EndPoint="1,1">
                  <GradientStop Offset="0" Color="Gray"/>
                  <GradientStop Offset="1" Color="White"/>
                </LinearGradientBrush>
              </Setter.Value>
            </Setter>
          </Trigger>
        </ControlTemplate.Triggers>
      </ControlTemplate>
    </Setter.Value>
  </Setter>
</Style>

</ResourceDictionary>