Beispiel #1
0
        public LoginViewModel(IValidatableObjectFactory validatableObjectFactory, IUserDataStore userDataStore)
        {
            _ValidateableObjectFactory = validatableObjectFactory;
            _UserDataStore             = userDataStore;

            LoginCommand = new Command(async() => await Login());
            NavigateToRegisterCommand = new Command(() => NavigateToRegisterPage());
            ForgotPasswordCommand     = new Command(() => { });

            Email    = _ValidateableObjectFactory.CreateSimpleValidatebleObject <string>("*****@*****.**");
            Password = _ValidateableObjectFactory.CreateSimpleValidatebleObject <string>("1234");

            Init();
        }
        public RegisterStoreViewModel(IValidatableObjectFactory validatableObjectFactory, IUserDataStore userDataStore, IStoreDataStore storeDataStore,
                                      IStoreFactory storeFactory, IUserFactory userFactory,
                                      IRegisterCardViewModel cardViewModel, IStoreRegistrationEntry storeRegistrationEntry)
        {
            _validatableObjectFactory = validatableObjectFactory;
            _UserDataStore            = userDataStore;
            _StoreDataStore           = storeDataStore;
            _StoreFactory             = storeFactory;
            _UserFactory           = userFactory;
            CardViewModel          = cardViewModel;
            StoreRegistrationEntry = storeRegistrationEntry;

            StoreName      = _validatableObjectFactory.CreateSimpleValidatebleObject <string>("Store 1");
            CardNumber     = _validatableObjectFactory.CreateSimpleValidatebleObject <string>();
            Longitude      = _validatableObjectFactory.CreateSimpleValidatebleObject <string>("1");
            Latitude       = _validatableObjectFactory.CreateSimpleValidatebleObject <string>("2");
            StoreOwnerName = _validatableObjectFactory.CreateSimpleValidatebleObject <string>("Owner 1");
            Description    = _validatableObjectFactory.CreateSimpleValidatebleObject <string>("Description");
            Category       = _validatableObjectFactory.CreateSimpleValidatebleObject <string>("Category");

            StoreNameValidationCommand      = new Command(() => StoreName.Validate());
            LongitudeValidationCommand      = new Command(() => Longitude.Validate());
            LatitudeValidationCommand       = new Command(() => Latitude.Validate());
            StoreOwnerNameValidationCommand = new Command(() => StoreOwnerName.Validate());
            MoreInfoCommand      = new Command <CommandEventData>((commandData) => MoreInfoPopup(commandData));
            RegisterStoreCommand =
                new Command <CommandEventData>(async(data) => await NavigateToInventoryProductItem(data));
            DescriptionValidationCommand = new Command(() => Description.Validate());
            GetLogoPhotoCommand          = new Command(async() => ProductImageSource = await Utils.PickPhoto());
            TakeLogoPhotoCommand         = new Command(() => { });
            GetLocationCommand           = new Command(async() => await GetLocation());
            TypeOfCardChangedCommand     = new Command <CommandEventData>((data) => TypeOfCardSelectionChangedHandler(data));

            Init();
        }
Beispiel #3
0
        public RegisterCardViewModel(IUserDataStore userDataStoreFactory, IUserCardDataStore userCardDataStore, IValidatableObjectFactory validatableObjectFactory, RegisterEntry registerEntry, ICardFactory cardFactory)
        {
            _UserDataStore            = userDataStoreFactory;
            _UserCardDataStore        = userCardDataStore;
            _ValidatableObjectFactory = validatableObjectFactory;
            CardFactory = cardFactory;

            UserRegistrationInfo = registerEntry;

            RegisterCardCommand      = new Command(() => RegisterCard());
            TypeOfCardChangedCommand = new Command <CommandEventData>((data) => TypeOfCardSelectionChangedHandler(data));
            SkipToHomeCommand        = new Command(() => SkipToHome());

            CardNumber     = _ValidatableObjectFactory.CreateSimpleValidatebleObject <string>("1111111111111111111111111");
            TypeOfCard     = _ValidatableObjectFactory.CreateSimpleValidatebleObject <string>("Debit");
            SecurityCode   = _ValidatableObjectFactory.CreateSimpleValidatebleObject <string>();
            ExpirationDate = _ValidatableObjectFactory.CreateSimpleValidatebleObject(DateTime.Today);
            CardHolderName = _ValidatableObjectFactory.CreateSimpleValidatebleObject <string>("Ricardo");

            Init();
        }
        public RegisterViewModel(IUserDataStore userDataStoreFactory, IUserFactory userFactory, IValidatableObjectFactory validatableObjectFactory, RegisterEntry register)
        {
            RegisterModel = register;

            _UserDataStore            = userDataStoreFactory;
            _UserFactory              = userFactory;
            _ValidatableObjectFactory = validatableObjectFactory;

            RegisterCommand = new Command(async() => await RegisterProcedure());
            ToLoginCommand  = new Command(async() => await NavigateToLogin());

            Email           = _ValidatableObjectFactory.CreateSimpleValidatebleObject("*****@*****.**");
            FullName        = _ValidatableObjectFactory.CreateSimpleValidatebleObject("Ricardo Torres");
            Password        = _ValidatableObjectFactory.CreateSimpleValidatebleObject("1234");
            BirthDate       = _ValidatableObjectFactory.CreateSimpleValidatebleObject <DateTime>();
            ConfirmPassword = _ValidatableObjectFactory.CreateSimpleValidatebleObject("1234");
            PhoneNumber     = _ValidatableObjectFactory.CreateSimpleValidatebleObject("777-777-7777");

            AddValidations();
        }