Exemplo n.º 1
0
        public ShooterCreateViewModel()
        {
            AddToAssingedParticipationCommand = new RelayCommand <ParticipationListItem>(ExecuteAddToAssignedParticipationCommand,
                                                                                         CanExecuteAddtoAssignedParticipationCommand);
            RemoveFromAssingedParticipationCommand =
                new RelayCommand <ShooterParticipationListItem>(ExecuteRemoveFromAssignedParticipationCommand,
                                                                CanExecuteRemoveFromAssignedParticipationCommand);
            CancelCommand        = new RelayCommand <object>(ExecuteCloseCommand);
            CreateShooterCommand = new RelayCommand <UiPerson>(ExecuteCreateShooterCommand, CanExecuteCreateShooterCommand);

            if (!DesignTimeHelper.IsInDesignMode)
            {
                IConfiguration config = ConfigurationSource.Configuration;
                _participationDataStore        = config.GetParticipationDataStore();
                _windowService                 = config.GetWindowService();
                _shooterParticipationDataStore = config.GetShooterParticipationDataStore();
                _uiEvents = config.GetUIEvents();
                _uiEvents.PersonSelected += person => { UiPerson = person; };
                _uiEvents.RequireSelectedPerson();
                _shooterNumberService        = config.GetShooterNumberService();
                _shooterDataStore            = config.GetShooterDataStore();
                _shooterParticipationView    = config.GetShooterParticipationView();
                _ssvShooterDataWriterService = config.GetSsvShooterDataWriterService();
                LoadAvailableParticipationList();
                LoadAssignedParticipationList();
            }
        }
    public ShooterCreateViewModel()
    {
      AddToAssingedParticipationCommand = new RelayCommand<ParticipationListItem>(ExecuteAddToAssignedParticipationCommand,
        CanExecuteAddtoAssignedParticipationCommand);
      RemoveFromAssingedParticipationCommand =
        new RelayCommand<ShooterParticipationListItem>(ExecuteRemoveFromAssignedParticipationCommand,
          CanExecuteRemoveFromAssignedParticipationCommand);
      CancelCommand = new RelayCommand<object>(ExecuteCloseCommand);
      CreateShooterCommand = new RelayCommand<UiPerson>(ExecuteCreateShooterCommand, CanExecuteCreateShooterCommand);

      if (!DesignTimeHelper.IsInDesignMode)
      {
        IConfiguration config = ConfigurationSource.Configuration;
        _participationDataStore = config.GetParticipationDataStore();
        _windowService = config.GetWindowService();
        _shooterParticipationDataStore = config.GetShooterParticipationDataStore();
        _uiEvents = config.GetUIEvents();
        _uiEvents.PersonSelected += person => { UiPerson = person; };
        _uiEvents.RequireSelectedPerson();
        _shooterNumberService = config.GetShooterNumberService();
        _shooterDataStore = config.GetShooterDataStore();
        _shooterParticipationView = config.GetShooterParticipationView();
        _ssvShooterDataWriterService = config.GetSsvShooterDataWriterService();
        LoadAvailableParticipationList();
        LoadAssignedParticipationList();
      }
    }
Exemplo n.º 3
0
        public PersonEditViewModel()
        {
            EditPersonCommand = new RelayCommand <UiPerson>(ExecuteEditPersonCommand, CanExecuteEditPersonCommand);
            CancelCommand     = new RelayCommand <object>(ExecuteCloseCommand);
            //CreateShooterCommand = new RelayCommand<UiPerson>(ExecuteCreateShooterCommand, CanExecuteCreateShooterCommand);

            if (!DesignTimeHelper.IsInDesignMode)
            {
                IConfiguration config = ConfigurationSource.Configuration;
                _personDataStore          = config.GetPersonDataStore();
                _shooterDataStore         = config.GetShooterDataStore();
                _uiEvents                 = config.GetUIEvents();
                _windowService            = config.GetWindowService();
                _shooterNumberService     = config.GetShooterNumberService();
                _uiEvents.PersonSelected += person => { UiPerson = person ?? new UiPerson(); };
                _uiEvents.RequireSelectedPerson();
            }
        }
    public PersonEditViewModel()
    {
      EditPersonCommand = new RelayCommand<UiPerson>(ExecuteEditPersonCommand, CanExecuteEditPersonCommand);
      CancelCommand = new RelayCommand<object>(ExecuteCloseCommand);
      //CreateShooterCommand = new RelayCommand<UiPerson>(ExecuteCreateShooterCommand, CanExecuteCreateShooterCommand);

      if (!DesignTimeHelper.IsInDesignMode)
      {
        IConfiguration config = ConfigurationSource.Configuration;
        _personDataStore = config.GetPersonDataStore();
        _shooterDataStore = config.GetShooterDataStore();
        _uiEvents = config.GetUIEvents();
        _windowService = config.GetWindowService();
        _shooterNumberService = config.GetShooterNumberService();
        _uiEvents.PersonSelected += person => { UiPerson = person ?? new UiPerson(); };
        _uiEvents.RequireSelectedPerson();
      }
    }