예제 #1
0
 protected ViewModelBase(IMessageBoxService messageBoxService, IEventAggregator eventAggregator, AppRepository appRepository, IoCProxy ioc)
 {
     MessageBoxService = messageBoxService;
     AppRepository     = appRepository;
     EventAggregator   = eventAggregator;
     IoC = ioc;
 }
예제 #2
0
 public MainViewModel(IEventAggregator eventAggregator, IoCProxy ioc)
 {
     eventAggregator.Subscribe(this);
     Handle(new ShowViewModelMessage(ioc.Get <LoginPageViewModel>()));
 }
예제 #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
        }
예제 #4
0
 protected ViewModelBase(IMessageBoxService messageBoxService = null, IEventAggregator eventAggregator = null, IoCProxy ioc = null)
     : this(messageBoxService, eventAggregator, new AppRepository(), ioc)
 {
 }
예제 #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("-");
 }