<ItemsControl x:Name="MyItemsControls"> <ItemsControl.ItemTemplate> <DataTemplate> <StackPanel Margin="0,0,0,10"> <TextBlock Text="{Binding Feature.Attributes[PID], StringFormat='PID: \{0\}'}" /> <TextBlock Text="{Binding Feature.Attributes[ADDRESS], StringFormat='Address: \{0\}'}" /> </StackPanel> </DataTemplate> </ItemsControl.ItemTemplate> </ItemsControl>And you need to bind by code the ItemsSource property of your ItemsControl:
// Bind data grid to find results. Bind to the LastResult property which returns a list
// of FindResult instances. When LastResult is updated, the ItemsSource property on the
// will update.
Binding resultFeaturesBinding = new Binding("LastResult");
resultFeaturesBinding.Source = findTask;
MyItemsControls.SetBinding(ItemsControl.ItemsSourceProperty, resultFeaturesBinding);
<Grid Grid.Row="4">
<esri:FeatureDataGrid x:Name="MyDataGrid"
Map="{Binding ElementName=MyMap}"
GraphicsLayer="{Binding ElementName=MyMap, Path=Layers.[California]}" />
</Grid> <Grid Grid.Column="6" >
<StackPanel Orientation="Vertical" Margin="5" HorizontalAlignment="left" VerticalAlignment="top" >
<Grid x:Name="IdentifyGrid7" HorizontalAlignment="left" VerticalAlignment="Top" Margin="0,2,0,0" MouseEnter="TurnOnIncidents">
<Rectangle Fill="#CC5C90B2" Stroke="Gray" RadiusX="10" RadiusY="10" Margin="0,0,0,0" >
<Rectangle.Effect>
<DropShadowEffect/>
</Rectangle.Effect>
</Rectangle>
<TextBlock x:Name="DataDisplayTitleTop7" HorizontalAlignment="Center" Text="Items Control Search PID" Foreground="White" FontSize="10"
Margin="0,10,0,0" />
<StackPanel Margin="10,27,0,0" Orientation="Vertical" VerticalAlignment="Top" >
<StackPanel Orientation="Horizontal">
<TextBlock x:Name="DataDisplayTitleTop8" HorizontalAlignment="Left" Text="Phone: " Foreground="White" FontSize="10"
Margin="0,0,0,0" />
<TextBlock x:Name="DataDisplayTitleTop9" HorizontalAlignment="Left" Text="763.555.5555" Foreground="White"
Margin="0,0,0,0" >
<TextBlock.Effect>
<DropShadowEffect/>
</TextBlock.Effect>
</TextBlock>
</StackPanel>
</StackPanel>
<StackPanel x:Name="IdentifyResultsPanel7" Height="125" Width="250" Orientation="Vertical" Margin="0,85,0,0" HorizontalAlignment="Center">
<ScrollViewer VerticalScrollBarVisibility="Auto" Width="225" MaxHeight="200" >
<ItemsControl x:Name="MyItemsControls" MouseEnter="EnterItemsControl" >
<ItemsControl.ItemTemplate>
<DataTemplate>
<StackPanel Orientation="Horizontal" VerticalAlignment="Center" >
<StackPanel Margin="1">
<TextBlock Text="{Binding Feature.Attributes[HOUSE_NUMB]}" Foreground="White" FontSize="10" />
</StackPanel>
<StackPanel Margin="5,0,0,0" Orientation="Vertical">
<TextBlock Foreground="White" Text="{Binding Feature.Attributes[PID], StringFormat='PID: \{0\}'}" >
<TextBlock.Effect>
<DropShadowEffect/>
</TextBlock.Effect>
</TextBlock>
<TextBlock Foreground="White" Text="{Binding Feature.Attributes[ADDRESS], StringFormat='Address: \{0\}'}" >
<TextBlock.Effect>
<DropShadowEffect/>
</TextBlock.Effect>
</TextBlock>
</StackPanel>
</StackPanel>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
</ScrollViewer>
</StackPanel>
</Grid>
</StackPanel>
</Grid>
Private Sub EnterItemsControl(ByVal sender As Object, ByVal e As MouseEventArgs) ShowTimePanel.Begin() End Sub
Private Sub EnterItemsControl(ByVal sender As Object, ByVal e As MouseEventArgs)
' Highlight the graphic feature associated with the selected row
Dim ItemControlGrid As ItemsControl = TryCast(sender, ItemsControl)
Dim selectedIndex As Integer = ItemsControl.TabIndexProperty
If selectedIndex > -1 Then
Dim findResult As FindResult = CType(MyItemsControls.SelectedItem, FindResult)
Dim graphic As Graphic = findResult.Feature
Select Case graphic.Attributes("Shape").ToString()
Case "Polygon"
graphic.Symbol = TryCast(LayoutRoot.Resources("DefaultFillSymbol"), Symbol)
Case "Polyline"
graphic.Symbol = TryCast(LayoutRoot.Resources("DefaultLineSymbol"), Symbol)
Case "Point"
graphic.Symbol = TryCast(LayoutRoot.Resources("DefaultMarkerSymbol"), Symbol)
End Select
Dim graphicsLayer As GraphicsLayer = TryCast(MyMap.Layers("MyGraphicsLayerParcelHighlight"), GraphicsLayer)
graphicsLayer.ClearGraphics()
graphicsLayer.Graphics.Add(graphic)
End If
End Sub
imageList.ItemsSource = result.Photos.Photo;