Advertisement
Guest User

Untitled

a guest
Nov 4th, 2017
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
MXML 3.74 KB | None | 0 0
  1. <Style x:Key="ScrollBarLineButtonStyle" TargetType="{x:Type RepeatButton}">
  2.         <Setter Property="Focusable" Value="False"/>
  3.         <Setter Property="Template">
  4.             <Setter.Value>
  5.                 <ControlTemplate TargetType="{x:Type RepeatButton}">
  6.                     <Canvas Height="18">
  7.                         <Polygon Fill="LightBlue" Points="3,15 15,15 9,3"></Polygon>
  8.                     </Canvas>
  9.                 </ControlTemplate>
  10.             </Setter.Value>
  11.         </Setter>
  12.     </Style>
  13.  
  14.     <Style x:Key="ScrollBarLineButtonBottomStyle" TargetType="{x:Type RepeatButton}">
  15.         <Setter Property="Focusable" Value="False"/>
  16.         <Setter Property="Template">
  17.             <Setter.Value>
  18.                 <ControlTemplate TargetType="{x:Type RepeatButton}">
  19.                     <Canvas Height="18">
  20.                         <Polygon Fill="LightBlue" Points="3,3 9,15 15,3"></Polygon>
  21.                     </Canvas>
  22.                 </ControlTemplate>
  23.             </Setter.Value>
  24.         </Setter>
  25.     </Style>
  26.  
  27.     <Style x:Key="ScrollBarPageButtonStyle" TargetType="{x:Type RepeatButton}">
  28.         <Setter Property="IsTabStop" Value="False"/>
  29.         <Setter Property="Focusable" Value="False"/>
  30.         <Setter Property="Template">
  31.             <Setter.Value>
  32.                 <ControlTemplate TargetType="{x:Type RepeatButton}">
  33.                     <Border BorderBrush="Transparent"></Border>
  34.                 </ControlTemplate>
  35.             </Setter.Value>
  36.         </Setter>
  37.     </Style>
  38.  
  39.     <Style x:Key="ScrollBarThumbStyle" TargetType="{x:Type Thumb}">
  40.         <Setter Property="IsTabStop" Value="False"/>
  41.         <Setter Property="Focusable" Value="False"/>
  42.         <Setter Property="Margin" Value="1,0,1,0" />
  43.         <Setter Property="Template">
  44.             <Setter.Value>
  45.                 <ControlTemplate TargetType="{x:Type Thumb}">
  46.                     <Rectangle Fill="LightBlue" Margin="2"></Rectangle>
  47.                 </ControlTemplate>
  48.             </Setter.Value>
  49.         </Setter>
  50.     </Style>
  51.  
  52.     <ControlTemplate x:Key="VerticalScrollBar" TargetType="{x:Type ScrollBar}">
  53.         <Grid>
  54.             <Grid.RowDefinitions>
  55.                 <RowDefinition MaxHeight="18"/>
  56.                 <RowDefinition Height="*"/>
  57.                 <RowDefinition MaxHeight="18"/>
  58.             </Grid.RowDefinitions>
  59.  
  60.             <RepeatButton Grid.Row="0" Height="18"
  61.                          Style="{StaticResource ScrollBarLineButtonStyle}"
  62.                          Command="ScrollBar.LineUpCommand" >
  63.             </RepeatButton>
  64.             <Track Name="PART_Track" Grid.Row="1"
  65.                   IsDirectionReversed="True">
  66.                 <Track.DecreaseRepeatButton>
  67.                     <RepeatButton Command="ScrollBar.PageUpCommand" Style="{StaticResource ScrollBarPageButtonStyle}">
  68.                     </RepeatButton>
  69.                 </Track.DecreaseRepeatButton>
  70.                 <Track.Thumb>
  71.                     <Thumb Style="{StaticResource ScrollBarThumbStyle}">
  72.                     </Thumb>
  73.                 </Track.Thumb>
  74.                 <Track.IncreaseRepeatButton>
  75.                     <RepeatButton Command="ScrollBar.PageDownCommand" Style="{StaticResource ScrollBarPageButtonStyle}">
  76.                     </RepeatButton>
  77.                 </Track.IncreaseRepeatButton>
  78.             </Track>
  79.             <RepeatButton Grid.Row="3" Height="18"
  80.                          Style="{StaticResource ScrollBarLineButtonBottomStyle}"
  81.                          Command="ScrollBar.LineDownCommand">
  82.             </RepeatButton>
  83.         </Grid>
  84.     </ControlTemplate>
  85.  
  86.    <Style TargetType="{x:Type ScrollBar}">
  87.                 <Setter Property="Template" Value="{StaticResource VerticalScrollBar}"/>
  88.     </Style>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement