コード例 #1
0
 public CreateEmployeeViewModel(Employee employee, IEmployeeRepository repository, MainViewModel mainViewModel)
     : base(mainViewModel)
 {
     Employee = employee;
     Repository = repository;
     Title = "Create Employee";
 }
コード例 #2
0
 public void Initialize()
 {
     _mainViewModel = new MainViewModel();
     _viewModel = new DatabaseLoginViewModel(_mainViewModel);
     SetCorrectConnectionString();
     SettingsHelper.ResetSettings();
 }
コード例 #3
0
 public LoginViewModel(IDirectoryAuthenticator authenticator, IEmployeeRepository employeeRepository, MainViewModel mainViewModel)
     : base(mainViewModel)
 {
     Title = "Login";
     _directoryAuthenticator = authenticator;
     _employeeRepository = employeeRepository;
     LoadSettings();
 }
コード例 #4
0
 public void Initialize()
 {
     _mainViewModel = new MainViewModel();
     _employee = new Employee {Login = "******"};
     _employees = new List<Employee> {_employee};
     _repository = new EmployeeRepositoryStub(_employees);
     SettingsHelper.SaveConnectionString("Data Source=YOGER-SUPERMAN\\SQLEXPRESS;Initial Catalog=HolidayCalendar;Integrated Security=True;Connect Timeout=5");
 }
コード例 #5
0
 protected UtilityViewModel(MainViewModel mainViewModel)
 {
     if (mainViewModel == null)
     {
         throw new ArgumentNullException("mainViewModel cannot be null. ");
     }
     MainViewModel = mainViewModel;
 }
コード例 #6
0
ファイル: App.xaml.cs プロジェクト: yoger6/HolidayCalendar
        private void SetupMainView()
        {
            var mainView = new MainView();
            var mainViewModel = new MainViewModel();
            mainView.DataContext = mainViewModel;
            Exit += (sender, args) => mainViewModel.Close();

            mainView.Show();
        }
コード例 #7
0
 public void Initialize()
 {
     _authenticatorStub = new DirectoryAuthenticatorStub(_domain, _userName, _password);
     _mainViewModel = new MainViewModel();
     _employees = new List<Employee>();
     _employeeRepository = new EmployeeRepositoryStub(_employees);
     _viewModel = GetNewViewModel();
     _passwordBox = new PasswordBox {Password = _password};
     SettingsHelper.ResetSettings();
 }
コード例 #8
0
 public UtilityViewModelStub(MainViewModel mainViewModel)
     : base(mainViewModel)
 {
 }
コード例 #9
0
 public EditEmployeeViewModel(Employee employee, IEmployeeRepository repository, MainViewModel mainViewModel)
     : base(employee, repository, mainViewModel)
 {
     DisplayEmployeeProperties(employee);
 }
コード例 #10
0
 public EditEmployeeViewModel(Employee employee, MainViewModel mainViewModel)
     : this(employee, new EmployeeRepository(), mainViewModel)
 {
 }
コード例 #11
0
 public DatabaseLoginViewModel(MainViewModel mainViewModel)
     : base(mainViewModel)
 {
     Title = "Database info";
 }
コード例 #12
0
 public LoginViewModel(IEmployeeRepository repository, MainViewModel mainViewModel)
     : this(new ActiveDirectoryAuthenticator(), repository, mainViewModel)
 {
 }
コード例 #13
0
 public LoginViewModel(MainViewModel mainViewModel)
     : this(new DirectoryAuthenticatorDummy(), new EmployeeRepository(SettingsHelper.GetConnectionString()), mainViewModel)
 {
 }
コード例 #14
0
 public void Initialize()
 {
     _mainViewModel = new MainViewModel();
     _utilityViewModel = new UtilityViewModelStub(_mainViewModel);
     _mainViewModel.CurrentUtilityViewModel = _utilityViewModel;
 }
コード例 #15
0
 public void Initialize()
 {
     _viewModel = new MainViewModel();
 }