/// <summary>
        /// initializes view components
        /// </summary>
        public AddOptionPopupModel(IFrameNavigationService navigationService)
        {
            _navigationService = navigationService;

            addOptionCommand = new RelayCommand(addOptionAsync);
            submitCommand    = new RelayCommand(submitAsync);
        }
예제 #2
0
        /// <summary>
        /// initializes view components
        /// </summary>
        public EditTimeTrialViewModel(IFrameNavigationService navigationService)
        {
            _navigationService = navigationService;
            timeTrial          = navigationService.Parameter as TimeTrial;

            selectedModel = timeTrial.Model;
            modelText     = timeTrial.Model.Base;
            date          = timeTrial.Date;
            salesOrder    = timeTrial.SalesOrder;
            productionNum = timeTrial.ProductionNumber;
            driveTime     = timeTrial.DriveTime;
            AVTime        = timeTrial.AVTime;
            numOptions    = timeTrial.NumOptions;

            foreach (TimeTrialsOptionTime TTOption in timeTrial.TTOptionTimes)
            {
                TTOptions.Add(TTOption);
            }

            cancelCommand = new RelayCommand(cancel);

//            loadedCommand = new RelayCommand(loaded);
            //addTTCommand = new RelayCommand(addTT);
            //submitCommand = new RelayCommand(submit);
        }
예제 #3
0
        public CreateFestivalViewModel(IFrameNavigationService navigationService, IFestivalService festivalService,
                                       IGoogleMapsService googleMapsService)
        {
            Festival = new Festival
            {
                OpeningHours = new OpeningHours(),
                Address      = new Address()
            };
            _festivalService   = festivalService;
            _navigationService = navigationService;

            if (navigationService.Parameter == null || !(navigationService.Parameter is int customerId))
            {
                throw new InvalidNavigationException();
            }

            _customerId = customerId;

            CreateFestivalCommand = new RelayCommand(CreateFestival);

            #region Google Search

            _googleService = googleMapsService;
            SearchCommand  = new RelayCommand(Search);
            SelectCommand  = new RelayCommand <string>(Select);

            #endregion
        }
 public LoginViewModel(IFrameNavigationService navigationService)
 {
     _navigationService = navigationService;
     _loginManager      = new LoginManager();
     LoginCommand       = new RelayCommand(Login);
     LoadingVisibility  = Visibility.Collapsed;
 }
        public TabViewModelTests()
        {
            _frameNavigationService = Substitute.For <IFrameNavigationService>();
            _tabItem = Substitute.For <TabItem <string> >(TestTabItemTitle, TestTabItemKey);

            _viewModel = new TabViewModel <ViewModelStub, string>(_frameNavigationService, _tabItem);
        }
예제 #6
0
 public GameDetailViewModel(IFrameNavigationService navigationService, IRepository repository)
 {
     _repository        = repository;
     _navigationService = navigationService;
     MessengerInstance.Register <Game>(this, RefreshGame);
     RefreshGame((Game)_navigationService.Parameter);
 }
예제 #7
0
 public CreateProjectViewModel(IProjectService projectService,
                               IProjectFactory projectFactory,
                               IFrameNavigationService navigationService) : base(navigationService)
 {
     _projectService = projectService;
     _projectFactory = projectFactory;
 }
        public QuestionnaireViewModel(IQuestionnaireService questionnaireService, QuestionFactory questionFactory,
                                      IFrameNavigationService navigationService, IFestivalService festivalService, IOfflineService offlineService, IConfiguration config)
        {
            _config = config;
            _questionnaireService = questionnaireService;
            _navigationService    = navigationService;
            _questionFactory      = questionFactory;
            _festivalService      = festivalService;
            _offlineService       = offlineService;

            Initialize((int)_navigationService.Parameter);

            AddedQuestions         = new ObservableCollection <Question>();
            RemovedQuestions       = new ObservableCollection <Question>();
            OpenDeleteCheckCommand = new RelayCommand <Question>(DeleteCommandCheck, _ => offlineService.IsOnline, true);
            AddQuestionCommand     = new RelayCommand(AddQuestion, () => SelectedItem != null, true);
            // DeleteQuestionCommand = new RelayCommand<Question>(DeleteQuestion, _ => offlineService.IsOnline, true);
            DeleteCommand = new RelayCommand(DeleteQuestion, () => offlineService.IsOnline, true);
            DeleteQuestionnaireCommand     = new RelayCommand(DeleteQuestionnaire, () => offlineService.IsOnline, true);
            SaveQuestionnaireCommand       = new RelayCommand(SaveQuestionnaire, () => offlineService.IsOnline, true);
            OpenFileWindowCommand          = new RelayCommand <Question>(OpenFileWindow, HasAnswers);
            AddOptionToQuestion            = new RelayCommand <Question>(AddOption, _ => offlineService.IsOnline, true);
            SelectReferenceQuestionCommand =
                new RelayCommand <ReferenceQuestion>(SelectReferenceQuestion, _ => offlineService.IsOnline, true);
            SetReferenceQuestionCommand =
                new RelayCommand <Question>(SetReferenceQuestion, _ => offlineService.IsOnline, true);

            QuestionList        = (CollectionView)CollectionViewSource.GetDefaultView(_allQuestions());
            QuestionList.Filter = Filter;
        }
