Esempio n. 1
0
 protected ViewModelBase(IMessageBoxService messageBoxService, IEventAggregator eventAggregator, AppRepository appRepository, IoCProxy ioc)
 {
     MessageBoxService = messageBoxService;
     AppRepository     = appRepository;
     EventAggregator   = eventAggregator;
     IoC = ioc;
 }
Esempio n. 2
0
 public MainViewModel(IEventAggregator eventAggregator, IoCProxy ioc)
 {
     eventAggregator.Subscribe(this);
     Handle(new ShowViewModelMessage(ioc.Get <LoginPageViewModel>()));
 }
Esempio n. 3
0
        public LoginPageViewModel(IMessageBoxService messageBoxService, IEventAggregator eventAggregator, IoCProxy ioc) : base(messageBoxService, eventAggregator, ioc)
        {
            AddValidationRule(() => Email)
            .Condition(() => !EmailValidation.Check(Email))
            .Message("-");

            AddValidationRule(() => Password)
            .Condition(() => string.IsNullOrEmpty(Password))
            .Message("-");

#if DEBUG
            // Pro účely ladění a vývoje. Zadávat furt heslo je otravný.
            Email    = "*****@*****.**";
            Password = "******";
#endif
        }
Esempio n. 4
0
 protected ViewModelBase(IMessageBoxService messageBoxService = null, IEventAggregator eventAggregator = null, IoCProxy ioc = null)
     : this(messageBoxService, eventAggregator, new AppRepository(), ioc)
 {
 }
Esempio n. 5
0
 public RegisterPageViewModel(IMessageBoxService messageBoxService, IEventAggregator eventAggregator, IoCProxy ioc)
     : base(messageBoxService, eventAggregator, ioc)
 {
     AddValidationRule(() => Email).Condition(() => !EmailValidation.Check(Email)).Message("-");
     AddValidationRule(() => Password).Condition(() => string.IsNullOrEmpty(Password)).Message("-");
     AddValidationRule(() => RepeatPassword).Condition(() => string.IsNullOrEmpty(RepeatPassword)).Message("-");
     AddValidationRule(() => FirstName).Condition(() => string.IsNullOrEmpty(FirstName)).Message("-");
     AddValidationRule(() => Surname).Condition(() => string.IsNullOrEmpty(Surname)).Message("-");
 }