Exemple #1
0
        public ShellViewModel(
            IMessageBoxManager messageBoxManager,
            IWellDataImporter wellDataImporter,
            IWellProvider wellProvider,
            ITankProvider tankProvider,
            IWindowManager windowManager,
            IFactory <AddWellViewModel> wellViewModelFactory,
            IAutoUpdater autoUpdater)
        {
            _messageBoxManager    = messageBoxManager;
            _wellDataImporter     = wellDataImporter;
            _wellProvider         = wellProvider;
            _tankProvider         = tankProvider;
            _windowManager        = windowManager;
            _wellViewModelFactory = wellViewModelFactory;
            _autoUpdater          = autoUpdater;
            WellItems             = new BindableCollection <WellModel>();
            TankItems             = new BindableCollection <TankModel>();
            MessageQueue          = new SnackbarMessageQueue(TimeSpan.FromSeconds(2))
            {
                IgnoreDuplicate = true
            };

            _propertyObserver = new PropertyObserver <ShellViewModel>(this);

            _propertyObserver.OnChangeOf(x => x.SelectedWell).Do((vm) => LoadTanks(vm.SelectedWell).ConfigureAwait(false));
        }