Chart.xaml 7.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  1. <ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  2. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  3. xmlns:local="clr-namespace:MuchInfo.Chart.WPF"
  4. xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit">
  5. <Style TargetType="{x:Type local:Chart}">
  6. <Setter Property="Template">
  7. <Setter.Value>
  8. <ControlTemplate TargetType="{x:Type local:Chart}">
  9. <ControlTemplate.Resources>
  10. <Style x:Key="LeftArrowButton" TargetType="{x:Type Button}">
  11. <Setter Property="Template">
  12. <Setter.Value>
  13. <ControlTemplate TargetType="{x:Type Button}">
  14. <Grid>
  15. <Path x:Name="arrowLeft"
  16. Width="{TemplateBinding Width}"
  17. Height="{TemplateBinding Height}"
  18. Data="M1,5 L9,0 L9,10 L1,5"
  19. RenderTransformOrigin="0.5,0.5"
  20. Stretch="Fill">
  21. <Path.RenderTransform>
  22. <TransformGroup>
  23. <ScaleTransform ScaleX="1" ScaleY="-1" />
  24. <SkewTransform AngleX="0" AngleY="0" />
  25. <RotateTransform Angle="0" />
  26. <TranslateTransform />
  27. </TransformGroup>
  28. </Path.RenderTransform>
  29. <Path.Fill>
  30. <LinearGradientBrush StartPoint="0.5,0" EndPoint="0.5,1">
  31. <GradientStop Offset="0" Color="#FFB2ADAD" />
  32. <GradientStop Offset="1" Color="#FFB2ADAD" />
  33. <GradientStop Offset="0.5" Color="#FF555454" />
  34. </LinearGradientBrush>
  35. </Path.Fill>
  36. </Path>
  37. </Grid>
  38. <ControlTemplate.Triggers>
  39. <Trigger Property="IsMouseOver" Value="True">
  40. <Setter Property="Cursor" Value="Hand" />
  41. </Trigger>
  42. </ControlTemplate.Triggers>
  43. </ControlTemplate>
  44. </Setter.Value>
  45. </Setter>
  46. </Style>
  47. </ControlTemplate.Resources>
  48. <xctk:BusyIndicator x:Name="PART_BusyIndicator">
  49. <Border BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}">
  50. <Border.Background>
  51. <TemplateBinding Property="Background" />
  52. </Border.Background>
  53. <Grid Name="PART_MainGrid"
  54. Margin="5"
  55. VerticalAlignment="Stretch"
  56. Background="{TemplateBinding local:Chart.ChartBackground}">
  57. <Grid.ColumnDefinitions>
  58. <ColumnDefinition Width="Auto" />
  59. <ColumnDefinition Width="*" />
  60. <ColumnDefinition Width="Auto" />
  61. </Grid.ColumnDefinitions>
  62. <Grid.RowDefinitions>
  63. <RowDefinition Height="Auto" />
  64. <RowDefinition Height="Auto" />
  65. <RowDefinition Height="*" />
  66. <RowDefinition Height="Auto" />
  67. <RowDefinition Height="Auto" />
  68. </Grid.RowDefinitions>
  69. <StackPanel x:Name="PART_DrawingToolStackPanel"
  70. Grid.Row="1"
  71. Grid.RowSpan="3"
  72. Grid.Column="0"
  73. Margin="0,2,0,0"
  74. VerticalAlignment="Stretch"
  75. Orientation="Vertical"
  76. Visibility="{TemplateBinding local:Chart.ShowDrawingTool}"
  77. IsEnabled="{TemplateBinding local:Chart.DrawingToolIsEnabled}"/>
  78. <Popup x:Name="PART_PointerPopup"
  79. AllowsTransparency="True"
  80. IsOpen="false"
  81. Placement="Relative"
  82. PlacementTarget="{Binding ElementName=PART_ChartPanesGrid}"
  83. PopupAnimation="Fade">
  84. <Border Margin="3,3,0,0"
  85. Background="{TemplateBinding local:Chart.ChartBackground}"
  86. BorderBrush="Gray"
  87. BorderThickness="3"
  88. CornerRadius="6"
  89. Padding="6">
  90. <Grid x:Name="PART_PointerGrid" />
  91. </Border>
  92. </Popup>
  93. <Canvas x:Name="PART_CrossHairGrid"
  94. Grid.Row="2"
  95. Grid.Column="1"
  96. Background="#00000000" />
  97. <Grid x:Name="PART_ChartPanesGrid"
  98. Grid.Row="2"
  99. Grid.Column="1"
  100. Margin="5"
  101. ShowGridLines="False">
  102. <Grid.ColumnDefinitions>
  103. <ColumnDefinition Width="Auto" />
  104. <ColumnDefinition Width="*" />
  105. <ColumnDefinition Width="Auto" />
  106. </Grid.ColumnDefinitions>
  107. </Grid>
  108. <StackPanel x:Name="PART_DateChartSliderStackPanel"
  109. Grid.Row="4"
  110. Grid.Column="1"
  111. VerticalAlignment="Stretch"
  112. Orientation="Vertical" />
  113. </Grid>
  114. </Border>
  115. </xctk:BusyIndicator>
  116. </ControlTemplate>
  117. </Setter.Value>
  118. </Setter>
  119. </Style>
  120. </ResourceDictionary>