示例#1
0
		public override void ViewDidLoad ()
		{
			base.ViewDidLoad ();

			_loginViewModel = FactorySingleton.Factory.Get<LoginViewModel> ();
			_loginViewModel.Localaizer = new Localizer ();

			ShowView ();
		}
示例#2
0
		public async void StartTestLoginViewModel()
		{			
			_localizeService = new LocalizeService(_localizer);
			_localizeService.Data = new LocalizeModel ();
			LoginViewModel loginViewModel = new LoginViewModel (_localizer,_platformException);
			LoginMockModel loginData = new LoginMockModel ();

			var isValid =await loginViewModel.CheckLoginData (loginData, _testServer);
			Assert.IsTrue (isValid, "Message: error login data");
		}
示例#3
0
		public LoginPresenter(Factory factory, ILocalizeService localaize)
		{
			_localize = localaize;
			_factory = factory;

			_loginViewModel = factory.Get<LoginViewModel> ();


			_image = new Image
			{
				Source = "logo.png"            
			};
            
            _userName = new Entry
            {
				Placeholder = _localize.Data.username
            };

            _password = new Entry
            {
                IsPassword = true,
				Placeholder = _localize.Data.password
            };

            _loginButton = new Button
            {
				Text = _localize.Data.login
            };

            _error = new Label
            {
				//Text =  _loginViewModel.errorMessage,//_localize.Data.loginError,
				//TextColor =  Color.Red,//FromHex ("#FA8072"),
				XAlign = TextAlignment.Center,
                IsVisible = false
            };

            _loginButton.Clicked += onLoginButtonClicked;
            
            Content = new StackLayout
            {
                VerticalOptions = LayoutOptions.Center,
                Padding = 50,
                Children ={
                    _image,
                    _userName,
                    _password, 
					_loginButton,
					_error
                }
            };
        }
示例#4
0
		protected override void OnCreate(Bundle bundle)
		{
			base.OnCreate (bundle);			
			SetContentView (Resource.Layout.Login);

			_loginBtn = FindViewById<Button> (Resource.Id.LoginBtn);
			_userName = FindViewById<EditText> (Resource.Id.LoginUsername);
			_password = FindViewById<EditText> (Resource.Id.LoginPassword);
			_error = FindViewById<TextView> (Resource.Id.LoginError);

			_loginViewModel = FactorySingleton.Factory.Get<LoginViewModel> ();
			_loginViewModel.Localaizer = new Localizer (Application.Context);

			_loginBtn.Click += onLoginButtonClicked;
		}
示例#5
0
		public async void Integration ()
		{
			_localizeService = new LocalizeService(_localizer);
			_localizeService.Data = new LocalizeModel ();

			LoginViewModel loginViewModel = new LoginViewModel (_localizer,_platformException);
			VTSViewModel vtsViewModel = new VTSViewModel (_fileSystem, _localizer,new SQLitePlatformWin32());
			LoginMockModel loginData = new LoginMockModel ();
			vtsViewModel.Server = _testServer;

			var isValid =await loginViewModel.CheckLoginData (loginData, _testServer);
			Assert.IsTrue (isValid, "Message: error login data");

			List<VTSModel> vtsList = await vtsViewModel.GetVTSList ();
			Assert.IsNotNull (vtsList, "Message GetVTSList error");

		}