You can use the following code:XAML
<StackPanel Orientation="Horizontal" VerticalAlignment="Top" HorizontalAlignment="Center">
<ComboBox x:Name="LayerNames">
<ComboBox.ItemTemplate>
<DataTemplate>
<TextBlock Text="{Binding Value.Name}"/>
</DataTemplate>
</ComboBox.ItemTemplate>
</ComboBox>
<ComboBox x:Name="FieldNames" DataContext="{Binding ElementName=LayerNames, Path=SelectedItem}"
ItemsSource="{Binding Value.Fields}">
<ComboBox.ItemTemplate>
<DataTemplate>
<TextBlock Text="{Binding Name}"/>
</DataTemplate>
</ComboBox.ItemTemplate>
</ComboBox>
</StackPanel>
Code-Behind
var layer = new ArcGISDynamicMapServiceLayer() { Url = "http://sampleserver3.arcgisonline.com/ArcGIS/rest/services/HomelandSecurity/operations/MapServer" };
layer.GetAllDetails((a, b) =>
{
if (b != null)
MessageBox.Show(b.Message);
else
LayerNames.ItemsSource = a;
});