// Constructors
        #region Constructors
        public ShellViewModel(INavigator navigator, IRootViewModelFactory rootViewModelFactory)
        {
            _navigator = navigator;
            _navigator.StateChanged += Navigator_StateChanged;

            ChangeCurrentViewModelCommand = new ChangeCurrentViewModelCommand(rootViewModelFactory, _navigator);
            ChangeCurrentViewModelCommand.Execute(ViewType.Tables);
        }
Exemple #2
0
        public Main(IRootViewModelFactory viewModelFactory)
        {
            DataContext = viewModelFactory.CreateMainViewModel();

            ViewStateManager = new ViewStateManager(viewModelFactory);
            CurrentPage      = ViewStateManager.Navigator.CurrentBody;

            InitializeComponent();
        }
Exemple #3
0
 public ViewStateManager(IRootViewModelFactory viewModelFactory)
 {
     _viewModelFactory = viewModelFactory;
     Navigator         = new Navigator(new ObservableCollection <INavigatorItem>()
     {
         new Login(viewModelFactory.CreateLoginViewModel())
     });
     Navigator.CurrentBody = Navigator.Bodies[0];
 }
Exemple #4
0
        // Constructors
        #region Constructors

        public ShellViewModel(INavigator navigator, IRootViewModelFactory viewModelFactory)
        {
            _navigator = navigator;
            _navigator.StateChanged    += Navigator_StateChanged;
            _navigator.CurrentViewModel = viewModelFactory.CreateViewModel(ViewType.Home);

            UpdateCurrentViewModelCommand = new UpdateCurrentViewModelCommand(_navigator, viewModelFactory);

            CloseApplicationCommand = new RelayCommand(CloseApplication);
        }
Exemple #5
0
 public UpdateCurrentViewModelCommand(INavigator navigator, IRootViewModelFactory viewModelFactory)
 {
     _navigator        = navigator;
     _viewModelFactory = viewModelFactory;
 }
Exemple #6
0
 public Navigator(IRootViewModelFactory viewModelFactory)
 {
     UpdateCurrentViewModelCommand = new UpdateCurrentViewModelCommand(this, viewModelFactory);
 }
 public ChangeCurrentViewModelCommand(IRootViewModelFactory rootViewModelFactory, INavigator navigator)
 {
     _rootViewModelFactory = rootViewModelFactory;
     _navigator            = navigator;
 }