public MainPage() { InitializeComponent(); _vm = (Application.Current as App).Container.GetService <AlbumsViewModel>(); _vm.AddCommand = new RelayCommand(o => Frame.Navigate(typeof(EditPage))); _vm.EditCommand = new RelayCommand(o => Frame.Navigate(typeof(EditPage), List.SelectedItem), o => List.SelectedItem != null); _vm.LoadAlbums(); DataContext = _vm; }