にDictionary<string,string>
表示したいデータを含む がありますListView
。はListView
間違いなく適切な数のアイテムを「認識」しますが (2 番目の から適切な数のコロンが表示されるため) 、 もバインディングTextBlock
も表示しません。Key
Value
Converter
または何かが必要ですか?
代わりに を変更して使用する必要がありますObservableCollection<KeyValuePair<string,string>>
か?
<ListView Grid.Row="1" IsItemClickEnabled="False"
SelectionMode="None" IsHitTestVisible="False"
IsSwipeEnabled="False"
ItemsSource="{Binding SymbolInfoText}">
<ListView.ItemTemplate>
<DataTemplate>
<StackPanel Orientation="Horizontal">
<TextBlock Text="{Binding Key}"/>
<TextBlock Text=": "/>
<TextBlock Text="{Binding Value}"/>
</StackPanel>
</DataTemplate>
</ListView.ItemTemplate>
</ListView>
public Dictionary<string, string> SymbolInfoText
{
get
{
if (selectedItem == null)
{
return new Dictionary<string, string> { { "Error", "No Item Selected" } };
}
return selectedItem.GenerateObjectProperties(CurrentLocation, LocalMapManager.Map.Heading);
}
}