Created
December 16, 2010 16:28
-
-
Save kindohm/743603 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<ControlTemplate x:Key="PhoneSimpleRepeatButton" TargetType="RepeatButton"> | |
<Rectangle Fill="Transparent"/> | |
</ControlTemplate> | |
<ControlTemplate x:Key="PhoneSimpleThumb" TargetType="Thumb"> | |
<Rectangle Fill="Transparent"/> | |
</ControlTemplate> | |
<ControlTemplate x:Key="VerticalThumb" TargetType="Thumb"> | |
<Rectangle Fill="{StaticResource PhoneForegroundBrush}"/> | |
</ControlTemplate> | |
<Style x:Key="SynthSlider" TargetType="Slider"> | |
<Setter Property="Height" Value="500"/> | |
<Setter Property="Orientation" Value="Vertical"/> | |
<Setter Property="BorderThickness" Value="0"/> | |
<Setter Property="BorderBrush" Value="Transparent"/> | |
<Setter Property="Maximum" Value="10"/> | |
<Setter Property="Minimum" Value="0"/> | |
<Setter Property="Value" Value="0"/> | |
<Setter Property="Background" Value="{StaticResource PhoneContrastBackgroundBrush}"/> | |
<Setter Property="Foreground" Value="{StaticResource PhoneAccentBrush}"/> | |
<Setter Property="Template"> | |
<Setter.Value> | |
<ControlTemplate TargetType="Slider"> | |
<Grid Background="Transparent"> | |
<VisualStateManager.VisualStateGroups> | |
<VisualStateGroup x:Name="CommonStates"> | |
<VisualState x:Name="Normal"/> | |
<VisualState x:Name="MouseOver"/> | |
<VisualState x:Name="Disabled"> | |
<Storyboard> | |
<DoubleAnimation Duration="0" To="0.1" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="HorizontalTrack"/> | |
<DoubleAnimation Duration="0" To="0.1" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="VerticalTrack"/> | |
<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Fill" Storyboard.TargetName="HorizontalFill"> | |
<DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource PhoneDisabledBrush}"/> | |
</ObjectAnimationUsingKeyFrames> | |
<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Fill" Storyboard.TargetName="VerticalFill"> | |
<DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource PhoneDisabledBrush}"/> | |
</ObjectAnimationUsingKeyFrames> | |
</Storyboard> | |
</VisualState> | |
</VisualStateGroup> | |
</VisualStateManager.VisualStateGroups> | |
<Grid x:Name="HorizontalTemplate" Margin="{StaticResource PhoneHorizontalMargin}"> | |
<Grid.ColumnDefinitions> | |
<ColumnDefinition Width="Auto"/> | |
<ColumnDefinition Width="0"/> | |
<ColumnDefinition Width="*"/> | |
</Grid.ColumnDefinitions> | |
<Rectangle x:Name="HorizontalTrack" Grid.ColumnSpan="3" Fill="{TemplateBinding Background}" Height="12" IsHitTestVisible="False" Margin="0,22,0,50" Opacity="0.2"/> | |
<Rectangle x:Name="HorizontalFill" Grid.Column="0" Fill="{TemplateBinding Foreground}" Height="12" IsHitTestVisible="False" Margin="0,22,0,50"/> | |
<RepeatButton x:Name="HorizontalTrackLargeChangeDecreaseRepeatButton" Grid.Column="0" IsTabStop="False" Template="{StaticResource PhoneSimpleRepeatButton}"/> | |
<RepeatButton x:Name="HorizontalTrackLargeChangeIncreaseRepeatButton" Grid.Column="2" IsTabStop="False" Template="{StaticResource PhoneSimpleRepeatButton}"/> | |
<Thumb x:Name="HorizontalThumb" Grid.Column="1" Margin="-1,0,0,0" RenderTransformOrigin="0.5,0.5" Template="{StaticResource PhoneSimpleThumb}" Width="1"> | |
<Thumb.RenderTransform> | |
<ScaleTransform ScaleY="1" ScaleX="32"/> | |
</Thumb.RenderTransform> | |
</Thumb> | |
</Grid> | |
<Grid x:Name="VerticalTemplate" Margin="{StaticResource PhoneVerticalMargin}"> | |
<Grid.RowDefinitions> | |
<RowDefinition Height="*"/> | |
<RowDefinition Height="0"/> | |
<RowDefinition Height="Auto"/> | |
</Grid.RowDefinitions> | |
<Rectangle x:Name="VerticalTrack" Fill="{TemplateBinding Background}" IsHitTestVisible="False" Margin="12,0" Opacity="0.2" Grid.RowSpan="3" Width="12"/> | |
<Rectangle x:Name="VerticalFill" Fill="{TemplateBinding Foreground}" IsHitTestVisible="False" Margin="12,0" Grid.Row="2" Width="12"/> | |
<RepeatButton x:Name="VerticalTrackLargeChangeDecreaseRepeatButton" IsTabStop="False" Grid.Row="0" Template="{StaticResource PhoneSimpleRepeatButton}"/> | |
<RepeatButton x:Name="VerticalTrackLargeChangeIncreaseRepeatButton" IsTabStop="False" Grid.Row="2" Template="{StaticResource PhoneSimpleRepeatButton}"/> | |
<Thumb x:Name="VerticalThumb" Height="1" Margin="0,-1,0,0" Grid.Row="1" RenderTransformOrigin="0.5,0.5" Template="{StaticResource VerticalThumb}"> | |
<Thumb.RenderTransform> | |
<ScaleTransform ScaleY="32" ScaleX="1"/> | |
</Thumb.RenderTransform> | |
</Thumb> | |
</Grid> | |
</Grid> | |
</ControlTemplate> | |
</Setter.Value> | |
</Setter> | |
</Style> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment