コード例 #1
0
        /// <summary>
        /// Button click event that gets fired when it is clicked on
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private async void btnAddLayer_Click(object sender, System.Windows.RoutedEventArgs e)
        {
            string url = TxtUri.Text;

            try
            {
                Layer lyr = await AddLayer(TxtUri.Text);

                FeatureLayer flyr = await GetFeatureLayer(lyr);

                if (flyr != null)
                {
                    MessageBox.Show(
                        String.Format("{0}: {1}",
                                      "Total number of features in the layer",
                                      flyr.GetCount()));
                }
            }
            catch (Exception)
            {
                MessageBox.Show("Failed to add the layer", "Feature Count");
                return;
            }
        }