예제 #9
0
        public ProjectPageViewModel(IFrameNavigationService navigationService, IOpenFileDialogService openFileDialogService, ILogger loggerService, IDBService dBService)
        {
            _navigationService     = navigationService;
            _openFileDialogService = openFileDialogService;
            _logService            = loggerService;
            _dbService             = dBService;

            OutputMessages = new ObservableCollection <OutputMessage>();

            _project = ((NavigationServiceParameter)_navigationService.Parameter).ObjParam as Project;
            OutputMessages.Add(new OutputMessage {
                Message = _project.Name + " details", Level = ""
            });
            ProjectName = _project.Name;
            Leader      = _project.Leader;
            Goal        = _project.Goal;
            Description = _project.Description;
            Plans       = new ObservableCollection <byte[]>();
            foreach (var item in _project.ProjectPlanByreArrays)
            {
                Plans.Add(item);
            }
            Reactions = new ObservableCollection <ReactionInfo>();
            Modify    = null;
            ConfigNavigationCommands();

            Modify       = new RelayCommand(ModifyCommand);
            AddPlan      = new RelayCommand(AddPlanCommand);
            GetResources = new RelayCommand(GetResourcesCommand);

            ViewReaction   = new RelayCommand <ReactionInfo>(ViewReactionCommand);
            DeleteReaction = new RelayCommand <ReactionInfo>(DeleteReactionCommand);

            SaveProject = new RelayCommand(SaveProjectCommand);
        }
예제 #10
0
 public QuizEndViewModel(IFrameNavigationService navigationService)
 {
     this._navigationService = navigationService;
     _endScore        = navigationService.Parameter.ToString();
     GoToStartCommand = new RelayCommand(OnRestart);
     ExitCommand      = new RelayCommand(OnExit);
 }
예제 #11
0
        /// <summary>
        /// Constructor for the Login view model
        /// </summary>
        public LoginViewModel(IFrameNavigationService navigationService)
        {
            _navigationService = navigationService;

            loginCommand  = new RelayCommand <IHavePassword>((IHavePassword parameter) => loginAsync(parameter));
            goBackCommand = new RelayCommand(goBack);
        }
예제 #12
0
        public HomeViewModel(IFrameNavigationService navigationService, IGameDbService gameDb)
        {
            _navigationService = navigationService;
            _gameDb            = gameDb;

            Games = new ObservableCollection <Game>(_gameDb.GetGamesAsync().Result.Distinct());
        }
