public NodeWindowViewModel(LocationModel locationModel,
                                   INodeNavigationService nodeNavigationService,
                                   ILocationService locationService,
                                   LocationViewmodel.Factory locationViewmodelFactory,
                                   DispatcherAccessor dispatcherAccessor,
                                   NodeHistoryState nodeHistoryState,
                                   BreadCrumbViewmodel.Factory breadCrumbViewmodelFactory)
        {
            _locationViewModel        = locationViewmodelFactory(locationModel, this);
            _nodeNavigationService    = nodeNavigationService;
            _locationService          = locationService;
            _locationViewmodelFactory = locationViewmodelFactory;
            _dispatcherAccessor       = dispatcherAccessor;

            _title = locationModel.Name;

            _nodeHistoryState           = nodeHistoryState;
            _breadCrumbViewmodelFactory = breadCrumbViewmodelFactory;

            BackCommand    = new AwaitableDelegateCommand(GoBack, () => BackAvailable);
            ForwardCommand = new AwaitableDelegateCommand(GoForward, () => ForwardAvailable);
            var breadCrumbs = ConvertToBreadCrumbs(_nodeHistoryState);

            BreadCrumbs = new ObservableCollection <BreadCrumbViewmodel>(breadCrumbs);
        }
Beispiel #2
0
 public MainWindowViewmodel(
     NodeWindowViewModel.LocationFactory nodeWindowLocationFactory,
     LocationViewmodel.Factory locationViewmodelFactory,
     ILocationService locationService,
     INodeNavigationService nodeNavigationService,
     IWindowService windowService)
 {
     _nodeWindowLocationFactory = nodeWindowLocationFactory;
     _locationViewmodelFactory  = locationViewmodelFactory;
     _locationService           = locationService;
     _nodeNavigationService     = nodeNavigationService;
     _windowService             = windowService;
     MongoCommand = new RelayCommand(param => true, async param =>
     {
         var locationId = "5c9174b4a1effb00d8cba037";
         await OpenNewLocationWindow(locationId);
     });
     LoadedCommand = new ActionCommand(OnLoaded);
 }