public RootSimpleTraderViewModeltFactory(ISimpleTraderViewModelFactory <HomeViewModel> homeViewModelFactory, ISimpleTraderViewModelFactory <PortfolioViewModel> portfolioViewModelFactory, BuyViewModel buyViewModel) { _homeViewModelFactory = homeViewModelFactory; _portfolioViewModelFactory = portfolioViewModelFactory; _buyViewModel = buyViewModel; }
public MainViewModel(INavigator navigator, ISimpleTraderViewModelFactory viewModelFactory, IAuthenticator authenticator) { _navigator = navigator; _viewModelFactory = viewModelFactory; _authenticator = authenticator; _navigator.StateChanged += Navigator_StateChanged; _authenticator.StateChanged += Authenticator_StateChanged; UpdateCurrentViewModelCommand = new UpdateCurrentViewModelCommand(navigator, _viewModelFactory); UpdateCurrentViewModelCommand.Execute(ViewType.Login); }
public MainViewModel(INavigator navigator, IAuthenticator authenticator, ISimpleTraderViewModelFactory viewModelFactory) { _navigator = navigator; _authenticator = authenticator; _viewModelFactory = viewModelFactory; _navigator.StateChanged += () => OnPropertyChanged(nameof(CurrentViewModel)); _authenticator.StateChanged += () => OnPropertyChanged(nameof(IsLoggedIn)); UpdateCurrentViewModelCommand = new UpdateCurrentViewModelCommand(navigator, viewModelFactory); UpdateCurrentViewModelCommand.Execute(ViewType.Login); }
public MainViewModel(IAuthenticator authenticator, INavigator navigator, ISimpleTraderViewModelFactory vmAbstractFactory) { NavigatorVM = navigator; this._vmAbstractFactory = vmAbstractFactory; // 通过判断是否登录,来确定头部是否显示 Authenticator = authenticator; // 使 首页 默认被展示的功能 // 手动初始化调用委托 来激活首页, 而不是通过Icommand // 此处与Controls.NavigationBar的值转换联动 ,如果没有此句,转换方法中的value将为空引用异常。 //UpdateCurrentViewCommand.Execute(_vmAbstractFactory.CreateViewModel(ViewType.Home)); NavigatorVM.CurrentVM = _vmAbstractFactory.CreateViewModel(ViewType.Login); }
public UpdateCurrentViewModelCommand(INavigator navigator, ISimpleTraderViewModelFactory viewModelAbstractFactory) { this.navigator = navigator; this.viewModelAbstractFactory = viewModelAbstractFactory; }
public HomeViewModelFactory(ISimpleTraderViewModelFactory <MajorIndexListingViewModel> majorIndexViewModelFactory) { _majorIndexViewModelFactory = majorIndexViewModelFactory; }
public NavigatorBarViewModel(ISimpleTraderViewModelFactory vmAbstractFactory) { _vmAbstractFactory = vmAbstractFactory; UpdateCurrentViewCommand = new RelayCommand <object>((v) => UpdateCurrentViewCmd(v)); }
public UpdateCurrentViewModelCommand(INavigator navigator, ISimpleTraderViewModelFactory viewModelFactory) { _navigator = navigator; _viewModelFactory = viewModelFactory; }
public SimpleTraderViewModelAbstractFactory(ISimpleTraderViewModelFactory <HomeViewModel> homeViewModelFactory, ISimpleTraderViewModelFactory <PortfolioViewModel> portfolioViewModelFactory) { _homeViewModelFactory = homeViewModelFactory; _portfolioViewModelFactory = portfolioViewModelFactory; }