예제 #13
0
        public MainViewModel()
        {
            this._DispatcherService   = SimpleIoc.Default.GetInstance <IDispatcherService>();
            this._WinBiometricService = SimpleIoc.Default.GetInstance <IWinBiometricService>();
            this._NavigationService   = SimpleIoc.Default.GetInstance <IFrameNavigationService>();

            this.HandleRepository = SimpleIoc.Default.GetInstance <IHandleRepositoryViewModel <ISessionHandleViewModel> >();

            var winBio = typeof(IWinBioViewModel);

            foreach (var type in Assembly.GetExecutingAssembly()
                     .GetTypes()
                     .Where(type => type != winBio && type.IsInterface && type.GetInterfaces().Contains(winBio))
                     .OrderBy(type => type.FullName))
            {
                var model = SimpleIoc.Default.GetInstance(type) as IWinBioViewModel;
                this.TestTargets.Add(model);
            }

            foreach (var unit in this._WinBiometricService.EnumBiometricUnits())
            {
                this.Units.Add(unit);
            }

            this._WinBiometricService.EventMonitored += this.OnEventMonitored;
        }
        /// <summary>
        /// initializes view components
        /// </summary>
        public OverrideModelPopupModel(IFrameNavigationService navigationService)
        {
            _navigationService = navigationService;

            addOverrideCommand = new RelayCommand(addOverrideAsync);
            submitCommand      = new RelayCommand(submitAsync);
        }
        public CertificateViewModel(IEmployeeService employeeService, IFrameNavigationService navigationService)
        {
            _employeeService   = employeeService;
            _navigationService = navigationService;

            switch (_navigationService.Parameter)
            {
            case int certificateId:
                SaveCommand = new RelayCommand(UpdateCertificate);
                Certificate = _employeeService.GetCertificate(certificateId);
                break;

            case Employee employee:
                SaveCommand = new RelayCommand(CreateCertificate);
                Certificate = new Certificate {
                    Employee = employee
                };
                break;

            default:
                throw new InvalidNavigationException();
            }

            EmployeeId             = Certificate.Employee.Id;
            NavigateBackCommand    = new RelayCommand(NavigateBack);
            DeleteCommand          = new RelayCommand(RemoveCertificate);
            OpenDeleteCheckCommand = new RelayCommand(OpenDeletePopup);
        }
예제 #16
0
 protected TabViewModel(
     IFrameNavigationService frameNavigationService,
     TabItem <TKey> tabItem)
     : base(frameNavigationService)
 {
     _tabItem = tabItem ?? throw new ArgumentNullException(nameof(tabItem));
 }
        public PatientViewModel(IFrameNavigationService navigationService)
        {
            _navigationService = navigationService;

            Messenger.Default.Register <Pacient>(this, "Patient", pat =>
            {
                Pacient = pat;
                RaisePropertyChanged(nameof(Pacient));
                PhotoPath = "../Images/ic_account_circle_white_48dp_2x.png";
                RaisePropertyChanged(nameof(PhotoPath));
            });

            Back = new RelayCommand(async() =>
            {
                source.Cancel();
                await Task.Delay(500);
                _navigationService.GoBack();
            });

            CardioPlotLst      = new ObservableCollection <CardioPlot>();
            HeartRatePlotLst   = new ObservableCollection <HeartRatePlot>();
            TemperaturePlotLst = new ObservableCollection <TemperaturePlot>();

            _timer          = new DispatcherTimer();
            _timer.Tick    += _timer_Tick;
            _timer.Interval = TimeSpan.FromSeconds(1);
        }
예제 #18
0
        public RedViewModel(IFrameNavigationService frameNavigationService)
        {
            _frameNavigationService = frameNavigationService;

            NextCommand = new RelayCommand(GoNext);
            BackCommand = new RelayCommand(GoBack);
        }
예제 #19
0
        public CurrentQuestionViewModel(IFrameNavigationService navigationService)
        {
            this.navigationService = navigationService;

            Messenger.Default.Register <CurrentQuizMessage>(this, this.HandleCurrentQuizMessage);
            NavigateToNextQuestionViewCmd = new RelayCommand(NavigateToNextQuestionView);
        }
예제 #20
0
 public PlaylistVideosViewModel(IFrameNavigationService navigationService)
 {
     _navigationService = navigationService;
     playlist           = navigationService.Parameter as Playlist;
     Name = playlist.Name;
     IsVisibleProgressBar = true;
 }
