Example #1
0
 // inject implementations
 public ProductDataServiceProvider(
     IProductRepository productRepository,
     IStockGateway stockGateway)
 {
     _productRepository = productRepository;
     _stockGateway      = stockGateway;
 }
        public StockEditorViewModel(IStockGateway stockGateway, ISharedDataProvider sharedDataProvider, IViewService viewService, IMessagebus messagebus)
        {
            Guard.AgainstNull(() => stockGateway, () => sharedDataProvider, () => viewService, () => messagebus);

            _stockGateway = stockGateway;
            _sharedDataProvider = sharedDataProvider;
            _viewService = viewService;
            _messagebus = messagebus;

            SaveStockCommand = new RelayCommand(SaveStock, CanSaveStock);
            IsBackNavigationEnabled = true;
        }
        public SharedDataProvider(IStockGateway stockGateway, IDepositGateway depositGateway)
        {
            Guard.AgainstNull(() => stockGateway, () => depositGateway);

            _stockGateway = stockGateway;
            _depositGateway = depositGateway;

            Stocks = new ObservableCollection<StockViewModel>();
            Deposits = new ObservableCollection<DepositViewModel>();
            GeneralMeetings = new ObservableCollection<GeneralMeetingViewModel>();
            GeneralMeetingYears = new ObservableCollection<KeyValuePair<string, int>>();

            Update();
        }
        public StockDeletionViewModel(IStockGateway stockGateway, ISharedDataProvider sharedDataProvider, 
            IViewService viewService, IMessagebus messagebus)
        {
            Guard.AgainstNull(() => stockGateway, () => sharedDataProvider, () => viewService, () => messagebus);

            _stockGateway = stockGateway;
            _sharedDataProvider = sharedDataProvider;
            _viewService = viewService;
            _messagebus = messagebus;

            DeleteCommand = new RelayCommand(Delete, CanDelete);
            PageTitle = "Sletning af papir";
            IsBackNavigationEnabled = true;
        }
        public StockSplitManagementViewModel(IStockGateway stockGateway, IViewService viewService, ISharedDataProvider sharedDataProvider)
        {
            Guard.AgainstNull(() => stockGateway, () => viewService, () => sharedDataProvider);

            _stockGateway = stockGateway;
            _viewService = viewService;
            SharedDataProvider = sharedDataProvider;

            SaveCommand = new RelayCommand(Save, IsSaveEnabled);
            ResetCommand = new RelayCommand(Reset);
            BeginEditCommand = new ParameterizedRelayCommand<StockSplitViewModel>(BeginEdit);
            BeginDeleteCommand = new ParameterizedRelayCommand<StockSplitViewModel>(BeginDelete);
            StockSplits = new ObservableCollection<StockSplitViewModel>(_stockGateway.GetAllStockSplits());

            Reset();
            PageTitle = "Aktiesplits";
            IsBackNavigationEnabled = true;
        }
        public GeneralMeetingManagementViewModel(IStockGateway stockGateway, IViewService viewService, ISharedDataProvider sharedDataProvider)
        {
            Guard.AgainstNull(() => stockGateway, () => viewService, () => sharedDataProvider);

            _stockGateway = stockGateway;
            _viewService = viewService;
            SharedDataProvider = sharedDataProvider;

            SaveCommand = new RelayCommand(Save, IsSaveEnabled);
            ResetCommand = new RelayCommand(Reset);
            BeginEditCommand = new ParameterizedRelayCommand<GeneralMeetingViewModel>(BeginEdit);
            BeginDeleteCommand = new ParameterizedRelayCommand<GeneralMeetingViewModel>(BeginDelete);

            GeneralMeetingsCollectionView = new CollectionViewSource { Source = sharedDataProvider.GeneralMeetings }.View;
            GeneralMeetingsCollectionView.Filter = GeneralMeetingsFilter;

            Reset();
            PageTitle = "Generalforsamlinger";
            IsBackNavigationEnabled = true;
        }