public DepositEditorViewModel(IDepositGateway depositGateway, IViewService viewService, ISharedDataProvider sharedDataProvider)
        {
            Guard.AgainstNull(() => depositGateway, () => viewService, () => sharedDataProvider);

            _depositGateway = depositGateway;
            _viewService = viewService;
            _sharedDataProvider = sharedDataProvider;

            SaveDepositCommand = new RelayCommand(SaveDeposit, CanSaveDeposit);
            IsBackNavigationEnabled = true;
        }
        public DepositDeletionViewModel(IDepositGateway depositGateway, IViewService viewService, ISharedDataProvider sharedDataProvider)
        {
            Guard.AgainstNull(() => depositGateway, () => viewService, () => sharedDataProvider);

            _depositGateway = depositGateway;
            _viewService = viewService;
            _sharedDataProvider = sharedDataProvider;

            DeleteCommand = new RelayCommand(Delete, CanDelete);
            PageTitle = "Sletning af depot";
            IsBackNavigationEnabled = true;
        }
        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 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 DepositOverviewViewModel(IViewService viewService)
        {
            Guard.AgainstNull(() => viewService);

            _viewService = viewService;

            CreateTradeCommand = new RelayCommand(() => NavigateToTradeEditor(Deposit, null, null));
            CreateBuyTradeCommand = new ParameterizedRelayCommand<StockPositionViewModel>(t => NavigateToTradeEditor(Deposit, true, t.Stock.Id));
            CreateSellTradeCommand = new ParameterizedRelayCommand<StockPositionViewModel>(t => NavigateToTradeEditor(Deposit, false, t.Stock.Id));
            NavigateToDividendManagementCommand = new RelayCommand(() => _viewService.NavigateTo(typeof(DividendManagementViewModel), Deposit));
            NavigateToTaxInfoCommand = new RelayCommand(() => _viewService.NavigateTo(typeof(YearlyReportViewModel), Deposit));

            PageTitle = "DEPOTOVERSIGT";
            IsBackNavigationEnabled = true;
        }
        public DividendManagementViewModel(IDepositGateway depositGateway, ISharedDataProvider sharedDataProvider)
        {
            Guard.AgainstNull(() => depositGateway, () => sharedDataProvider);

            _depositGateway = depositGateway;
            SharedDataProvider = sharedDataProvider;

            CalculateDividendsCommand = new RelayCommand(CalculateDividends);
            AddDividendCommand = new ParameterizedRelayCommand<DividendViewModel>(AddDividend);
            DeleteDividendCommand = new ParameterizedRelayCommand<DividendViewModel>(DeleteDividend);
            CalculatedDividends = new ObservableCollection<DividendViewModel>();

            PageTitle = "Udbyttebetalinger";
            IsBackNavigationEnabled = true;
        }
        public DepositManagementViewModel(IDepositGateway depositGateway, IViewService viewService, 
            IMessagebus messagebus, ISharedDataProvider sharedDataProvider)
        {
            Guard.AgainstNull(() => depositGateway, () => viewService, () => messagebus, () => sharedDataProvider);

            _viewService = viewService;
            _depositGateway = depositGateway;
            _messagebus = messagebus;

            EditSelectedDepositCommand = new RelayCommand(EditSelectedDeposit, IsDepositSelected);
            DeleteSelectedDepositCommand = new RelayCommand(DeleteSelectedDeposit, IsDepositSelected);
            ShowDepositOverviewCommand = new RelayCommand(ShowDepositOverview, IsDepositSelected);
            Deposits = sharedDataProvider.Deposits;

            PageTitle = "Depotadministration";
        }
        public HostWindowViewService(Window rootWindow)
        {
            Guard.AgainstNull(() => rootWindow);

            _rootWindow = rootWindow;
            _viewCache = new Dictionary<Type, AdornerDecorator>();
            _parameterCache = new Dictionary<Type, Tuple<Type, object>>();
            _navigationStack = new Stack<Type>();

            _viewTypes = (
                from type in typeof(HostWindowViewService).Assembly.GetTypes()
                where type.Name.EndsWith("View")
                select type).ToArray();

            GlobalButtons = new ObservableCollection<GlobalButtonViewModel>();
            NavigateBackCommand = new RelayCommand(NavigateBack, () => CanCurrentViewNavigateBack);
        }
        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;
        }