예제 #21
0
 public MainWindowModel(IFrameNavigationService navigationService, IDialogService dialogService)
 {
     if (IsInDesignModeStatic)
     {
         ThemeBrush = new SolidColorBrush(Color.FromArgb(255, 0, 99, 177));
     }
     else
     {
         try
         {
             var themeColors = Array.ConvertAll(ConfigurationManager.AppSettings["ThemeColorRGB"].Split('#'), Convert.ToByte);
             ThemeBrush = new SolidColorBrush(Color.FromArgb(255, themeColors[0], themeColors[1], themeColors[2]));
         }
         catch
         {
             ThemeBrush = new SolidColorBrush(Color.FromArgb(255, 0, 99, 177));
         }
     }
     _navigationService = navigationService;
     _dialogService     = dialogService;
     Messenger.Default.Register <GenericMessage <bool> >(this, ShowDialog, b =>
     {
         IsEnabledWithDialog = !b.Content;
         MainGridEffect      = b.Content
             ? new BlurEffect {
             Radius = 17, RenderingBias = RenderingBias.Quality, KernelType = KernelType.Gaussian
         }
             : null;
     });
     Messenger.Default.Register <GenericMessage <string> >(this, FirstView, v =>
     {
         _navigationService.NavigateTo(v.Content);
         SyncTitleBarState();
     });
 }
 public ProffesionSkillTierViewModel(IFrameNavigationService navigationService, IBlizzApiService blizzApiService, IAuctionService auctionService)
 {
     _navigationService = navigationService;
     _blizzApiService   = blizzApiService;
     _auctionService    = auctionService;
     ConfigureCommands();
 }
        /// <summary>
        /// initializes view components
        /// </summary>
        public SupervisorViewModel(IFrameNavigationService navigationService)
        {
            _navigationService = navigationService;

            if (navigationService.Parameter != null)
            {
                _goHomeAllowed = true;
            }

            loadedCommand = new RelayCommand(loaded);

            loadModelsCommand  = new RelayCommand(loadModels);
            addModelCommand    = new RelayCommand(addModel);
            modifyModelCommand = new RelayCommand(modifyModel);

            addTimeTrialCommand = new RelayCommand(addTimeTrial);
            deleteTTCommand     = new RelayCommand(deleteTTAsyncCall);

            loadOptionsCommand  = new RelayCommand(loadOptions);
            addOptionCommand    = new RelayCommand(addOption);
            modifyOptionCommand = new RelayCommand(modifyOption);

            loadOverridesCommand  = new RelayCommand(loadOverrides);
            overrideModelCommand  = new RelayCommand(overrideModel);
            deleteOverrideCommand = new RelayCommand(deleteOverride);

            viewRequestsCommand     = new RelayCommand(viewRequests);
            engineeredModelsCommand = new RelayCommand(engineeredModels);
            goHomeCommand           = new RelayCommand(goHome);
        }
예제 #24
0
        public UitgavenLijstViewModel(
            IDataService dataservice,
            IFrameNavigationService navigation)
        {
            this._dataservice = dataservice;
            this._navigation  = navigation;

            //SorteerVeld initialiseren op ID veld
            SorteerVeld = LijstSorteren[0];

            /// <summary>
            ///     Krijgt elke keer de boodschap om de lijst te updaten
            ///     Wanneer er naar deze pagina genavigeerd wordt
            ///     Deze ViewModels worden via een IoC (Inversion of Control) container eermaal geinitialiseerd (Singleton??)
            ///     Dus de constructor wordt maar 1 keer opgeroepen,
            ///     Hiervoor moeten we met een Messenger werken, dat deze boodschap (broadcast) registreer
            ///
            ///     We zouden deze broadcast door de navigationService kunnen laten versturen,
            ///     Maar dan wordt deze service Tightly Coupled met deze VM, dit willen we ten alle tijden vermijden
            ///     Dus  elke keer we de nav service gebruiken in een andere VM, moeten we deze broadcast verzenden vanuit die andere VM
            ///
            ///     Deze string action gaat de lijst opvullen met dataservice.GetAllUitgaven()
            /// </summary>
            MessengerInstance.Register <string>(this, UpdateLijst);

            //Dit wordt gedaan om bij het initialiseren al gegevens in de lijst te hebben
            //Wordt maar 1 keer geinitialiseerd bij VMLocator
            UpdateLijst();
            //LijstUitgaven = _dataservice.GetAllUitgaven();
        }
