private async Task <PublicHousingAuthorityInfo> GetPublicHousingAuthorityInfoAsync(string city, string state)
        {
            ArcGisBaseUri uri       = new ArcGisBaseUri("VTyQ9soqVukalItT", "PublicHousingAuthorities");
            var           queryTask = new QueryTask(new Uri(uri.ToString()));

            var timeWindow = new Esri.ArcGISRuntime.Data.TimeExtent(DateTime.Now.Subtract(new TimeSpan(0, 5, 0, 0)), DateTime.Now);

            var queryParams = new Esri.ArcGISRuntime.Tasks.Query.Query(timeWindow);

            queryParams.Where     = String.Format("(STD_CITY = '{0}' AND STD_ST = '{1}')", city, state);
            queryParams.OutFields = OutFields.All;

            QueryResult queryResult = await queryTask.ExecuteAsync(queryParams);

            var attributes = queryResult.FeatureSet.Features[0].Attributes;

            return(new PublicHousingAuthorityInfo
            {
                Name = (string)attributes["FORMAL_PARTICIPANT_NAME"],
                Address = (string)attributes["STD_ADDR"],
                Phone = (string)attributes["EXEC_DIR_PHONE"],
                City = (string)attributes["STD_CITY"],
                State = (string)attributes["STD_ST"],
                PostalCode = (string)attributes["STD_ZIP5"],
                Email = (string)attributes["EXEC_DIR_EMAIL"]
            });
        }
        // Create webmap layer out of a feature set from a query task
        private async Task <WebMapLayer> CreateFeatureCollectionLayer()
        {
            try
            {
                //Perform Query to get a featureSet and add to webmap as featurecollection
                QueryTask qt = new QueryTask(
                    new Uri("http://sampleserver3.arcgisonline.com/ArcGIS/rest/services/Earthquakes/EarthquakesFromLastSevenDays/MapServer/0"));

                Esri.ArcGISRuntime.Tasks.Query.Query query = new Esri.ArcGISRuntime.Tasks.Query.Query("magnitude > 3.5");
                query.OutFields.Add("*");
                query.ReturnGeometry = true;

                var queryResult = await qt.ExecuteAsync(query);

                Dictionary <string, object> layerdef      = new Dictionary <string, object>();
                Dictionary <string, object> defdictionary = new Dictionary <string, object>()
                {
                    { "id", 0 },
                    { "name", "Earthquakes from last 7 days" }
                };

                Dictionary <string, object> renderer = new Dictionary <string, object>();
                renderer.Add("type", "simple");
                renderer.Add("style", "esriSMSCircle");

                int[] color = new int[] { 255, 0, 0, 255 };
                renderer.Add("color", color);
                renderer.Add("size", 4);

                defdictionary.Add("drawingInfo", renderer);

                layerdef.Add("layerDefinition", defdictionary);

                //Create FeatureCollection as webmap layer
                FeatureCollection featureCollection = null;

                if (queryResult.FeatureSet.Features.Count > 0)
                {
                    var sublayer = new WebMapSubLayer();
                    sublayer.FeatureSet = queryResult.FeatureSet;

                    sublayer.AddCustomProperty("layerDefinition", layerdef);
                    featureCollection = new FeatureCollection {
                        SubLayers = new List <WebMapSubLayer> {
                            sublayer
                        }
                    };
                }

                return(new WebMapLayer {
                    FeatureCollection = featureCollection
                });
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Sample Error");
                return(null);
            }
        }
        // Create webmap layer out of a feature set from a query task
        private async Task <WebMapLayer> CreateFeatureCollectionLayer()
        {
            try
            {
                //Perform Query to get a featureSet and add to webmap as featurecollection
                QueryTask qt = new QueryTask(
                    new Uri("http://sampleserver3.arcgisonline.com/ArcGIS/rest/services/Earthquakes/EarthquakesFromLastSevenDays/MapServer/0"));

                Esri.ArcGISRuntime.Tasks.Query.Query query = new Esri.ArcGISRuntime.Tasks.Query.Query("magnitude > 3.5");
                query.OutFields.Add("*");
                query.ReturnGeometry = true;

                var queryResult = await qt.ExecuteAsync(query);

                var simpleRenderer = new SimpleRenderer {
                    Symbol = new SimpleMarkerSymbol {
                        Style = SimpleMarkerStyle.Circle, Color = Color.FromArgb(255, 0, 0, 255), Size = 8
                    }
                };
                var drawingInfo = new DrawingInfo {
                    Renderer = simpleRenderer
                };
                var layerDefinition = new LayerDefinition {
                    DrawingInfo = drawingInfo
                };

                //Create FeatureCollection as webmap layer
                FeatureCollection featureCollection = null;

                if (queryResult.FeatureSet.Features.Count > 0)
                {
                    var sublayer = new WebMapSubLayer();
                    sublayer.Id         = 0;
                    sublayer.FeatureSet = queryResult.FeatureSet;

                    sublayer.LayerDefinition = layerDefinition;
                    featureCollection        = new FeatureCollection
                    {
                        SubLayers = new List <WebMapSubLayer> {
                            sublayer
                        }
                    };
                }

                return(new WebMapLayer {
                    FeatureCollection = featureCollection, Title = "Earthquakes from last 7 days"
                });
            }
            catch (Exception ex)
            {
                var _ = new MessageDialog(ex.Message, "Sample Error").ShowAsync();
                return(null);
            }
        }
        // Create webmap layer out of a feature set from a query task
        private async Task<WebMapLayer> CreateFeatureCollectionLayer()
        {
            try
            {
                //Perform Query to get a featureSet and add to webmap as featurecollection
                QueryTask qt = new QueryTask(
                    new Uri("http://sampleserver3.arcgisonline.com/ArcGIS/rest/services/Earthquakes/EarthquakesFromLastSevenDays/MapServer/0"));

                Esri.ArcGISRuntime.Tasks.Query.Query query = new Esri.ArcGISRuntime.Tasks.Query.Query("magnitude > 3.5");
                query.OutFields.Add("*");
                query.ReturnGeometry = true;

                var queryResult = await qt.ExecuteAsync(query);

                var simpleRenderer = new SimpleRenderer { Symbol = new SimpleMarkerSymbol { Style = SimpleMarkerStyle.Circle, Color = Color.FromArgb(255, 0, 0, 255), Size = 8 } };
                var drawingInfo = new DrawingInfo { Renderer = simpleRenderer };
                var layerDefinition = new LayerDefinition {DrawingInfo = drawingInfo};

                //Create FeatureCollection as webmap layer
                FeatureCollection featureCollection = null;

                if (queryResult.FeatureSet.Features.Count > 0)
                {
                    var sublayer = new WebMapSubLayer();
                    sublayer.Id = 0;
                    sublayer.FeatureSet = queryResult.FeatureSet;

                    sublayer.LayerDefinition = layerDefinition;
                    featureCollection = new FeatureCollection { 
                        SubLayers = new List<WebMapSubLayer> { sublayer } 
                    };
                }

                return new WebMapLayer { FeatureCollection = featureCollection, Title = "Earthquakes from last 7 days" };
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Sample Error");
                return null;
            }
        }
        // Create webmap layer out of a feature set from a query task
        private async Task<WebMapLayer> CreateFeatureCollectionLayer()
        {
            try
            {
                //Perform Query to get a featureSet and add to webmap as featurecollection
                QueryTask qt = new QueryTask(
                    new Uri("http://sampleserver3.arcgisonline.com/ArcGIS/rest/services/Earthquakes/EarthquakesFromLastSevenDays/MapServer/0"));

                Esri.ArcGISRuntime.Tasks.Query.Query query = new Esri.ArcGISRuntime.Tasks.Query.Query("magnitude > 3.5");
                query.OutFields.Add("*");
                query.ReturnGeometry = true;

                var queryResult = await qt.ExecuteAsync(query);

                Dictionary<string, object> layerdef = new Dictionary<string, object>();
                Dictionary<string, object> defdictionary = new Dictionary<string, object>() 
                { 
                    { "id", 0 }, 
                    { "name", "Earthquakes from last 7 days" } 
                };

                Dictionary<string, object> renderer = new Dictionary<string, object>();
                renderer.Add("type", "simple");
                renderer.Add("style", "esriSMSCircle");

                int[] color = new int[] { 255, 0, 0, 255 };
                renderer.Add("color", color);
                renderer.Add("size", 4);

                defdictionary.Add("drawingInfo", renderer);

                layerdef.Add("layerDefinition", defdictionary);

                //Create FeatureCollection as webmap layer
                FeatureCollection featureCollection = null;

                if (queryResult.FeatureSet.Features.Count > 0)
                {
                    var sublayer = new WebMapSubLayer();
                    sublayer.FeatureSet = queryResult.FeatureSet;

                    sublayer.AddCustomProperty("layerDefinition", layerdef);
                    featureCollection = new FeatureCollection { SubLayers = new List<WebMapSubLayer> { sublayer } };
                }

                return new WebMapLayer { FeatureCollection = featureCollection };
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Sample Error");
                return null;
            }
        }