1 | <ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
---|
2 | xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
---|
3 | xmlns:v="clr-namespace:Microsoft.Research.DynamicDataDisplay.Charts"
|
---|
4 | xmlns:s="clr-namespace:Microsoft.Research.DynamicDataDisplay.Charts.Shapes">
|
---|
5 | <ControlTemplate x:Key="segment">
|
---|
6 | <v:Segment StartPoint="{Binding Point1}"
|
---|
7 | EndPoint="{Binding Point2}"
|
---|
8 | Stroke="{Binding LineStroke}"
|
---|
9 | StrokeThickness="{Binding LineThickness}"/>
|
---|
10 | </ControlTemplate>
|
---|
11 |
|
---|
12 | <ControlTemplate x:Key="leftRay">
|
---|
13 | <s:ViewportRay Point1="{Binding Point1}"
|
---|
14 | Point2="{Binding Point2}"
|
---|
15 | Stroke="{Binding LineStroke}"
|
---|
16 | StrokeThickness="{Binding LineThickness}"
|
---|
17 | StrokeDashArray="1 1"
|
---|
18 | Direction="-1"/>
|
---|
19 | </ControlTemplate>
|
---|
20 |
|
---|
21 | <ControlTemplate x:Key="rightRay">
|
---|
22 | <s:ViewportRay Point1="{Binding Point1}"
|
---|
23 | Point2="{Binding Point2}"
|
---|
24 | Stroke="{Binding LineStroke}"
|
---|
25 | StrokeThickness="{Binding LineThickness}"
|
---|
26 | StrokeDashArray="1 1"
|
---|
27 | Direction="1"/>
|
---|
28 | </ControlTemplate>
|
---|
29 |
|
---|
30 | <ControlTemplate x:Key="leftThumb">
|
---|
31 | <s:DraggablePoint Position="{Binding Point1, Mode=TwoWay}"/>
|
---|
32 | </ControlTemplate>
|
---|
33 |
|
---|
34 | <ControlTemplate x:Key="rightThumb">
|
---|
35 | <s:DraggablePoint Position="{Binding Point2, Mode=TwoWay}"/>
|
---|
36 | </ControlTemplate>
|
---|
37 |
|
---|
38 | <s:MToVerticalAlignmentConverter x:Key="verticalAlignmentConverter"/>
|
---|
39 | <s:MToVerticalOffsetConverter x:Key="verticalScreenOffsetConverter"/>
|
---|
40 | <s:MToVerticalAlignmentInvertedConverter x:Key="verticalAlignmentInvertedConverter"/>
|
---|
41 |
|
---|
42 | <ControlTemplate x:Key="mText">
|
---|
43 | <TextBlock v:ViewportPanel.ViewportHorizontalAlignment="Left"
|
---|
44 | v:ViewportPanel.X="{Binding Center.X}"
|
---|
45 | v:ViewportPanel.Y="{Binding Center.Y}"
|
---|
46 | v:ViewportPanel.ScreenOffsetY="{Binding M, Converter={StaticResource verticalScreenOffsetConverter}}"
|
---|
47 | v:ViewportPanel.ViewportVerticalAlignment="{Binding M, Converter={StaticResource verticalAlignmentConverter}}">
|
---|
48 | <Run Text="m = "/>
|
---|
49 | <Run Text="{Binding M, StringFormat=F}"/>
|
---|
50 | </TextBlock>
|
---|
51 | </ControlTemplate>
|
---|
52 |
|
---|
53 | <ControlTemplate x:Key="leftPointGrid">
|
---|
54 | <Grid v:ViewportPanel.X="{Binding Point1.X}"
|
---|
55 | v:ViewportPanel.Y="{Binding Point1.Y}"
|
---|
56 | v:ViewportPanel.ViewportHorizontalAlignment="Left"
|
---|
57 | v:ViewportPanel.ViewportVerticalAlignment="{Binding M, Converter={StaticResource verticalAlignmentConverter}}">
|
---|
58 | <Rectangle Stroke="Black" StrokeThickness="1"/>
|
---|
59 | <TextBlock Margin="3"
|
---|
60 | Text="{Binding LeftName}"/>
|
---|
61 | </Grid>
|
---|
62 | </ControlTemplate>
|
---|
63 |
|
---|
64 | <ControlTemplate x:Key="rightPointGrid">
|
---|
65 | <Grid v:ViewportPanel.X="{Binding Point2.X}"
|
---|
66 | v:ViewportPanel.Y="{Binding Point2.Y}"
|
---|
67 | v:ViewportPanel.ViewportHorizontalAlignment="Left"
|
---|
68 | v:ViewportPanel.ViewportVerticalAlignment="{Binding M, Converter={StaticResource verticalAlignmentConverter}}">
|
---|
69 | <Rectangle Stroke="Black" StrokeThickness="1"/>
|
---|
70 | <TextBlock Margin="3"
|
---|
71 | Text="{Binding RightName}"/>
|
---|
72 | </Grid>
|
---|
73 | </ControlTemplate>
|
---|
74 |
|
---|
75 | <ControlTemplate x:Key="leftText">
|
---|
76 | <Grid v:ViewportPanel.ViewportHorizontalAlignment="Left"
|
---|
77 | v:ViewportPanel.Y="{Binding LeftY}"
|
---|
78 | v:ViewportPanel.X="{Binding Plotter.Viewport.Visible.XMin}"
|
---|
79 | v:ViewportPanel.ViewportVerticalAlignment="{Binding M, Converter={StaticResource verticalAlignmentConverter}}">
|
---|
80 |
|
---|
81 | <Rectangle Stroke="{Binding LineStroke}"
|
---|
82 | StrokeThickness="{Binding LineThickness}"/>
|
---|
83 | <TextBlock Margin="3" Text="{Binding LeftY, StringFormat=F2}"/>
|
---|
84 | </Grid>
|
---|
85 | </ControlTemplate>
|
---|
86 |
|
---|
87 | <ControlTemplate x:Key="rightText">
|
---|
88 | <Grid v:ViewportPanel.ViewportHorizontalAlignment="Right"
|
---|
89 | v:ViewportPanel.Y="{Binding RightY}"
|
---|
90 | v:ViewportPanel.X="{Binding Plotter.Viewport.Visible.XMax}"
|
---|
91 | v:ViewportPanel.ViewportVerticalAlignment="{Binding M, Converter={StaticResource verticalAlignmentInvertedConverter}}">
|
---|
92 | <Rectangle Stroke="{Binding LineStroke}"
|
---|
93 | StrokeThickness="{Binding LineThickness}"/>
|
---|
94 | <TextBlock Margin="3" Text="{Binding RightY, StringFormat=F2}"/>
|
---|
95 | </Grid>
|
---|
96 | </ControlTemplate>
|
---|
97 |
|
---|
98 |
|
---|
99 | </ResourceDictionary> |
---|