예제 #25
0
        public KlantenViewModel(IKlantDataService datasrv, IFrameNavigationService navigationService)
        {
            _dataSrv           = datasrv;
            _navigationService = navigationService;
            System.Reflection.Assembly assembly = System.Reflection.Assembly.GetExecutingAssembly();
            FileVersionInfo            fvi      = FileVersionInfo.GetVersionInfo(assembly.Location);
            string version = fvi.FileVersion;

            Caption = String.Format("Stomerij App- V{0}", version);
            if (IsInDesignMode)
            {
                // Code runs in Blend --> create design time data.
            }
            else
            {
                Klanten = _dataSrv.GetAll();

                CancelCommand = new RelayCommand(() => ExecuteCancelKlant(), () => CanCancelKlant);
                UpdateCommand = new RelayCommand(() => ExecuteUpdateKlant(), () => CanUpdateKlant);
                SearchCommand = new RelayCommand(() => ExecuteSearchKlant(), () => CanSearchKlant);
                NewCommand    = new RelayCommand(() => ExecuteNewKlant(), () => CanNewKlant);

                SelectedKlant = Klanten.FirstOrDefault(k => k.KlantNummer == _dataSrv.MaxKlantNr());
            }
        }
예제 #26
0
        public MoviesViewModel(IFrameNavigationService navigationService)
        {
            _databaseContext   = new MultiplexTrackDbContext();
            _navigationService = navigationService;

            _categories         = new ObservableCollection <Category>();
            _selectedCategories = new ObservableCollection <Category>();

            _loadPoster = new RelayCommand(() =>
            {
                OpenFileDialog op = new OpenFileDialog();
                op.Title          = "Select a poster for movie";
                op.Filter         = "All supported graphics|*.jpg;*.jpeg;*.png|" +
                                    "JPEG (*.jpg;*.jpeg)|*.jpg;*.jpeg|" +
                                    "Portable Network Graphic (*.png)|*.png";
                op.ValidateNames = true;
                op.Multiselect   = false;

                if (op.ShowDialog() == true)
                {
                    FileName = op.FileName;
                }
            });

            _saveMovie = new RelayCommand(ExecuteSaveMovie);
        }
예제 #27
0
        /// <summary>
        /// initializes view components
        /// </summary>
        public ModifyModelPopupModel(IFrameNavigationService navigationService)
        {
            _navigationService = navigationService;

            loadedCommand = new RelayCommand(loaded);
            submitCommand = new RelayCommand(submitAsync);
        }
예제 #28
0
        public ReactionPageViewModel(IFrameNavigationService navigationService, IOpenFileDialogService openFileDialogService, ILogger loggerService, IDBService dBService)
        {
            _navigationService     = navigationService;
            _openFileDialogService = openFileDialogService;
            _logService            = loggerService;
            _dbService             = dBService;



            // _reaction = (ReactionInfo)_navigationService.Parameter;
            _reaction   = ((NavigationServiceParameter)_navigationService.Parameter).ObjParam as ReactionInfo;
            _reactionId = _reaction.ReactionID;
            ConfigNavigationCommands();
            FinishSketchEnabled = null;
            FinishSketch        = new RelayCommand(FinishSketchCommand);
            SketchAvailable     = null;


            StartingMaterial         = new ObservableCollection <StartingMaterial>();
            Reagents                 = new ObservableCollection <Reagent>();
            Solvents                 = new ObservableCollection <Solvent>();
            Products                 = new ObservableCollection <Product>();
            ObservationImgsByteArray = new ObservableCollection <byte[]>();
            ObservationImgsFilePaths = new ObservableCollection <string>();

            GetResources         = new RelayCommand(GetResourcesCommand);
            SelectObservationImg = new RelayCommand(SelectObservationImgCommand);
            DeleteObservationImg = new RelayCommand <string>(DeleteObservationImgCommand);

            SaveReaction   = new RelayCommand(SaveReactionCommandAsync);
            OutputMessages = new ObservableCollection <OutputMessage>();
        }
        public DoctorViewModel(IFrameNavigationService navigationService)
        {
            _navigationService = navigationService;
            Messenger.Default.Register <Doctor>(this, "Doctor", doctor =>
            {
                Doctor = doctor;
                RaisePropertyChanged(nameof(Doctor));
            });
            GetPatientCommand = new RelayCommand(async() =>
            {
                ObservableCollection <Pacient> tmp = null;
                do
                {
                    tmp = await DoctorUtilities.GetPatients(Doctor);
                } while (tmp == null);

                Patients = tmp;
                RaisePropertyChanged(nameof(Patients));
            });
            AddPatient = new RelayCommand(() =>
            {
                Messenger.Default.Send <Doctor>(Doctor, "Doctor");
                _navigationService.NavigateTo("NewPatient");
                Messenger.Default.Register <Pacient>(this, "Patient", pat =>
                {
                    Patients.Add(pat);
                });
            });
            DeletePatient = new RelayCommand(() =>
            {
                Tuple <Doctor, ObservableCollection <Pacient> > tup = new Tuple <Doctor, ObservableCollection <Pacient> >(Doctor, Patients);
                Messenger.Default.Send <ObservableCollection <Pacient> >(Patients, "DoctorPatients");
            });
        }
