Is there a way to add a Title or label to info window? I'm looking to make it the layer name.
void featureLayer_Initialized(object sender, System.EventArgs e) { FeatureLayer featureLayer = sender as FeatureLayer; Map.Layers.Add(featureLayer); string layerName = featureLayer.LayerInfo.Name.ToString(); MapTip maptip= new MapTip(); maptip.Title = layerName; maptip.GraphicsLayer = featureLayer; }
<DataTemplate x:Key="MyInfoWindowTemplate"> <Grid> <Grid.RowDefinitions> <RowDefinition/> <RowDefinition/> </Grid.RowDefinitions> <TextBlock Text="{Binding [LayerName]}" FontWeight="Bold" /> <TextBlock Text="{Binding [STATE_NAME]}" Foreground="Black" FontSize="12" Grid.Row="1" /> </Grid> </DataTemplate>
void it_ExecuteCompleted(object sender, IdentifyEventArgs e) { MapPoint clickPoint = e.UserState as MapPoint; foreach (var result in e.IdentifyResults) { MyInfoWindow.Anchor = clickPoint; MyInfoWindow.IsOpen = true; result.Feature.Attributes ["LayerName"] = result.LayerName; MyInfoWindow.Content = result.Feature.Attributes; return; } }
Jennifer,
I have a project where we are using the esriToolkit:InfoWindow to display information about a vessel at a given location
I see where we are Binding the information to the window in a Binding[START_DATE] tag
My question is, how can I take the date/time received and then convert it an acceptable format for our users?
Thanks!
<DataTemplate x:Key="MyInfoWindowTemplate"> <Grid> <Grid.RowDefinitions> <RowDefinition/> <RowDefinition/> </Grid.RowDefinitions> <TextBlock Text="{Binding [LayerName]}" FontWeight="Bold" /> <slDataataGrid AutoGenerateColumns="False" HeadersVisibility="None" ItemsSource="{Binding}" Grid.Row="1" /> ... </Grid> </DataTemplate>