public ExistingOffersViewModel(IDialogCoordinator coordinator)
        {
            Offers = new AsyncObservableCollection <Offer>();
            SetupFilterableView(Offers);

            NavigateBackCmd = new RelayCommand(x =>
            {
                NavigationService.GoBack();
            });

            OpenOfferInCreateOfferViewModel = new RelayCommand(async x =>
            {
                var createOfferViewModel = new CreateOfferViewModel(coordinator);
                await NavigationService.BeginNavigate(createOfferViewModel);
                await Task.Run(() => createOfferViewModel.LoadExistingOffer(SelectedOffer.Id));
                NavigationService.EndNavigate();
            }, x => SelectedOffer != null);

            PrintOfferCmd = new RelayCommand(x =>
            {
                new SaveOfferDialog(SelectedOffer).RunDialog();
            }, x => SelectedOffer != null);

            DropOfferCmd = new RelayCommand(x =>
            {
                DropExistingOffer(SelectedOffer);
            }, x => SelectedOffer != null);
        }
        public ExistingPackagedSolutionsViewModel(IDialogCoordinator dialogCoordinator)
        {
            _dialogCoordinator = dialogCoordinator;

            PackagedSolutions = new AsyncObservableCollection <PackagedSolution>();
            SetupFilterableView(PackagedSolutions);

            NavigateBackCmd = new RelayCommand(x =>
            {
                NavigationService.GoBack();
            });

            CreatePackagedSolutionCopyCmd = new RelayCommand(async x =>
            {
                var createPackagedSolutionViewModel = new CreatePackagedSolutionViewModel(dialogCoordinator);
                await NavigationService.BeginNavigate(createPackagedSolutionViewModel);
                await Task.Run(() => createPackagedSolutionViewModel.LoadExistingPackagedSolution(SelectedPackagedSolution.Id));
                NavigationService.EndNavigate();
            }, x => SelectedPackagedSolution != null);

            CreateOfferFromSolutionCmd = new RelayCommand(async x =>
            {
                var createOfferViewModel = new CreateOfferViewModel(dialogCoordinator);
                await NavigationService.BeginNavigate(createOfferViewModel);
                await Task.Run(() => createOfferViewModel.SelectPackagedSolutionById(SelectedPackagedSolution.Id));
                NavigationService.EndNavigate();
            }, x => SelectedPackagedSolution != null);

            DropPackagedSolutionCmd = new RelayCommand(x =>
            {
                DropPackagedSolution(SelectedPackagedSolution);
            }, x => SelectedPackagedSolution != null);

            PrintCalculationCmd = new RelayCommand(x =>
            {
                SelectedPackagedSolution.UpdateEei();
                new SaveEnergyLabelDialog(SelectedPackagedSolution).RunDialog();
            }, x => SelectedPackagedSolution != null);
        }
        private async void OnNav(string destination)
        {
            ViewModelBase nextPage;

            switch (destination)
            {
            case "ExistingPackagedSolutionView":
                nextPage = new ExistingPackagedSolutionsViewModel(_dialogCoordinator);
                break;

            case "CreatePackagedSolutionView":
                using (var ctx = new AssistantContext())
                {
                    nextPage = new CreatePackagedSolutionViewModel(_dialogCoordinator);
                    if (!ctx.CompanyInformation.Any())
                    {
                        OpenOfferSettingsDialog(instanceCanceled =>
                        {
                            _dialogCoordinator.HideMetroDialogAsync(this, _customDialog);
                            NavigationService.GoBack();
                        }, async instanceCompleted =>
                        {
                            await _dialogCoordinator.HideMetroDialogAsync(this, _customDialog);
                            DisplayTimedMessage("Information gemt!", "", 2);
                        });
                    }
                }

                break;

            case "ExistingOffersView":
                nextPage = new ExistingOffersViewModel(_dialogCoordinator);
                break;

            case "CreateOfferView":
                using (var ctx = new AssistantContext())
                {
                    nextPage = new CreateOfferViewModel(_dialogCoordinator);
                    if (!ctx.CompanyInformation.Any())
                    {
                        OpenOfferSettingsDialog(instanceCanceled =>
                        {
                            _dialogCoordinator.HideMetroDialogAsync(this, _customDialog);
                            NavigationService.GoBack();
                        }, async instanceCompleted =>
                        {
                            await _dialogCoordinator.HideMetroDialogAsync(this, _customDialog);
                            DisplayTimedMessage("Information gemt!", "", 2);
                        });
                    }
                }
                break;

            case "SettingsView":
                nextPage = new SettingsViewModel(_dialogCoordinator);
                break;

            case "GoBack":
                NavigationService.GoBack();
                return;

            default:
                return;
            }

            // Navigate to page
            await NavigationService.BeginNavigate(nextPage);

            NavigationService.EndNavigate();
        }