예제 #1
0
 public SkillViewModelFactory(ILogger logger, ISkillModelFactory skillModelFactory, IAsyncCommandAdaptorFactory asyncCommandAdaptorFactory, IUiThreadInvoker uiThreadInvoker)
 {
     _logger                     = logger;
     _skillModelFactory          = skillModelFactory;
     _asyncCommandAdaptorFactory = asyncCommandAdaptorFactory;
     _uiThreadInvoker            = uiThreadInvoker;
 }
예제 #2
0
 public MainWindow(ILogger logger, MainPageViewModel mainPageViewModel, IUiThreadInvoker uiThreadInvoker)
 {
     _logger            = logger;
     _mainPageViewModel = mainPageViewModel;
     _uiThreadInvoker   = uiThreadInvoker;
     InitializeComponent();
     DataContext = mainPageViewModel;
 }
 public PrimaryStatViewModelFactory(ILogger logger, IAsyncCommandAdaptorFactory asyncCommandAdaptorFactory,
                                    IUiThreadInvoker uiThreadInvoker, IPrimaryStatModelFactory primaryStatModelFactory)
 {
     _logger = logger;
     _asyncCommandAdaptorFactory = asyncCommandAdaptorFactory;
     _uiThreadInvoker            = uiThreadInvoker;
     _primaryStatModelFactory    = primaryStatModelFactory;
 }
        public void SetupSkillTableViewModel()
        {
            var uiStateController = new UiStateController(_logger, new UiLockerContextFactory());

            _asyncCommandFactory        = new AsyncCommandFactory(_fakeNotifyTaskCompletionFactory, new AsyncCommandWatcherFactory(uiStateController), new TaskWrapper());
            _asyncCommandAdaptorFactory = new AsyncCommandAdaptorFactory(_asyncCommandFactory);
            _uiThreadInvoker            = new UiThreadInvoker(_logger);

            _skillTableViewModel = new SkillTableViewModel(_logger, _skillTableModel, _asyncCommandFactory, _asyncCommandAdaptorFactory, _uiThreadInvoker,
                                                           new UiStateController(_logger, new UiLockerContextFactory()), _bindingHelper);
        }
예제 #5
0
        private void SetupUiUtilities()
        {
            _observableHelper  = new ObservableHelper();
            _uiThreadInvoker   = new UiThreadInvoker(_logger);
            _uiStateController = new UiStateController(_logger, new UiLockerContextFactory());
            var asyncCommandWatcherFactory = new AsyncCommandWatcherFactory(_uiStateController);

            _notifyTaskCompletionFactory = new NotifyTaskCompletionFactory(_logger);
            _asyncCommandFactory         = new AsyncCommandFactory(_notifyTaskCompletionFactory, asyncCommandWatcherFactory, new TaskWrapper());
            _asyncCommandAdaptorFactory  = new AsyncCommandAdaptorFactory(_asyncCommandFactory);
        }
        public PrimaryStatsTableViewModel(ILogger logger, IPrimaryStatsTableModel model, IPrimaryStatTableViewModelBindingHelper bindingHelper, IAsyncCommandFactory asyncCommandFactory,
                                          IAsyncCommandAdaptorFactory asyncCommandAdaptorFactory, IUiThreadInvoker uiThreadInvoker, IUiStateController uiStateController) : base(uiThreadInvoker)
        {
            _logger                     = logger;
            _model                      = model;
            _bindingHelper              = bindingHelper;
            _uiThreadInvoker            = uiThreadInvoker;
            _uiStateController          = uiStateController;
            _model.PrimaryStatsUpdated += ModelOnPrimaryStatsUpdated;

            SetupTaskRunners(asyncCommandFactory);

            Delete = asyncCommandAdaptorFactory.CreateWithContext(() => { _logger.LogEntry(); });
        }
예제 #7
0
        public SkillTableViewModel(ILogger logger, ISkillTableModel model, IAsyncCommandFactory asyncCommandFactory, IAsyncCommandAdaptorFactory asyncCommandAdaptorFactory,
                                   IUiThreadInvoker uiThreadInvoker, IUiStateController uiStateController, ISkillTableViewModelBindingHelper bindingHelper) : base(uiThreadInvoker)
        {
            _logger            = logger;
            _uiThreadInvoker   = uiThreadInvoker;
            _uiStateController = uiStateController;
            _bindingHelper     = bindingHelper;

            _model = model;
            _model.PropertyChanged += ModelOnPropertyChanged;

            SetupTaskRunners(asyncCommandFactory);

            SetupCommandBindings(asyncCommandAdaptorFactory);
        }
        public void Setup()
        {
            _logger          = A.Fake <ILogger>();
            _model           = A.Fake <IPrimaryStatModel>();
            _uiThreadInvoker = A.Fake <IUiThreadInvoker>();
            _fakeNotifyTaskCompletionFactory = A.Fake <INotifyTaskCompletionFactory>();

            _realNotifyTaskCompletion = new NotifyTaskCompletion <object>(_logger);
            A.CallTo(() => _fakeNotifyTaskCompletionFactory.Create <object>()).Returns(_realNotifyTaskCompletion);

            var uiStateController = new UiStateController(_logger, new UiLockerContextFactory());

            _asyncCommandFactory = new AsyncCommandFactory(_fakeNotifyTaskCompletionFactory, new AsyncCommandWatcherFactory(uiStateController), new TaskWrapper());
            var asyncCommandAdaptorFactory = new AsyncCommandAdaptorFactory(_asyncCommandFactory);

            _primaryStatViewModel = new PrimaryStatViewModel(_logger, _model, asyncCommandAdaptorFactory, _uiThreadInvoker);
        }
예제 #9
0
 public TitleZoneViewModel(ITitleZoneModel model, IUiThreadInvoker uiThreadInvoker) : base(uiThreadInvoker)
 {
     _model = model;
 }
예제 #10
0
 public MainPageViewModel(ILogger logger, IMainPageModel model, IUiThreadInvoker uiThreadInvoker) : base(uiThreadInvoker)
 {
     _logger = logger;
     _model  = model;
 }
예제 #11
0
 internal ViewModelBase(IUiThreadInvoker uiThreadInvoker)
 {
     _uiThreadInvoker = uiThreadInvoker;
 }