У меня есть проблема с привязкой элементов моей dictionnary. My dictionnary содержит объект как ключ и целое число в качестве значения. Мне нужно связать этот dictionnary в ListView. Проблема в том, что мне нужно достичь свойств моего объекта, чтобы связать их в listview.Properties тип string.I не нашел решение, все дело в wpf, но я использую Windows8 с MVVM Light.Значения ключа привязки словаря в ListView C# XAML
Существует мой код:
Мой список:
<ListView ItemsSource="{Binding Path=MotDansTweet}"
HorizontalAlignment="Left"
Height="570"
Margin="64,28,0,0"
VerticalAlignment="Top"
Width="350"
Background="#FF009BB4"
Grid.Column="1">
<StackPanel Height="118"
Width="340">
<Grid Height="100">
<Grid HorizontalAlignment="Left"
Height="122"
VerticalAlignment="Top"
Width="330"
Margin="0,0,0,-22">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="137*" />
<ColumnDefinition Width="193*" />
</Grid.ColumnDefinitions>
<Image Source="{Binding Path=Key.ProfileImageUrl }"
HorizontalAlignment="Left"
Height="112"
VerticalAlignment="Top"
Width="127" />
<TextBlock Text="{Binding Path=Key.Username}"
Grid.Column="1"
HorizontalAlignment="Left"
Margin="10,10,0,0"
TextWrapping="Wrap"
VerticalAlignment="Top"
Height="46"
Width="173" />
<TextBlock Text="{Binding Path=Values}"
Grid.Column="1"
HorizontalAlignment="Left"
Margin="10,61,0,0"
TextWrapping="Wrap"
VerticalAlignment="Top"
Height="41"
Width="154" />
</Grid>
</Grid>
</StackPanel>
</ListView>
Мои Dictionnary:
private Dictionary<ObjetFollowingFollowerFinal,int> _motDansTweet ;
public Dictionary<ObjetFollowingFollowerFinal, int> MotDansTweet
{
get { return _motDansTweet; }
set
{
_motDansTweet = value;
RaisePropertyChanged("MotDansTweet");
}
}
Мой Объект:
public class ObjetFollowingFollowerFinal
{
public string Username { get; set; } // I need it
public string Description { get; set; }
public string ProfileImageUrl { get; set; } //I need it
public int StatusesCount { get; set; }
public int FollowerCount { get; set; }
public int FriendsCount { get; set; }
public int ListedCount { get; set; }
public List<User> ListeFollower = new List<User>();
public ObjetFollowingFollowerFinal()
{
}
}
Спасибо.
У вас есть ошибка или что? –