public NavigatorViewModel(IViewModelDependencies dependencies, IZetboxContext dataCtx, ViewModel parent, NavigationScreen root) : base(dependencies, dataCtx, parent) { _current = _root = NavigationEntryViewModel.Fetch(ViewModelFactory, dataCtx, parent, root); _current.Displayer = this; _history = new ObservableCollection<NavigationEntryViewModel>() { _current }; _historyRO = new ReadOnlyObservableCollection<NavigationEntryViewModel>(_history); _location = new ObservableCollection<NavigationEntryViewModel>() { _root }; _locationRO = new ReadOnlyObservableCollection<NavigationEntryViewModel>(_location); }
public NavigatorViewModel(IViewModelDependencies dependencies, IZetboxContext dataCtx, ViewModel parent, NavigationScreen root) : base(dependencies, dataCtx, parent) { _current = _root = NavigationEntryViewModel.Fetch(ViewModelFactory, dataCtx, parent, root); _current.Displayer = this; _history = new ObservableCollection <NavigationEntryViewModel>() { _current }; _historyRO = new ReadOnlyObservableCollection <NavigationEntryViewModel>(_history); _location = new ObservableCollection <NavigationEntryViewModel>() { _root }; _locationRO = new ReadOnlyObservableCollection <NavigationEntryViewModel>(_location); }
private static string GetTitle(NavigationEntryViewModel root, NavigationEntryViewModel current) { return root.Name + ": " + current.Name; }
public void NavigateTo(NavigationEntryViewModel screen) { CurrentScreen = screen; }
public void NavigateTo(NavigationEntryViewModel screen) { if (CurrentScreen != screen) { CurrentScreen = screen; while (screen.ParentScreen != null) { // change CurrentScreen first, to avoid additional navigations screen.CurrentScreen = CurrentScreen; screen.ParentScreen.SelectedEntry = screen; screen = screen.ParentScreen; } } }
private static string GetTitle(NavigationEntryViewModel root, NavigationEntryViewModel current) { return(root.Name + ": " + current.Name); }
public void NavigateTo(NavigationEntryViewModel screen) { CurrentScreen = screen; }