public void Load() { var friends = _friendDataService.GetAll(); Friends.Clear(); Friends = new ObservableCollection <Friend>(friends); }
public void Load() { var friends = _friendDataService.GetAll(); foreach (var friend in friends) { Friends.Add(friend); } }
/// <summary> /// Load the friends from the Friends Data Service /// </summary> public void Load() { //Gets all the friends from the data Service //implement the IFriendDataService interface var friends = _friendDataService.GetAll(); //To ensure that the load method can be called multiple times //so as not to have duplicates Friends.Clear(); //get all the friends from friends foreach (var friend in friends) { Friends.Add(friend); } }
public void Load() { this.Friends = new ObservableCollection <Friend>(friendDataService.GetAll()); OnPropertyChanged("Friends"); }