|
12 | 12 | xmlns:sys="clr-namespace:System;assembly=mscorlib" |
13 | 13 | mc:Ignorable="d" |
14 | 14 | Title="MainWindow" Height="800" Width="1100"> |
| 15 | + <Window.DataContext> |
| 16 | + <local:SampleViewModel/> |
| 17 | + </Window.DataContext> |
| 18 | + |
15 | 19 | <Window.Resources> |
16 | 20 | <BooleanToVisibilityConverter x:Key="boolToVisibility"/> |
| 21 | + |
| 22 | + <Style x:Key="HeaderText1" TargetType="TextBlock"> |
| 23 | + <Setter Property="FontWeight" Value="Bold"/> |
| 24 | + <Setter Property="Foreground" Value="#FF0052A6"/> |
| 25 | + <Setter Property="Margin" Value="0,3"/> |
| 26 | + <Setter Property="FontSize" Value="18"/> |
| 27 | + </Style> |
| 28 | + |
| 29 | + <Style x:Key="HeaderText2" TargetType="TextBlock"> |
| 30 | + <Setter Property="FontWeight" Value="Bold"/> |
| 31 | + <Setter Property="Foreground" Value="#FF0072C6"/> |
| 32 | + <Setter Property="Margin" Value="0,3"/> |
| 33 | + <Setter Property="FontSize" Value="14"/> |
| 34 | + </Style> |
| 35 | + |
| 36 | + <Style x:Key="LabelText" TargetType="TextBlock"> |
| 37 | + <Setter Property="FontWeight" Value="Bold"/> |
| 38 | + <Setter Property="Margin" Value="0,3"/> |
| 39 | + <Setter Property="VerticalAlignment" Value="Center"/> |
| 40 | + </Style> |
| 41 | + |
| 42 | + <Style x:Key="ColorPicker" TargetType="igControls:XamColorPicker"> |
| 43 | + <Setter Property="Margin" Value="0,3"/> |
| 44 | + </Style> |
| 45 | + |
| 46 | + <Style x:Key="TextBoxText" TargetType="TextBox"> |
| 47 | + <Setter Property="FontWeight" Value="Regular"/> |
| 48 | + <Setter Property="Foreground" Value="Black"/> |
| 49 | + <Setter Property="FontSize" Value="14"/> |
| 50 | + <Setter Property="Margin" Value="0,3"/> |
| 51 | + </Style> |
| 52 | + |
| 53 | + <Style x:Key="NumericEditorText" TargetType="igEditors:XamNumericEditor"> |
| 54 | + <Setter Property="FontWeight" Value="Regular"/> |
| 55 | + <Setter Property="Foreground" Value="Black"/> |
| 56 | + <Setter Property="FontSize" Value="14"/> |
| 57 | + <Setter Property="Margin" Value="0,2"/> |
| 58 | + <Setter Property="Width" Value="100"/> |
| 59 | + <Setter Property="HorizontalAlignment" Value="Left"/> |
| 60 | + <Setter Property="SpinButtonDisplayMode" Value="Always"/> |
| 61 | + <Setter Property="SpinIncrement" Value="10"/> |
| 62 | + <Setter Property="Mask" Value="9999"/> |
| 63 | + </Style> |
| 64 | + |
| 65 | + <Style x:Key="ComboBoxText" TargetType="ComboBox"> |
| 66 | + <Setter Property="FontWeight" Value="Regular"/> |
| 67 | + <Setter Property="Foreground" Value="Black"/> |
| 68 | + <Setter Property="FontSize" Value="14"/> |
| 69 | + <Setter Property="Margin" Value="0,2"/> |
| 70 | + </Style> |
| 71 | + |
| 72 | + <Style x:Key="CheckBoxText" TargetType="CheckBox"> |
| 73 | + <Setter Property="FontWeight" Value="Regular"/> |
| 74 | + <Setter Property="Foreground" Value="Black"/> |
| 75 | + <Setter Property="FontSize" Value="14"/> |
| 76 | + <Setter Property="Margin" Value="0,2"/> |
| 77 | + <Setter Property="VerticalAlignment" Value="Center"/> |
| 78 | + </Style> |
17 | 79 | </Window.Resources> |
18 | 80 |
|
19 | 81 | <Grid> |
| 82 | + <Grid.RowDefinitions> |
| 83 | + <RowDefinition Height="Auto"/> |
| 84 | + <RowDefinition Height="*"/> |
| 85 | + </Grid.RowDefinitions> |
| 86 | + |
20 | 87 | <Grid.ColumnDefinitions> |
21 | 88 | <ColumnDefinition Width="5*"/> |
22 | 89 | <ColumnDefinition Width="Auto"/> |
23 | 90 | <ColumnDefinition Width="9*"/> |
24 | 91 | </Grid.ColumnDefinitions> |
25 | 92 |
|
26 | | - <StackPanel Grid.Column="0" Margin="6"> |
| 93 | + <StackPanel Grid.RowSpan="2" Grid.Column="0" Margin="6"> |
27 | 94 | <StackPanel> |
28 | | - <StackPanel.Resources> |
29 | | - <Style x:Key="HeaderText1" TargetType="TextBlock"> |
30 | | - <Setter Property="FontWeight" Value="Bold"/> |
31 | | - <Setter Property="Foreground" Value="#FF0052A6"/> |
32 | | - <Setter Property="Margin" Value="0,3"/> |
33 | | - <Setter Property="FontSize" Value="18"/> |
34 | | - </Style> |
35 | | - |
36 | | - <Style x:Key="HeaderText2" TargetType="TextBlock"> |
37 | | - <Setter Property="FontWeight" Value="Bold"/> |
38 | | - <Setter Property="Foreground" Value="#FF0072C6"/> |
39 | | - <Setter Property="Margin" Value="0,3"/> |
40 | | - <Setter Property="FontSize" Value="14"/> |
41 | | - </Style> |
42 | | - |
43 | | - <Style x:Key="LabelText" TargetType="TextBlock"> |
44 | | - <Setter Property="FontWeight" Value="Bold"/> |
45 | | - <Setter Property="Margin" Value="0,3"/> |
46 | | - <Setter Property="VerticalAlignment" Value="Center"/> |
47 | | - </Style> |
48 | | - |
49 | | - <Style x:Key="ColorPicker" TargetType="igControls:XamColorPicker"> |
50 | | - <Setter Property="Margin" Value="0,3"/> |
51 | | - </Style> |
52 | | - |
53 | | - <Style x:Key="TextBoxText" TargetType="TextBox"> |
54 | | - <Setter Property="FontWeight" Value="Regular"/> |
55 | | - <Setter Property="Foreground" Value="Black"/> |
56 | | - <Setter Property="FontSize" Value="14"/> |
57 | | - <Setter Property="Margin" Value="0,3"/> |
58 | | - </Style> |
59 | | - |
60 | | - <Style x:Key="NumericEditorText" TargetType="igEditors:XamNumericEditor"> |
61 | | - <Setter Property="FontWeight" Value="Regular"/> |
62 | | - <Setter Property="Foreground" Value="Black"/> |
63 | | - <Setter Property="FontSize" Value="14"/> |
64 | | - <Setter Property="Margin" Value="0,2"/> |
65 | | - </Style> |
66 | | - |
67 | | - <Style x:Key="ComboBoxText" TargetType="ComboBox"> |
68 | | - <Setter Property="FontWeight" Value="Regular"/> |
69 | | - <Setter Property="Foreground" Value="Black"/> |
70 | | - <Setter Property="FontSize" Value="14"/> |
71 | | - <Setter Property="Margin" Value="0,2"/> |
72 | | - </Style> |
73 | | - |
74 | | - <Style x:Key="CheckBoxText" TargetType="CheckBox"> |
75 | | - <Setter Property="FontWeight" Value="Regular"/> |
76 | | - <Setter Property="Foreground" Value="Black"/> |
77 | | - <Setter Property="FontSize" Value="14"/> |
78 | | - <Setter Property="Margin" Value="0,2"/> |
79 | | - <Setter Property="VerticalAlignment" Value="Center"/> |
80 | | - </Style> |
81 | | - </StackPanel.Resources> |
82 | | - |
83 | | - <!-- Dropdown list of publicly accessible ODATA SERVICES--> |
| 95 | + <!-- A dropdown list of publicly accessible ODATA SERVICES--> |
84 | 96 | <TextBlock Text="ODATA SERVICES" Style="{StaticResource HeaderText1}"/> |
85 | | - <ComboBox x:Name="cboOdataSources" SelectionChanged="cboOdataSources_SelectionChanged" Style="{StaticResource ComboBoxText}"> |
| 97 | + <ComboBox x:Name="cboOdataSources" |
| 98 | + SelectedIndex="0" |
| 99 | + SelectedValue="{Binding CurrentDataSourceConfigurationInfo}" |
| 100 | + Style="{StaticResource ComboBoxText}"> |
86 | 101 | <local:DataSourceConfigurationInfo BaseUri="http://data.scottsdaleaz.gov/Planning/BuildingPermits.svc" EntitySet="BuildingPermits" Description="Scottsdale Building Permits"> |
87 | | - <!-- Limit the amount of data fetched from this OData service by setting the FieldsRequested property. Refer to |
88 | | - the cboOdataSources_SelectionChanged event handler code in MainWindow.xaml.cs to see how we apply these settings when |
89 | | - we create a new ODataDataSource instance. --> |
| 102 | + <!-- An example of how to improve data source responsiveness by limiting the amount of data fetched from this OData |
| 103 | + service. We do this by setting the FieldsRequested property to a subset of all fields defined in the backend schema. |
| 104 | + Note that this requires knowledge of the field names defined in the backend schema. --> |
90 | 105 | <local:DataSourceConfigurationInfo.FieldsRequested> |
91 | 106 | <x:Array Type="sys:String"> |
92 | 107 | <sys:String>PermitNumber</sys:String> |
|
109 | 124 | <local:DataSourceConfigurationInfo BaseUri="http://services.odata.org/AdventureWorksV3/AdventureWorks.svc" EntitySet="WorkOrderRouting" Description="AdventureWorks Workorder Routing"/> |
110 | 125 | <local:DataSourceConfigurationInfo BaseUri="http://packages.nuget.org/v1/FeedService.svc" EntitySet="Packages" Description="NuGet Packages"/> |
111 | 126 | </ComboBox> |
112 | | - <CheckBox x:Name="chkNullOutDatasource" IsChecked="True" Style="{StaticResource CheckBoxText}">Null out datasource before setting new</CheckBox> |
113 | 127 |
|
114 | 128 | <!-- Separator --> |
115 | 129 | <Rectangle Height="1" HorizontalAlignment="Stretch" Fill="Gray" Margin="5,20,5,0"/> |
|
118 | 132 | <Rectangle Width="1" Height="20" Fill="Transparent"/> |
119 | 133 | <TextBlock Text="DATASOURCE SETTINGS" Style="{StaticResource HeaderText1}"/> |
120 | 134 |
|
121 | | - <!-- Desired Page Size --> |
| 135 | + <!-- Page Size Requested --> |
122 | 136 | <TextBlock Text="PAGE SIZE REQUESTED" Style="{StaticResource HeaderText2}"/> |
123 | | - <igEditors:XamNumericEditor x:Name="numPageSizeRequested" Width="100" HorizontalAlignment="Left" Mask="9999" EditModeEnded="numPageSizeRequested_EditModeEnded" SpinButtonDisplayMode="Always" SpinIncrement="10" Style="{StaticResource NumericEditorText}"> |
| 137 | + <igEditors:XamNumericEditor x:Name="numPageSizeRequested" Value="{Binding PageSizeRequested}" ValueType="{x:Type sys:Int32}" Style="{StaticResource NumericEditorText}"> |
124 | 138 | <igEditors:XamNumericEditor.ValueConstraint> |
125 | 139 | <igEditors:ValueConstraint MinInclusive="5" MaxInclusive="1000"/> |
126 | 140 | </igEditors:XamNumericEditor.ValueConstraint> |
|
129 | 143 | <!-- Maximum number of cached pages --> |
130 | 144 | <Rectangle Width="1" Height="20" Fill="Transparent"/> |
131 | 145 | <TextBlock Text="MAX # CACHED PAGES" Style="{StaticResource HeaderText2}"/> |
132 | | - <igEditors:XamNumericEditor x:Name="numMaxCachedPages" Width="100" HorizontalAlignment="Left" Mask="9999" EditModeEnded="numMaxCachedPages_EditModeEnded" SpinButtonDisplayMode="Always" SpinIncrement="10" Style="{StaticResource NumericEditorText}"> |
| 146 | + <igEditors:XamNumericEditor x:Name="numMaxCachedPages" Value="{Binding MaxCachedPages}" ValueType="{x:Type sys:Int32}" Style="{StaticResource NumericEditorText}"> |
133 | 147 | <igEditors:XamNumericEditor.ValueConstraint> |
134 | 148 | <igEditors:ValueConstraint MinInclusive="5" MaxInclusive="1000"/> |
135 | 149 | </igEditors:XamNumericEditor.ValueConstraint> |
|
172 | 186 | </Grid.RowDefinitions> |
173 | 187 |
|
174 | 188 | <TextBlock Grid.Row="0" Grid.Column="0" Text="RECORD FILTER LOGICAL OPERATOR" Style="{StaticResource LabelText}"/> |
175 | | - <ComboBox x:Name="cboRecordFilterLogicalOperator" Grid.Row="0" Grid.Column="1" SelectionChanged="cboRecordFilterLogicalOperator_SelectionChanged" Margin="2" Style="{StaticResource ComboBoxText}"> |
| 189 | + <ComboBox x:Name="cboRecordFilterLogicalOperator" Grid.Row="0" Grid.Column="1" SelectedIndex="0" SelectionChanged="cboRecordFilterLogicalOperator_SelectionChanged" Margin="2" Style="{StaticResource ComboBoxText}"> |
176 | 190 | <sys:String>And</sys:String> |
177 | 191 | <sys:String>Or</sys:String> |
178 | 192 | </ComboBox> |
|
189 | 203 |
|
190 | 204 | <Grid.RowDefinitions> |
191 | 205 | <RowDefinition /> |
192 | | - <RowDefinition /> |
193 | 206 | </Grid.RowDefinitions> |
194 | 207 |
|
195 | | - <TextBlock Grid.Row="0" Grid.Column="0" Text="VIEW" Style="{StaticResource LabelText}"/> |
196 | | - <ComboBox x:Name="cboDataPresenterView" Grid.Row="0" Grid.Column="1" SelectionChanged="cboDataPresenterView_SelectionChanged" Margin="2" Style="{StaticResource ComboBoxText}"> |
197 | | - <sys:String>GridView</sys:String> |
198 | | - <sys:String>CardView</sys:String> |
199 | | - <sys:String>CarouselView</sys:String> |
200 | | - <sys:String>TreeView</sys:String> |
201 | | - </ComboBox> |
202 | | - |
203 | | - <TextBlock Grid.Row="1" Grid.Column="0" Text="THEME" Style="{StaticResource LabelText}"/> |
| 208 | + <TextBlock Grid.Row="0" Grid.Column="0" Text="THEME" Style="{StaticResource LabelText}"/> |
204 | 209 | <ComboBox x:Name="cboThemes" Grid.Row="1" Grid.Column="1" SelectionChanged="cboThemes_SelectionChanged" Margin="2" Style="{StaticResource ComboBoxText}"/> |
205 | 210 | </Grid> |
206 | 211 |
|
|
234 | 239 | </StackPanel> |
235 | 240 | </StackPanel> |
236 | 241 |
|
237 | | - <GridSplitter Grid.Column="1" Width="7" Margin="2,0" Background="#FFDDDDDD" ResizeBehavior="PreviousAndNext"/> |
| 242 | + <GridSplitter Grid.Column="1" Grid.RowSpan="2" Width="7" Margin="2,0" Background="#FFBBBBBB" ResizeBehavior="PreviousAndNext"/> |
| 243 | + |
| 244 | + <!-- Summary info for the currently selected OData DataSource --> |
| 245 | + <Grid Grid.Column="2" Margin="5,0,5,20"> |
| 246 | + <Grid.RowDefinitions> |
| 247 | + <RowDefinition Height="Auto"/> |
| 248 | + <RowDefinition Height="Auto"/> |
| 249 | + </Grid.RowDefinitions> |
| 250 | + |
| 251 | + <Grid.ColumnDefinitions> |
| 252 | + <ColumnDefinition Width="Auto"/> |
| 253 | + <ColumnDefinition Width="*"/> |
| 254 | + <ColumnDefinition Width="*"/> |
| 255 | + </Grid.ColumnDefinitions> |
| 256 | + |
| 257 | + <Border Grid.Column="0" BorderThickness="0,0,1,1" BorderBrush="DarkGray"> |
| 258 | + <TextBlock Text="DATA SOURCE URI" Style="{StaticResource HeaderText2}" Padding="3,0"/> |
| 259 | + </Border> |
| 260 | + <Border Grid.Column="1" BorderThickness="0,0,1,1" BorderBrush="DarkGray"> |
| 261 | + <TextBlock Text="ENTITYSET" Style="{StaticResource HeaderText2}" Padding="3,0"/> |
| 262 | + </Border> |
| 263 | + <Border Grid.Column="2" BorderThickness="0,0,0,1" BorderBrush="DarkGray"> |
| 264 | + <TextBlock Text="# RECORDS" Style="{StaticResource HeaderText2}" Padding="3,0"/> |
| 265 | + </Border> |
| 266 | + |
| 267 | + <Border Grid.Row="1" Grid.Column="0" Padding="0,0,6,0" BorderThickness="0,0,1,0" BorderBrush="DarkGray"> |
| 268 | + <TextBlock Grid.Row="1" Grid.Column="0" Text="{Binding ElementName=cboOdataSources, Path=(SelectedItem).BaseUri}" Padding="3,0"/> |
| 269 | + </Border> |
| 270 | + |
| 271 | + <Border Grid.Row="1" Grid.Column="1" Padding="0,0,6,0" BorderThickness="0,0,1,0" BorderBrush="DarkGray"> |
| 272 | + <TextBlock Text="{Binding ElementName=cboOdataSources, Path=(SelectedItem).EntitySet}" Padding="3,0"/> |
| 273 | + </Border> |
| 274 | + |
| 275 | + <Border Grid.Row="1" Grid.Column="2" Padding="0,0,6,0"> |
| 276 | + <TextBlock Text="{Binding Path=CurrentDataSource.RecordCount, StringFormat=N0}" Padding="3,0"/> |
| 277 | + </Border> |
| 278 | + </Grid> |
238 | 279 |
|
239 | | - <igDP:XamDataPresenter x:Name="dataPresenter1" Grid.Column="2" Theme="{Binding ElementName=cboThemes, Path=SelectedValue, Mode=OneWay}" Margin="5,0,0,0"> |
| 280 | + <!-- XamDataPresenter --> |
| 281 | + <igDP:XamDataPresenter x:Name="dataPresenter1" |
| 282 | + Grid.Row="1" |
| 283 | + Grid.Column="2" |
| 284 | + DataSource="{Binding CurrentDataSource}" |
| 285 | + Theme="{Binding ElementName=cboThemes, Path=SelectedValue, Mode=OneWay}" |
| 286 | + Margin="5" |
| 287 | + GroupByAreaLocation="None"> |
240 | 288 | <igDP:XamDataPresenter.FieldLayoutSettings> |
241 | 289 | <igDP:FieldLayoutSettings FilterEvaluationMode="UseCollectionView"/> |
242 | 290 | </igDP:XamDataPresenter.FieldLayoutSettings> |
|
246 | 294 | </igDP:XamDataPresenter.FieldSettings> |
247 | 295 | </igDP:XamDataPresenter> |
248 | 296 |
|
249 | | - <igControls:XamBusyIndicator Grid.Column="2" |
| 297 | + <!-- XamBusyIndicator --> |
| 298 | + <igControls:XamBusyIndicator Grid.Row="1" |
| 299 | + Grid.Column="2" |
250 | 300 | IsBusy="{Binding ElementName=dataPresenter1, Path=IsAsyncDataPending}" |
251 | 301 | Visibility="{Binding ElementName=chkShowBusyIndicator, Path=IsChecked, Converter={StaticResource boolToVisibility}}" |
252 | 302 | BusyContent="Fetching Data..." |
|
0 commit comments