-
Notifications
You must be signed in to change notification settings - Fork 91
/
UseHighQualityRendering.xaml
271 lines (235 loc) · 15.5 KB
/
UseHighQualityRendering.xaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
<UserControl x:Class="SciChart.Examples.Examples.StyleAChart.UseHighQualityRendering"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:s="http://schemas.abtsoftware.co.uk/scichart"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:ext="http://schemas.abtsoftware.co.uk/scichart/exampleExternals"
d:DesignHeight="400"
d:DesignWidth="600"
mc:Ignorable="d">
<UserControl.Resources>
<s:CompositeCommandConverter x:Key="CompositeCommandConverter"/>
<!-- what's this empty style for? It just overrides some styles in our examples app App.xaml -->
<!-- so we can apply a rendersurface below. In your app you won't need it :) -->
<Style TargetType="s:SciChartSurface"/>
</UserControl.Resources>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="*" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="*" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<ext:SciChartInteractionToolbar Grid.RowSpan="2">
<ToggleButton Margin="3"
x:Name="enableZoom"
Style="{StaticResource ZoomButtonStyle}"
IsChecked="True"
s:ToggleButtonExtensions.GroupName="MultiAxisDemoToolbar"/>
<ToggleButton Margin="3"
x:Name="enablePan"
Style="{StaticResource PanButtonStyle}"
s:ToggleButtonExtensions.GroupName="MultiAxisDemoToolbar" />
<Button Margin="3"
ToolTipService.ToolTip="Zoom to Extents"
Style="{StaticResource ZoomExtentsButtonStyle}">
<Button.Command>
<MultiBinding Converter="{StaticResource CompositeCommandConverter}">
<Binding ElementName="ChartSurface1" Path="AnimateZoomExtentsCommand"/>
<Binding ElementName="ChartSurface2" Path="AnimateZoomExtentsCommand"/>
<Binding ElementName="ChartSurface3" Path="AnimateZoomExtentsCommand"/>
<Binding ElementName="ChartSurface4" Path="AnimateZoomExtentsCommand"/>
</MultiBinding>
</Button.Command>
</Button>
<ext:FlyoutSeparator Background="#444"/>
<ext:FlyoutMenuButton Style="{StaticResource FlyoutMenuButtonStyle}" Padding="0">
<TextBlock Text="CTRL" FontSize="10"/>
<ext:FlyoutMenuButton.PopupContent>
<StackPanel Orientation="Vertical" MinWidth="150">
<StackPanel.Resources>
<Style TargetType="{x:Type CheckBox}" BasedOn="{StaticResource {x:Type CheckBox}}">
<Style.Triggers>
<Trigger Property="IsChecked" Value="True">
<Setter Property="IsHitTestVisible" Value="False"/>
</Trigger>
</Style.Triggers>
</Style>
</StackPanel.Resources>
<TextBlock Text="Additional Controls" />
<RadioButton Margin="4" Style="{StaticResource CheckRadioBtn}" x:Name="UseLineSeries" Content="Use Line Series" IsChecked="True" GroupName="SeriesToggleGroup" />
<RadioButton Margin="4" Style="{StaticResource CheckRadioBtn}" x:Name="UseMountainSeries" Content="Use Mountain Series" GroupName="SeriesToggleGroup" />
<ext:FlyoutSeparator/>
<TextBlock Text="Stroke Thickness" />
<Slider x:Name="strokeThicknessSlider" Margin="4" Maximum="5.0" Minimum="1.0" Orientation="Horizontal" ToolTipService.ToolTip="{Binding Value, RelativeSource={RelativeSource Self}}" Value="2.0" />
</StackPanel>
</ext:FlyoutMenuButton.PopupContent>
</ext:FlyoutMenuButton>
</ext:SciChartInteractionToolbar>
<!-- Render SciChart using High Speed Render Surface -->
<!-- The only line required to enabl this feature is s:RenderSurfaceBase.RenderSurfaceType= -->
<s:SciChartSurface x:Name="ChartSurface1" Grid.Row="0" Grid.Column="1">
<s:SciChartSurface.RenderSurface>
<s:HighSpeedRenderSurface/>
</s:SciChartSurface.RenderSurface>
<s:SciChartSurface.RenderableSeries>
<!-- Toggle Line and MountainSeries visibility bound to same data via the toggle buttons -->
<s:FastLineRenderableSeries DataSeries="{Binding DataSeries, Mode=OneWay}"
IsVisible="{Binding ElementName=UseLineSeries, Path=IsChecked, Mode=TwoWay}"
StrokeThickness="{Binding ElementName=strokeThicknessSlider, Path=Value}" />
<s:FastMountainRenderableSeries DataSeries="{Binding DataSeries, Mode=OneWay}"
IsVisible="{Binding ElementName=UseMountainSeries, Path=IsChecked, Mode=TwoWay}"
StrokeThickness="{Binding ElementName=strokeThicknessSlider, Path=Value}" />
</s:SciChartSurface.RenderableSeries>
<s:SciChartSurface.ChartModifier>
<s:ModifierGroup s:MouseManager.MouseEventGroup="SharedModifierGroup">
<s:RubberBandXyZoomModifier ReceiveHandledEvents="True" IsEnabled="{Binding ElementName=enableZoom, Path=IsChecked}"/>
<s:ZoomPanModifier ReceiveHandledEvents="True" ClipModeX="None" XyDirection="XDirection" ZoomExtentsY="False" IsEnabled="{Binding ElementName=enablePan, Path=IsChecked}"/>
<s:ZoomExtentsModifier ReceiveHandledEvents="True" />
</s:ModifierGroup>
</s:SciChartSurface.ChartModifier>
<s:SciChartSurface.XAxis>
<s:NumericAxis VisibleRange="{Binding SharedXVisibleRange, Mode=TwoWay}" />
</s:SciChartSurface.XAxis>
<s:SciChartSurface.YAxis>
<s:NumericAxis />
</s:SciChartSurface.YAxis>
<s:SciChartSurface.Annotations>
<s:TextAnnotation AnnotationCanvas="AboveChart"
CoordinateMode="Relative"
FontSize="32"
FontWeight="Bold"
HorizontalAnchorPoint="Center"
Opacity="0.3"
Text="High Speed Rasterizer"
VerticalAnchorPoint="Center"
X1="0.5"
Y1="0.5" />
</s:SciChartSurface.Annotations>
</s:SciChartSurface>
<!-- Render SciChart using High Quality Render Surface -->
<!-- The only line required to enable this feature is s:RenderSurfaceBase.RenderSurfaceType= -->
<s:SciChartSurface x:Name="ChartSurface2" Grid.Row="0" Grid.Column="2">
<s:SciChartSurface.RenderSurface>
<s:HighQualityRenderSurface/>
</s:SciChartSurface.RenderSurface>
<s:SciChartSurface.RenderableSeries>
<!-- Toggle Line and MountainSeries visibility bound to same data via the toggle buttons -->
<s:FastLineRenderableSeries DataSeries="{Binding DataSeries, Mode=OneWay}"
IsVisible="{Binding ElementName=UseLineSeries, Path=IsChecked, Mode=TwoWay}"
StrokeThickness="{Binding ElementName=strokeThicknessSlider, Path=Value}" />
<s:FastMountainRenderableSeries DataSeries="{Binding DataSeries, Mode=OneWay}"
IsVisible="{Binding ElementName=UseMountainSeries, Path=IsChecked, Mode=TwoWay}"
StrokeThickness="{Binding ElementName=strokeThicknessSlider, Path=Value}" />
</s:SciChartSurface.RenderableSeries>
<s:SciChartSurface.ChartModifier>
<s:ModifierGroup s:MouseManager.MouseEventGroup="SharedModifierGroup">
<s:RubberBandXyZoomModifier ReceiveHandledEvents="True" IsEnabled="{Binding ElementName=enableZoom, Path=IsChecked}"/>
<s:ZoomPanModifier ReceiveHandledEvents="True" ClipModeX="None" XyDirection="XDirection" ZoomExtentsY="False" IsEnabled="{Binding ElementName=enablePan, Path=IsChecked}"/>
<s:ZoomExtentsModifier ReceiveHandledEvents="True" />
</s:ModifierGroup>
</s:SciChartSurface.ChartModifier>
<s:SciChartSurface.XAxis>
<s:NumericAxis VisibleRange="{Binding SharedXVisibleRange, Mode=TwoWay}" />
</s:SciChartSurface.XAxis>
<s:SciChartSurface.YAxis>
<s:NumericAxis />
</s:SciChartSurface.YAxis>
<s:SciChartSurface.Annotations>
<s:TextAnnotation AnnotationCanvas="AboveChart"
CoordinateMode="Relative"
FontSize="32"
FontWeight="Bold"
HorizontalAnchorPoint="Center"
Opacity="0.3"
Text="High Quality Rasterizer"
VerticalAnchorPoint="Center"
X1="0.5"
Y1="0.5" />
</s:SciChartSurface.Annotations>
</s:SciChartSurface>
<!-- Render SciChart using Direct X Render Surface -->
<!-- The only line required to enable this feature is s:VisualXcceleratorEngine.IsEnabled -->
<s:SciChartSurface x:Name="ChartSurface3" Grid.Row="1" Grid.Column="1">
<s:SciChartSurface.RenderableSeries>
<!-- Toggle Line and MountainSeries visibility bound to same data via the toggle buttons -->
<s:FastLineRenderableSeries DataSeries="{Binding DataSeries, Mode=OneWay}"
IsVisible="{Binding ElementName=UseLineSeries, Path=IsChecked, Mode=TwoWay}"
StrokeThickness="{Binding ElementName=strokeThicknessSlider, Path=Value}" />
<s:FastMountainRenderableSeries DataSeries="{Binding DataSeries, Mode=OneWay}"
IsVisible="{Binding ElementName=UseMountainSeries, Path=IsChecked, Mode=TwoWay}"
StrokeThickness="{Binding ElementName=strokeThicknessSlider, Path=Value}" />
</s:SciChartSurface.RenderableSeries>
<s:SciChartSurface.ChartModifier>
<s:ModifierGroup s:MouseManager.MouseEventGroup="SharedModifierGroup">
<s:RubberBandXyZoomModifier ReceiveHandledEvents="True" IsEnabled="{Binding ElementName=enableZoom, Path=IsChecked}"/>
<s:ZoomPanModifier ReceiveHandledEvents="True" ClipModeX="None" XyDirection="XDirection" ZoomExtentsY="False" IsEnabled="{Binding ElementName=enablePan, Path=IsChecked}"/>
<s:ZoomExtentsModifier ReceiveHandledEvents="True" />
</s:ModifierGroup>
</s:SciChartSurface.ChartModifier>
<s:SciChartSurface.XAxis>
<s:NumericAxis VisibleRange="{Binding SharedXVisibleRange, Mode=TwoWay}" />
</s:SciChartSurface.XAxis>
<s:SciChartSurface.YAxis>
<s:NumericAxis />
</s:SciChartSurface.YAxis>
<s:SciChartSurface.Annotations>
<s:TextAnnotation AnnotationCanvas="AboveChart"
CoordinateMode="Relative"
FontSize="32"
FontWeight="Bold"
HorizontalAnchorPoint="Center"
Opacity="0.3"
Text="Direct X Rasterizer"
VerticalAnchorPoint="Center"
X1="0.5"
Y1="0.5" />
</s:SciChartSurface.Annotations>
</s:SciChartSurface>
<!-- Render SciChart using Xaml Render Surface -->
<!-- The only line required to enable this feature is s:RenderSurfaceBase.RenderSurfaceType= -->
<s:SciChartSurface x:Name="ChartSurface4" Grid.Row="1" Grid.Column="2">
<s:SciChartSurface.RenderSurface>
<s:XamlRenderSurface />
</s:SciChartSurface.RenderSurface>
<s:SciChartSurface.RenderableSeries>
<!-- Toggle Line and MountainSeries visibility bound to same data via the toggle buttons -->
<s:FastLineRenderableSeries DataSeries="{Binding DataSeries, Mode=OneWay}"
IsVisible="{Binding ElementName=UseLineSeries, Path=IsChecked, Mode=TwoWay}"
StrokeThickness="{Binding ElementName=strokeThicknessSlider, Path=Value}" />
<s:FastMountainRenderableSeries DataSeries="{Binding DataSeries, Mode=OneWay}"
IsVisible="{Binding ElementName=UseMountainSeries, Path=IsChecked, Mode=TwoWay}"
StrokeThickness="{Binding ElementName=strokeThicknessSlider, Path=Value}" />
</s:SciChartSurface.RenderableSeries>
<s:SciChartSurface.ChartModifier>
<s:ModifierGroup s:MouseManager.MouseEventGroup="SharedModifierGroup">
<s:RubberBandXyZoomModifier ReceiveHandledEvents="True" IsEnabled="{Binding ElementName=enableZoom, Path=IsChecked}"/>
<s:ZoomPanModifier ReceiveHandledEvents="True" ClipModeX="None" XyDirection="XDirection" ZoomExtentsY="False" IsEnabled="{Binding ElementName=enablePan, Path=IsChecked}"/>
<s:ZoomExtentsModifier ReceiveHandledEvents="True" />
</s:ModifierGroup>
</s:SciChartSurface.ChartModifier>
<s:SciChartSurface.XAxis>
<s:NumericAxis VisibleRange="{Binding SharedXVisibleRange, Mode=TwoWay}" />
</s:SciChartSurface.XAxis>
<s:SciChartSurface.YAxis>
<s:NumericAxis />
</s:SciChartSurface.YAxis>
<s:SciChartSurface.Annotations>
<s:TextAnnotation AnnotationCanvas="AboveChart"
CoordinateMode="Relative"
FontSize="32"
FontWeight="Bold"
HorizontalAnchorPoint="Center"
Opacity="0.3"
Text="Xaml Rasterizer"
VerticalAnchorPoint="Center"
X1="0.5"
Y1="0.5" />
</s:SciChartSurface.Annotations>
</s:SciChartSurface>
</Grid>
</UserControl>