Default.axaml 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. <Styles xmlns="https://github.com/avaloniaui"
  2. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  3. xmlns:local="http://oxyplot.org/avalonia"
  4. xmlns:converters="clr-namespace:OxyPlot.Avalonia.Converters">
  5. <Style Selector="local|TrackerControl">
  6. <Setter Property="Background" Value="#E0FFFFA0" />
  7. <Setter Property="BorderBrush" Value="Black" />
  8. <Setter Property="BorderThickness" Value="1" />
  9. <Setter Property="LineStroke" Value="#80000000" />
  10. <Setter Property="HorizontalLineVisibility" Value="true" />
  11. <Setter Property="VerticalLineVisibility" Value="true" />
  12. <Setter Property="Distance" Value="7" />
  13. <Setter Property="CornerRadius" Value="0" />
  14. <Setter Property="ShowPointer" Value="true" />
  15. <Setter Property="CanCenterHorizontally" Value="true" />
  16. <Setter Property="CanCenterVertically" Value="true" />
  17. <Setter Property="IsHitTestVisible" Value="false" />
  18. <Setter Property="Template">
  19. <Setter.Value>
  20. <ControlTemplate>
  21. <Canvas HorizontalAlignment="Stretch" VerticalAlignment="Stretch" ClipToBounds="False">
  22. <Line Name="PART_HorizontalLine" IsVisible="{TemplateBinding HorizontalLineVisibility}"
  23. Stroke="{TemplateBinding LineStroke}"
  24. StrokeDashArray="{TemplateBinding LineDashArray}" />
  25. <Line Name="PART_VerticalLine" IsVisible="{TemplateBinding VerticalLineVisibility}"
  26. Stroke="{TemplateBinding LineStroke}"
  27. StrokeDashArray="{TemplateBinding LineDashArray}" />
  28. <Panel Name="PART_ContentContainer" ClipToBounds="False">
  29. <Path Name="PART_Path" Fill="{TemplateBinding Background}" Stroke="{TemplateBinding BorderBrush}"
  30. StrokeThickness="{TemplateBinding BorderThickness, Converter={x:Static converters:ThicknessConverter.Instance}}" />
  31. <ContentPresenter Name="PART_Content" Content="{TemplateBinding Content}" HorizontalAlignment="Center" />
  32. </Panel>
  33. </Canvas>
  34. </ControlTemplate>
  35. </Setter.Value>
  36. </Setter>
  37. </Style>
  38. <Style Selector="local|PlotView">
  39. <Setter Property="Background" Value="White" />
  40. <Setter Property="DefaultTrackerTemplate">
  41. <Setter.Value>
  42. <ControlTemplate>
  43. <local:TrackerControl Position="{Binding Position}" LineExtents="{Binding PlotModel.PlotArea}">
  44. <local:TrackerControl.Content>
  45. <TextBlock Text="{Binding Text}" Margin="7" />
  46. </local:TrackerControl.Content>
  47. </local:TrackerControl>
  48. </ControlTemplate>
  49. </Setter.Value>
  50. </Setter>
  51. <Setter Property="ZoomRectangleTemplate">
  52. <Setter.Value>
  53. <ControlTemplate>
  54. <Rectangle Fill="#40FFFF00" Stroke="Black" StrokeDashArray="3,1" />
  55. </ControlTemplate>
  56. </Setter.Value>
  57. </Setter>
  58. <Setter Property="Template">
  59. <Setter.Value>
  60. <ControlTemplate>
  61. <Border Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}"
  62. BorderThickness="{TemplateBinding BorderThickness}">
  63. <Panel Name="PART_Panel" />
  64. </Border>
  65. </ControlTemplate>
  66. </Setter.Value>
  67. </Setter>
  68. </Style>
  69. <Style Selector="local|Plot">
  70. <Setter Property="Background" Value="White" />
  71. <Setter Property="DefaultTrackerTemplate">
  72. <Setter.Value>
  73. <ControlTemplate>
  74. <local:TrackerControl Position="{Binding Position}" LineExtents="{Binding PlotModel.PlotArea}">
  75. <local:TrackerControl.Content>
  76. <TextBlock Text="{Binding Text}" Margin="7" />
  77. </local:TrackerControl.Content>
  78. </local:TrackerControl>
  79. </ControlTemplate>
  80. </Setter.Value>
  81. </Setter>
  82. <Setter Property="ZoomRectangleTemplate">
  83. <Setter.Value>
  84. <ControlTemplate>
  85. <Rectangle Fill="#40FFFF00" Stroke="Black" StrokeDashArray="3,1" />
  86. </ControlTemplate>
  87. </Setter.Value>
  88. </Setter>
  89. <Setter Property="Template">
  90. <Setter.Value>
  91. <ControlTemplate>
  92. <Border Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}"
  93. BorderThickness="{TemplateBinding BorderThickness}">
  94. <Panel Name="PART_Panel" />
  95. </Border>
  96. </ControlTemplate>
  97. </Setter.Value>
  98. </Setter>
  99. </Style>
  100. </Styles>