private async void Initialize() { // Create the US states feature table. _usStatesTable = new ServiceFeatureTable(_usStatesServiceUri); // Load the table. await _usStatesTable.LoadAsync(); // Fill the fields combo and "group by" list with field names from the table. _fieldNames = _usStatesTable.Fields.Select(field => field.Name).ToList(); // Create a model that will provide statistic definition choices for the picker. _statsPickerModel = new StatDefinitionModel(_fieldNames.ToArray()); // Create a list of fields the user can select for grouping. // Value is initially false, since no fields are selected by default. _groupByFields = _fieldNames.ToDictionary(name => name, name => false); }
private async void Initialize() { // Create the US states feature table _usStatesTable = new ServiceFeatureTable(_usStatesServiceUri); // Load the table await _usStatesTable.LoadAsync(); // Get a list of field names from the table _fieldNames = _usStatesTable.Fields.Select(field => field.Name).ToList(); // Create a dictionary of fields the user can select for grouping // The value for each is set to false initially, as nothing is selected by default _groupByFields = _fieldNames.ToDictionary(name => name, name => false); // Create a list of field options for ordering results (initially empty) _orderByFields = new List <OrderFieldOption>(); }
private async void Initialize() { // Create the US states feature table _usStatesTable = new ServiceFeatureTable(_usStatesServiceUri); // Load the table await _usStatesTable.LoadAsync(); // Fill the fields combo and "group by" list with fields from the table FieldsComboBox.ItemsSource = _usStatesTable.Fields; GroupFieldsListBox.ItemsSource = _usStatesTable.Fields; // Set the (initially empty) collection of fields as the "order by" fields list data source OrderByFieldsListBox.ItemsSource = _orderByFields; // Fill the statistics type combo with values from the StatisticType enum StatTypeComboBox.ItemsSource = Enum.GetValues(typeof(StatisticType)); // Set the (initially empty) collection of statistic definitions as the statistics list box data source StatFieldsListBox.ItemsSource = _statDefinitions; }