예제 #30
0
 public LoginViewModel(MainWindowModel mainWindowModel, StockAgent stockAgent, IDialogService dialogService, IFrameNavigationService frameNavigationService)
 {
     _mainWindowModel        = mainWindowModel;
     _stockAgent             = stockAgent;
     _dialogService          = dialogService;
     _frameNavigationService = frameNavigationService;
 }
예제 #31
0
        public BuyerViewModel(IUnitOfWork context, IFrameNavigationService navigationService)
            : base(context,navigationService)
        {
            OriginalModel = new Buyer();

            HandleNavigationParameter(navigationService.Parameter);

            ConfigureValidationRules();
        }
예제 #32
0
        public InvoiceListViewModel(IUnitOfWork context,IFrameNavigationService navigationService)
        {
            _context = context;
            _navigationService = navigationService;

            InvoiceList = new ItemsChangeObservableCollection<BasicInvoiceInformation>();

            HandleNavigationParameter(_navigationService.Parameter);
        }
예제 #33
0
        public BuyerListViewModel(IUnitOfWork context, IFrameNavigationService navigationService)
        {
            _context = context;
            _navigationService = navigationService;

            BuyerList = new ObservableCollection<Buyer>();

            HandleNavigationParameter(_navigationService.Parameter);

            GetBuyerList();
        }
예제 #34
0
        public SellerListViewModel(IUnitOfWork context,IFrameNavigationService navigationService)
        {
            _context = context;
            _navigationService = navigationService;

            SellerList = new ObservableCollection<BasicPersonInformation>();

            RegisterMessages();

            GetSellerList();
        }
예제 #35
0
        public InvoiceViewModel(IUnitOfWork context, 
                                IMessageBoxService messageBoxService,
                                IFrameNavigationService navigationService)
            : base(context, messageBoxService,navigationService)
        {
            IssueDate = DateTime.Now;
            InvoiceModel = new Invoice();
            PaymentPeriod = 1;
            PaymentMethodValues = new Dictionary<PaymentMethod, string>
            {
                {PaymentMethod.Cash,"Gotówka"},
                {PaymentMethod.Transfer,"Przelew"}
            };
            SelectedPaymentMethod = PaymentMethod.Transfer;
            HandleNavigationParameter(navigationService.Parameter);

            RegisterMessages();
            ConfigureValidationRules();

            #region DesignMode
            if (IsInDesignMode)
            {
                BuyerList = new Collection<Buyer>
                {
                    new Buyer
                    {
                        FirstName = "Michał",
                        LastName = "Pełcik",
                        CompanyName = "sdfsf"
                    }
                };
                SaleDate = new DateTime(2015, 05, 05);
                PaymentDetailList = new ItemsChangeObservableCollection<PaymentDetail>
                {
                    new PaymentDetail
                    {
                        Description = "sdfsdf",
                        MeasureUnit = "szt.",
                        PricePerUnit = 234,
                        Quantity = 3,
                        Amount = 702
                    }
                };
            }
            #endregion
        }
예제 #36
0
        public PaymentViewModel(IUnitOfWork context,
            IMessageBoxService messageBoxService,
            IFrameNavigationService navigationService)
        {
            NavigationService = navigationService;
            MessageBoxService = messageBoxService;
            Context = context;

            BuyerList = new List<Buyer>();

            SaleDate = DateTime.Now;

            _paymentDetailList = new ItemsChangeObservableCollection<PaymentDetail>();
            _paymentDetailList.CollectionChanged+= PaymentDetailList_CollectionChanged;

            PaymentDetailViewModel = new PaymentDetailViewModel();
            RegisterMessages();
        }
예제 #37
0
 public PersonViewModel(IUnitOfWork context,IFrameNavigationService navigationService)
 {
     Context = context;
     NavigationService = navigationService;
 }