Generic.xaml 4.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. <ResourceDictionary
  2. xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  3. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  4. xmlns:local="clr-namespace:OxyPlot.Wpf">
  5. <local:ThicknessConverter x:Key="ThicknessConverter" />
  6. <Style TargetType="{x:Type local:TrackerControl}">
  7. <Setter Property="Background" Value="#E0FFFFA0" />
  8. <Setter Property="BorderBrush" Value="Black" />
  9. <Setter Property="BorderThickness" Value="1" />
  10. <Setter Property="BorderEdgeMode" Value="Aliased" />
  11. <Setter Property="LineStroke" Value="#80000000" />
  12. <Setter Property="HorizontalLineVisibility" Value="Visible" />
  13. <Setter Property="VerticalLineVisibility" Value="Visible" />
  14. <Setter Property="LineThickness" Value="1" />
  15. <Setter Property="Distance" Value="7" />
  16. <Setter Property="CornerRadius" Value="0" />
  17. <Setter Property="ShowPointer" Value="true" />
  18. <Setter Property="CanCenterHorizontally" Value="true" />
  19. <Setter Property="CanCenterVertically" Value="true" />
  20. <Setter Property="IsHitTestVisible" Value="false" />
  21. <Setter Property="Template">
  22. <Setter.Value>
  23. <ControlTemplate TargetType="{x:Type local:TrackerControl}">
  24. <Canvas HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
  25. <Line
  26. x:Name="PART_HorizontalLine"
  27. RenderOptions.EdgeMode="Aliased"
  28. Stroke="{TemplateBinding LineStroke}"
  29. StrokeDashArray="{TemplateBinding LineDashArray}"
  30. StrokeThickness="{TemplateBinding LineThickness}"
  31. Visibility="{TemplateBinding HorizontalLineVisibility}" />
  32. <Line
  33. x:Name="PART_VerticalLine"
  34. RenderOptions.EdgeMode="Aliased"
  35. Stroke="{TemplateBinding LineStroke}"
  36. StrokeDashArray="{TemplateBinding LineDashArray}"
  37. StrokeThickness="{TemplateBinding LineThickness}"
  38. Visibility="{TemplateBinding VerticalLineVisibility}" />
  39. <Grid x:Name="PART_ContentContainer">
  40. <Path
  41. x:Name="PART_Path"
  42. Fill="{TemplateBinding Background}"
  43. RenderOptions.EdgeMode="{TemplateBinding BorderEdgeMode}"
  44. Stroke="{TemplateBinding BorderBrush}"
  45. StrokeThickness="{TemplateBinding BorderThickness,
  46. Converter={StaticResource ThicknessConverter}}" />
  47. <ContentPresenter
  48. x:Name="PART_Content"
  49. HorizontalAlignment="Center"
  50. VerticalAlignment="Center" />
  51. </Grid>
  52. </Canvas>
  53. </ControlTemplate>
  54. </Setter.Value>
  55. </Setter>
  56. </Style>
  57. <Style TargetType="{x:Type local:PlotViewBase}">
  58. <Setter Property="Background" Value="White" />
  59. <Setter Property="FocusVisualStyle" Value="{x:Null}" />
  60. <Setter Property="DefaultTrackerTemplate">
  61. <Setter.Value>
  62. <ControlTemplate>
  63. <local:TrackerControl LineExtents="{Binding PlotModel.PlotArea}" Position="{Binding Position}">
  64. <local:TrackerControl.Content>
  65. <TextBlock Margin="7" Text="{Binding}" />
  66. </local:TrackerControl.Content>
  67. </local:TrackerControl>
  68. </ControlTemplate>
  69. </Setter.Value>
  70. </Setter>
  71. <Setter Property="ZoomRectangleTemplate">
  72. <Setter.Value>
  73. <ControlTemplate>
  74. <Rectangle
  75. Fill="#40FFFF00"
  76. Stroke="Black"
  77. StrokeDashArray="3,1" />
  78. </ControlTemplate>
  79. </Setter.Value>
  80. </Setter>
  81. <Setter Property="Template">
  82. <Setter.Value>
  83. <ControlTemplate TargetType="{x:Type local:PlotViewBase}">
  84. <Border
  85. Background="{TemplateBinding Background}"
  86. BorderBrush="{TemplateBinding BorderBrush}"
  87. BorderThickness="{TemplateBinding BorderThickness}">
  88. <Grid x:Name="PART_Grid" />
  89. </Border>
  90. </ControlTemplate>
  91. </Setter.Value>
  92. </Setter>
  93. </Style>
  94. </ResourceDictionary>