コード例 #1
0
		async void OnSignUpClicked (object sender, EventArgs e)
		{
			var user = new User () {
				Username = usernameEntry.Text,
				Password = passwordEntry.Text,
				Email = emailEntry.Text
			};

			var result = await App.TodoManager.SignUpUserAsync (user);
			if (result) {
				Navigation.InsertPageBefore (new TodoListPage (), Navigation.NavigationStack.First ());
				await Navigation.PopToRootAsync ();
			} else {
				messageLabel.Text = "Sign up failed";
			}
		}
コード例 #2
0
		async void OnLoginClicked (object sender, EventArgs e)
		{
			var user = new User () {
				Username = usernameEntry.Text,
				Password = passwordEntry.Text
			};

			var result = await App.TodoManager.LoginUserAsync (user);

			if (result) {
				Navigation.InsertPageBefore (new TodoListPage (), this);
				await Navigation.PopAsync ();
			} else {
				messageLabel.Text = "Login failed";
			}
		}
コード例 #3
0
		public Task<bool> LoginUserAsync (User user)
		{
			return storage.LoginUserAsync (user);
		}
コード例 #4
0
		public Task<bool> SignUpUserAsync (User user)
		{
			return storage.SignUpUserAsync (user);
		}