<Button Tag="{Binding [YourAttribute]}" ..../>
Button button = sender as Button; string attribute = button.Tag.ToString();
private void btnOpenReport_Click(object sender, RoutedEventArgs e) { QueryTask queryFL = new QueryTask("http://xyz/MapServer/29"); queryFL.ExecuteCompleted += new EventHandler<QueryEventArgs>(queryFL_ExecuteCompleted); queryFL.Failed += new EventHandler<TaskFailedEventArgs>(queryFL_Failed); FeatureLayer tmpFL = MyMap.Layers["FLParcels"] as FeatureLayer; // ! ID, not x:Name ! TextBlock tmp = tmpFL.MapTip.FindName("MapTipTitle") as TextBlock; String strFolio = tmp.Text.ToString(); Query query = new Query(); query.OutFields.Add("*"); query.Where = "folio = " + strFolio; queryFL.ExecuteAsync(query); bool bVisible = slPanel.IsVisible; if (bVisible) slPanel.Visibility = Visibility.Collapsed; else { slPanel.Visibility = Visibility.Visible; } } void queryFL_Failed(object sender, TaskFailedEventArgs e) { //throw new NotImplementedException(); MessageBox.Show("Query failed: " + e.Error); } void queryFL_ExecuteCompleted(object sender, QueryEventArgs e) { //throw new NotImplementedException(); FeatureSet FSresult = e.FeatureSet; // target in full report textBox1.Text = FSresult.Features[0].Attributes["street_nam"].ToString(); }
Los miembros registrados pueden publicar, seguir actualizaciones y más. ¿Nuevo aquí? Regístrate gratis.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.