public UserDataPage() { InitializeComponent(); photosCollectionControl.CellSelected += photosCollectionControl_CellSelected; AlbumsCollectionViewModel = new AlbumsViewModel(); photosCollectionControl.Initialize(AlbumsCollectionViewModel); AlbumsCollectionViewModel.Initialize(cts.Token, false); }
public async Task CheckVMInit() { var vm = new AlbumsViewModel(_navigationServiceMock.Object, _databaseServiceMock.Object, _dialogServiceMock.Object); vm.Prepare(); await vm.Initialize(); Assert.True(vm.Albums.ElementAt(0).Name == "cats"); }
private void InitializeViewModels() { ViewModels = new ObservableCollection <ViewModel>(); var albumsModel = new AlbumsViewModel(); albumsModel.IsSelectionEnabled = false; albumsModel.Initialize(cts.Token); var contactsModel = new ContactsViewModel(); contactsModel.IsSelectionEnabled = true; contactsModel.Initialize(cts.Token); ViewModels.Add(albumsModel); ViewModels.Add(contactsModel); }