Наследование: DataObjectViewModel
Пример #1
0
        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);
        }
Пример #2
0
        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);
        }
Пример #3
0
 private static string GetTitle(NavigationEntryViewModel root, NavigationEntryViewModel current)
 {
     return root.Name + ": " + current.Name;
 }
Пример #4
0
 public void NavigateTo(NavigationEntryViewModel screen)
 {
     CurrentScreen = screen;
 }
Пример #5
0
 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;
         }
     }
 }
Пример #6
0
 private static string GetTitle(NavigationEntryViewModel root, NavigationEntryViewModel current)
 {
     return(root.Name + ": " + current.Name);
 }
Пример #7
0
 public void NavigateTo(NavigationEntryViewModel screen)
 {
     CurrentScreen = screen;
 }