FlowPipe.xaml 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. <UserControl x:Class="Venus_Themes.UserControls.FlowPipe"
  2. xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  3. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  4. xmlns:converters="clr-namespace:Venus_Themes.Converters"
  5. Name="flowPipeControl" Width="100" Height="8" FlowDirection="{Binding ElementName=flowPipeControl,Path=IsReverse,Converter={StaticResource boolToDirection}}">
  6. <UserControl.Resources>
  7. <converters:BoolToReverse x:Key="boolToReverse"/>
  8. <converters:BoolToDoubleConverter x:Key="boolToDoubleConverter"/>
  9. </UserControl.Resources>
  10. <UserControl.RenderTransform>
  11. <TransformGroup>
  12. <RotateTransform Angle="{Binding ElementName=flowPipeControl,Path=RotateTransformValue}"/>
  13. </TransformGroup>
  14. </UserControl.RenderTransform>
  15. <Canvas MinHeight="4" MinWidth="100" >
  16. <!--<Canvas.Resources>
  17. </Canvas.Resources>-->
  18. <Border x:Name="border1" CornerRadius="{Binding ElementName=flowPipeControl,Path=FCornerRadius}" BorderBrush="Gray" BorderThickness="0"
  19. Width="{Binding ElementName=flowPipeControl,Path=Width}" Height="{Binding ElementName=flowPipeControl,Path=Height}">
  20. <Border.Background>
  21. <LinearGradientBrush StartPoint="0.5 0" EndPoint="0.5 1">
  22. <!--<GradientStop Color="Gray" Offset="0"/>
  23. <GradientStop Color="White" Offset="0.5"/>
  24. <GradientStop Color="Gray" Offset="1"/>-->
  25. <GradientStop Color="Gray" Offset="0"/>
  26. <GradientStop Color="White" Offset="0.1"/>
  27. <GradientStop Color="White" Offset="0.9"/>
  28. <GradientStop Color="Gray" Offset="1"/>
  29. </LinearGradientBrush>
  30. </Border.Background>
  31. </Border>
  32. <Line Name="path1"
  33. X1="0" Y1="0" X2="80" Y2="0"
  34. Visibility="{Binding ElementName=flowPipeControl,Path=IsFlowing,Converter={StaticResource bool2VisibilityConverter}}"
  35. Stretch="Fill"
  36. Width="{Binding ElementName=flowPipeControl,Path=Width}"
  37. Height="{Binding ElementName=flowPipeControl,Path=Height}"
  38. Stroke="{Binding ElementName=flowPipeControl, Path=FlowColor}" StrokeDashArray="2,3" StrokeDashCap="Round"
  39. StrokeThickness="5"
  40. Style="{StaticResource AnimatingFlow}" >
  41. </Line>
  42. </Canvas>
  43. </UserControl>