:::::::::: ObservableCollection ::::::::::
ObservableCollection<Friend> Friends = new ObservableCollection<Friend> ( );
:::::::::: InitializeFriends ::::::::::
private void InitializeFriends ( )
{
JsonObject _JsonObject = Process . FacebookClient . Get ( "/me/friends" ) as JsonObject;
if ( _JsonObject != null )
{
JsonArray _JsonArray = _JsonObject [ "data" ] as JsonArray;
foreach ( JsonObject Friend in _JsonArray )
{
Friends . Add ( new Friend ( ) { Name = Friend [ "name" ] . ToString ( ) } );
}
}
}
:::::::::: Friend ::::::::::
public class Friend
{
public string Name { get; set; }
public Conversation Chat { get; set; }
public BitmapImage Image { get; set; }
}
:::::::::: ListView ::::::::::
<ListView Name="Panel"
Width="Auto"
Margin="0,200,0,0"
HorizontalAlignment="Stretch"
VerticalAlignment="Stretch"
Background="{x:Null}"
BorderThickness="0"
ItemsSource="{Binding Path=Friends,
Mode=TwoWay}"
ScrollViewer.HorizontalScrollBarVisibility="Disabled"
SelectionMode="Single">
<ListView.ItemsPanel>
<ItemsPanelTemplate>
<WrapPanel Orientation="Horizontal" />
</ItemsPanelTemplate>
</ListView.ItemsPanel>
<ListView.View>
<GridView ColumnHeaderContainerStyle="{StaticResource hiddenStyle}">
<GridViewColumn Width="200" DisplayMemberBinding="{Binding Path=Name}" />
<GridViewColumn Width="100">
<GridViewColumn.CellTemplate>
<DataTemplate>
<StackPanel>
<Image Width="30"
Height="30"
Source="{Binding Path=Image}" />
</StackPanel>
</DataTemplate>
</GridViewColumn.CellTemplate>
</GridViewColumn>
</GridView>
</ListView.View>
</ListView>
List View Not Binding May Be Binding But Not Updating ?!!!
There is something WRONG
Your
Friendclass needs to implement the INotifyPropertyChanged interface, so that WPF notifies when a change has been made to that property.