public AlbumsListView() { InitializeComponent(); viewModel = new AlbumsListViewModel(App.Instance.MobileService, App.Instance); BindingContext = viewModel; viewModel.PropertyChanged += ViewModelPropertyChanged; Settings.Current.PropertyChanged += AuthTypePropertyChanged; viewModel.DeleteAlbumViewAction = OnDeleteAlbum; }
public void Dispose() { viewModel.PropertyChanged -= ViewModelPropertyChanged; viewModel?.Dispose(); viewModel = null; Settings.Current.PropertyChanged -= AuthTypePropertyChanged; BindingContext = null; }