-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathFieldStatsHelperDPView.xaml
211 lines (195 loc) · 13 KB
/
FieldStatsHelperDPView.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
<UserControl
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:extensions="clr-namespace:ArcGIS.Desktop.Extensions;assembly=ArcGIS.Desktop.Extensions"
xmlns:datavis="clr-namespace:System.Windows.Controls.DataVisualization;assembly=System.Windows.Controls.DataVisualization.Toolkit"
xmlns:chartingToolkit="clr-namespace:System.Windows.Controls.DataVisualization.Charting;assembly=System.Windows.Controls.DataVisualization.Toolkit"
xmlns:xceed="clr-namespace:Xceed.Wpf.Toolkit;assembly=Xceed.Wpf.Toolkit"
xmlns:Primitives="clr-namespace:System.Windows.Controls.DataVisualization.Charting.Primitives;assembly=System.Windows.Controls.DataVisualization.Toolkit"
xmlns:conv="clr-namespace:Esri.APL.FieldStatsQueryHelper"
x:Class="Esri.APL.FieldStatsQueryHelper.FieldStatsHelperDPView"
mc:Ignorable="d"
d:DataContext="{Binding FieldStatsHelperDPViewModel}"
d:DesignHeight="487" d:DesignWidth="300">
<!--//Copyright 2014 Esri
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
// http://www.apache.org/licenses/LICENSE-2.0
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.-->
<UserControl.Resources>
<ResourceDictionary x:Key="MergedDictionaries">
<conv:ChartVisibilityDataAvailableConverter x:Key="chartVisibilityDataAvailConverter"/>
<conv:NullToVisibilityConverter x:Key="nullToVisibilityConverter"/>
<ResourceDictionary.MergedDictionaries>
<extensions:DesignOnlyResourceDictionary Source="pack://application:,,,/ArcGIS.Desktop.Framework;component\Themes\Default.xaml"/>
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</UserControl.Resources>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<DockPanel Grid.Row="0" LastChildFill="true" KeyboardNavigation.TabNavigation="Local" Height="30">
<TextBlock Grid.Column="1" Text="{Binding Heading}" VerticalAlignment="Center" HorizontalAlignment="Center"
FontSize="14">
<TextBlock.ToolTip>
<WrapPanel Orientation="Vertical" MaxWidth="300">
<TextBlock Text="{Binding Heading}" TextWrapping="Wrap"/>
</WrapPanel>
</TextBlock.ToolTip>
</TextBlock>
</DockPanel>
<Grid Grid.Row="1" >
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<Button Visibility="Collapsed" Grid.Row="0" Grid.Column="0" Height="25" Margin="5" Command="{Binding RetrieveMapsCommand}"
Style="{DynamicResource Esri_SimpleButton}" Content="Get Maps"/>
<Label Grid.Row="0" Grid.Column="0" Content="Maps"/>
<ComboBox Grid.Row="0" Grid.Column="1" x:Name="LstMaps" ItemsSource="{Binding ListOfMaps}"
Margin="5" DisplayMemberPath="Name" SelectedItem="{Binding SelectedMap, Mode=TwoWay}"/>
<!-- Combo prompt technique thanks to stackoverflow: http://stackoverflow.com/questions/1426050/how-to-display-default-text-select-team-in-combo-box-on-pageload-in-wpf -->
<TextBlock Grid.Row="0" Grid.Column="1" Margin="10,8,0,0"
Visibility="{Binding SelectedItem, ElementName=LstMaps, Converter={StaticResource nullToVisibilityConverter}}"
IsHitTestVisible="False"
Text="<Select a Map>"/>
<Label Grid.Row="1" Grid.Column="0" Content="Layers"/>
<ComboBox x:Name="LstLayers" Grid.Row="1" Grid.Column="1" Margin="5"
ItemsSource="{Binding ListOfLayers}" DisplayMemberPath="Name" SelectedItem="{Binding SelectedLayer, Mode=TwoWay}"/>
<TextBlock Grid.Row="1" Grid.Column="1" Margin="10,8,0,0"
Visibility="{Binding SelectedItem, ElementName=LstMaps, Converter={StaticResource nullToVisibilityConverter}}"
IsHitTestVisible="False"
Text="<Select a Layer>"/>
<Label Grid.Row="2" Grid.Column="0" Content="Fields"/>
<ComboBox Grid.Row="2" Grid.Column="1" x:Name="LstFields" ItemsSource="{Binding ListOfFields}" Margin="5"
DisplayMemberPath="Alias" SelectedItem="{Binding SelectedField, Mode=TwoWay}"/>
<TextBlock Grid.Row="2" Grid.Column="1" Margin="10,8,0,0"
Visibility="{Binding SelectedItem, ElementName=LstMaps, Converter={StaticResource nullToVisibilityConverter}}"
IsHitTestVisible="False"
Text="<Select a Field>"/>
</Grid>
<DockPanel Grid.Row="2" x:Name="statsAndQuery" Visibility="{Binding ChartData, Converter={StaticResource chartVisibilityDataAvailConverter}}">
<Grid x:Name="descriptiveStatsGroup" DockPanel.Dock="Top">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<!--<Separator Grid.Column="1" Grid.RowSpan="3" Width="2" Height="300" HorizontalAlignment="Right" VerticalAlignment="Stretch" Background="Black" />-->
<Border Grid.Row="0" Grid.ColumnSpan="4" Width="Auto" Background="Transparent" BorderThickness="0,1,0,0" BorderBrush="{DynamicResource Esri_Gray130}"/>
<Border Grid.Row="5" Grid.ColumnSpan="4" Width="Auto" Background="Transparent" BorderThickness="0,0,0,1" BorderBrush="{DynamicResource Esri_Gray130}"/>
<Border Grid.Column="1" Grid.RowSpan="3" Background="Transparent" BorderThickness="0,0,1,0" Height="Auto" BorderBrush="{DynamicResource Esri_Gray130}"/>
<Label Grid.Row="0" Grid.Column="0" Content="Min:" FontWeight="Bold" Margin="0,0,0,1" VerticalAlignment="Bottom"/>
<Label Grid.Row="0" Grid.Column="1" HorizontalContentAlignment="Right" ToolTip="{Binding FieldMin}">
<TextBlock Text="{Binding FieldMin, StringFormat=0.000}"/>
</Label>
<Label Grid.Row="0" Grid.Column="2" Content="Max:" FontWeight="Bold"/>
<Label Grid.Row="0" Grid.Column="3" HorizontalContentAlignment="Right" ToolTip="{Binding FieldMax}">
<TextBlock Text="{Binding FieldMax, StringFormat=0.000}"/>
</Label>
<Label Grid.Row="1" Grid.Column="0" Content="Mean:" FontWeight="Bold"/>
<Label Grid.Row="1" Grid.Column="1" HorizontalContentAlignment="Right" ToolTip="{Binding FieldMean}">
<TextBlock Text="{Binding FieldMean, StringFormat=0.000}"/>
</Label>
<Label Grid.Row="1" Grid.Column="2" Content="Median:" FontWeight="Bold"/>
<Label Grid.Row="1" Grid.Column="3" HorizontalContentAlignment="Right" ToolTip="{Binding FieldMedian}">
<TextBlock Text="{Binding FieldMedian, StringFormat=0.000}"/>
</Label>
<Label Grid.Row="2" Grid.Column="0" Content="Std Dev:" FontWeight="Bold"/>
<Label Grid.Row="2" Grid.Column="1" ToolTip="{Binding FieldStdDev}" HorizontalContentAlignment="Right">
<TextBlock Text="{Binding FieldStdDev, StringFormat=0.000}"/>
</Label>
<Label Grid.Row="2" Grid.Column="2" Content="Nulls Ignored:" FontWeight="Bold"/>
<Label Grid.Row="2" Grid.Column="3" Content="{Binding FieldNulls, StringFormat=0;}" HorizontalContentAlignment="Right"/>
</Grid>
<Grid x:Name="chartAndSliderGroup" DockPanel.Dock="Top">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<chartingToolkit:Chart
Grid.Row="0" Grid.ColumnSpan="3"
Margin="0, 8, 0, 0" Padding="0,0,0,0"
x:Name="chtHistogram"
Height="200" Width="275"
Title="{Binding ChartTitle}">
<chartingToolkit:Chart.BorderThickness>0</chartingToolkit:Chart.BorderThickness>
<chartingToolkit:Chart.TitleStyle>
<Style TargetType="{x:Type datavis:Title}">
<Setter Property="HorizontalAlignment" Value="Stretch"/>
<Setter Property="HorizontalContentAlignment" Value="Center"/>
<Setter Property="TextBlock.TextAlignment" Value="Center"/>
<Setter Property="TextBlock.LineHeight" Value="20"/>
</Style>
</chartingToolkit:Chart.TitleStyle>
<chartingToolkit:Chart.PlotAreaStyle>
<Style TargetType="{x:Type Grid}">
<Setter Property="Background" Value="Gray"/>
<Setter Property="Opacity" Value="0.15"/>
</Style>
</chartingToolkit:Chart.PlotAreaStyle>
<chartingToolkit:Chart.Axes>
<chartingToolkit:LinearAxis Orientation="X"/>
<chartingToolkit:LinearAxis Orientation="Y" Title="Count"/>
</chartingToolkit:Chart.Axes>
<chartingToolkit:Chart.LegendStyle>
<Style TargetType="{x:Type datavis:Legend}">
<Setter Property="Width" Value="0"/>
</Style>
</chartingToolkit:Chart.LegendStyle>
<chartingToolkit:ColumnSeries x:Name="columnSeriesHistogram" IndependentValuePath="RangeMax" DependentValuePath="Count" ItemsSource="{Binding ChartData}"
Background="Transparent"/>
</chartingToolkit:Chart>
<xceed:RangeSlider Grid.Row="1" Grid.ColumnSpan="3"
Minimum="{Binding RangeMin, StringFormat=0.000}"
Maximum="{Binding RangeMax, StringFormat=0.000}"
LowerValue="{Binding RangeLowerVal, Mode=TwoWay, StringFormat=0.000}"
HigherValue="{Binding RangeUpperVal, Mode=TwoWay, StringFormat=0.000}" Margin="52,0,12,0"/>
<Label Grid.Row="2" Grid.Column="0" Margin="52,0,0,0">
<TextBlock Text="{Binding RangeLowerVal, StringFormat=0.000}"/>
</Label>
<Label Grid.Row="2" Grid.Column="2" Margin="0,0,25,0">
<TextBlock Text="{Binding RangeUpperVal, StringFormat=0.000}" HorizontalAlignment="Right"/>
</Label>
<Button Grid.Row="3" Grid.Column="0" Content="Clear SQL"
Style="{DynamicResource Esri_SimpleButton}"
Command="{Binding ClearSqlCommand}"/>
<Button Grid.Row="3" Grid.Column="2" Content="Apply Query"
Style="{DynamicResource Esri_SimpleButton}"
Command="{Binding ApplyQueryCommand}"/>
<Button Grid.Row="3" Grid.Column="1" Content="Add Clause"
Style="{DynamicResource Esri_SimpleButton}"
Command="{Binding AddSqlClauseCommand}"/>
</Grid>
<TextBox Height="Auto" TextWrapping="Wrap" Text="{Binding SqlWhereClause, Mode=TwoWay}"/>
</DockPanel>
</Grid>
</UserControl>