MySlider.xaml 2.3 KB

1234567891011121314151617181920212223242526272829
  1. <Border x:Class="MySlider"
  2. xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  3. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  4. xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  5. xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  6. mc:Ignorable="d"
  7. d:DesignHeight="16" d:DesignWidth="162"
  8. FocusVisualStyle="{x:Null}"
  9. MinHeight="16" UseLayoutRounding="False" SnapsToDevicePixels="False" BorderBrush="{DynamicResource ColorBrushBg0}" Name="PanBack" Background="{StaticResource ColorBrushSemiTransparent}" Focusable="True">
  10. <Grid x:Name="PanMain" MinHeight="16" MaxHeight="16" IsHitTestVisible="False">
  11. <Line Height="4" Name="LineBack" Stroke="{DynamicResource ColorBrushBg0}" Opacity="0.3" StrokeThickness="1" X2="10000" Y1="2" Y2="2" HorizontalAlignment="Right" Width="0" SnapsToDevicePixels="True" Margin="0,0,1,0" />
  12. <Line Height="4" Name="LineFore" Stroke="{Binding ElementName=PanBack, Path=BorderBrush}" StrokeThickness="2" X2="10000" Y1="2" Y2="2" Width="0" HorizontalAlignment="Left" SnapsToDevicePixels="True" Margin="1,0,0,0" />
  13. <Ellipse HorizontalAlignment="Left" Width="10" Height="10"
  14. Stroke="{Binding BorderBrush, ElementName=PanBack}" StrokeThickness="1.2"
  15. Fill="{DynamicResource ColorBrushBg0}" Name="ShapeDot" VerticalAlignment="Center" RenderTransformOrigin="0.5,0.5">
  16. <Ellipse.RenderTransform>
  17. <ScaleTransform />
  18. </Ellipse.RenderTransform>
  19. </Ellipse>
  20. <Popup Name="Popup" AllowsTransparency="True" IsHitTestVisible="False" PopupAnimation="Fade" VerticalOffset="38" HorizontalOffset="{Binding Margin.Left, ElementName=ShapeDot}" Placement="Center" PlacementRectangle="8,0,0,0">
  21. <Border BorderBrush="{DynamicResource ColorBrush1}" BorderThickness="1.5" CornerRadius="3" MaxWidth="500" Background="White" Margin="0,0,4,4" SnapsToDevicePixels="True">
  22. <Border.Effect>
  23. <DropShadowEffect Opacity="0.4" BlurRadius="4" ShadowDepth="2" />
  24. </Border.Effect>
  25. <TextBlock Name="TextHint" TextWrapping="Wrap" Foreground="{DynamicResource ColorBrush1}" Margin="7,5" FontSize="12"/>
  26. </Border>
  27. </Popup>
  28. </Grid>
  29. </Border>