예제 #1
0
 public ProfilePage()
 {
     Content = new LargeLabel () {
         Text = "Profile Page",
         VerticalOptions = LayoutOptions.CenterAndExpand,
         HorizontalOptions = LayoutOptions.CenterAndExpand,
     };
 }
예제 #2
0
        public GroupPage(RootPage rootPage)
        {
            _rootPage = rootPage;
            NavigationPage.SetHasNavigationBar (this, false);

            //TODO : Inject Groups
            _db = new GroupsterDatabase();

            _viewModel = new GroupLoadingViewModel (Navigation, _db.GetItems<Group>(), rootPage);
            BindingContext = _viewModel;

            var statusMessageLabel = new LargeLabel {
                HorizontalOptions = LayoutOptions.Center,
                VerticalOptions = LayoutOptions.Center,
                TextColor = Color.White,
            };

            statusMessageLabel.SetBinding<GroupLoadingViewModel> (Label.TextProperty, vm => vm.StatusMessage);

            var stackLayout = new StackLayout {
                HorizontalOptions = LayoutOptions.Center,
                VerticalOptions = LayoutOptions.Center,
                Spacing = 10
            };

            var loadingImage = new Image ();

            loadingImage.SetBinding<GroupLoadingViewModel> (Image.SourceProperty, vm => vm.LoadingImage);

            var refreshButton = new Button{ Text = "Refresh", HorizontalOptions = LayoutOptions.Center };

            refreshButton.SetBinding<GroupLoadingViewModel> (Button.CommandProperty, vm => vm.GetGroupCommand);
            refreshButton.SetBinding<GroupLoadingViewModel> (VisualElement.IsVisibleProperty, vm => vm.IsRefreshButtonVisible);

            var activityIndicator = new ActivityIndicator{ IsRunning = true };

            activityIndicator.SetBinding<GroupLoadingViewModel> (VisualElement.IsVisibleProperty, vm => vm.IsActivityIndicatorVisible);

            stackLayout.Children.Add (loadingImage);
            stackLayout.Children.Add (statusMessageLabel);
            stackLayout.Children.Add (activityIndicator);
            stackLayout.Children.Add (refreshButton);

            Content = stackLayout;
        }
예제 #3
0
        StackLayout CreateForecastStatusStackLayout()
        {
            var scheduledGroupsLabel = new ExtraLargeLabel { HorizontalOptions = LayoutOptions.Center };

            scheduledGroupsLabel.SetBinding<ForecastViewModel> (Label.TextProperty, vm => vm.ScheduledGroupCount);
            scheduledGroupsLabel.TextColor = GetScheduledGroupsTextColor (_forecast.ScheduledGroupsCount);

            var scheduledGroupsTextLabel = new LargeLabel { VerticalOptions = LayoutOptions.CenterAndExpand };
            scheduledGroupsTextLabel.SetBinding<ForecastViewModel> (Label.TextProperty, vm => vm.ScheduledGroupText);

            var horizontalStackLayout = new StackLayout {
                Orientation = StackOrientation.Horizontal,
                HorizontalOptions = LayoutOptions.Center,
                VerticalOptions = LayoutOptions.Start,
                Padding = new Thickness (40, 0, 0, 0)
            };

            horizontalStackLayout.Children.Add (new LargeLabel {
                Text = "Events for ",
                VerticalOptions = LayoutOptions.CenterAndExpand
            });
            horizontalStackLayout.Children.Add (scheduledGroupsLabel);
            horizontalStackLayout.Children.Add (scheduledGroupsTextLabel);

            return horizontalStackLayout;
        }
예제 #4
0
		public LoginPage (RootPage rootPage)
		{
			this._rootPage = rootPage;
			_db = new GroupsterDatabase();

			_viewModel = new LoginViewModel (Navigation, new User(), rootPage);
			BindingContext = _viewModel;

			Padding = 0;

			// Create layout and bind where appropriate.
			var loginMessageLabel = new LargeLabel {
				HorizontalOptions = LayoutOptions.Center,
				VerticalOptions = LayoutOptions.Start,
				HeightRequest = 50,
				TextColor = Color.White,
				Text = "Welcome to Groupster",
				FontSize = 30 //Device.GetNamedSize(NamedSize.Large, typeof(Label))
			};

			BackgroundColor = AppColors.BaseColor;

			var loginImage = new Image ();

			loginImage.SetBinding<LoginViewModel> (Image.SourceProperty, vm => vm.LoginImage);

			var usernameEntry = new Entry {
				Placeholder = "Email",
			};

			usernameEntry.SetBinding(Entry.TextProperty, "UserNameMessage");

			var passwordEntry = new Entry {
				Placeholder = "Password",
				IsPassword = true
			};

			passwordEntry.SetBinding(Entry.TextProperty, "PasswordMessage");

			var switchLabel = new Label {
				HorizontalOptions = LayoutOptions.Start,
				VerticalOptions = LayoutOptions.Center,
				Text = "Remember Me?",
			};

			var rememberMeOption = new  CheckBox {
				BackgroundColor = AppColors.BaseColor
			};

			rememberMeOption.SetBinding(CheckBox.CheckedProperty, "RememberMe");

			var switchStackLayout = new StackLayout {
				HorizontalOptions = LayoutOptions.Center,
				Spacing = 10,

				Orientation = StackOrientation.Horizontal,
				Children = {
					switchLabel,
					rememberMeOption
				}
			};

			var loginButton = new Button { 
				Text = "Login", 
				HorizontalOptions = LayoutOptions.Center,
				BackgroundColor = AppColors.Button	
			};
			loginButton.Clicked += LogMeIn;

//			var registerButton = new Button { 
//				Text = "Close", 
//				HorizontalOptions = LayoutOptions.Center 
//			};
//
//			var buttonLayout = new StackLayout {
//				HorizontalOptions = LayoutOptions.Center,
//				Spacing = 10,
//				Orientation = StackOrientation.Horizontal,
//				Children = {
//					loginButton,
//					registerButton
//				}
//			};

			var registerLabel = new Label {
				HorizontalOptions = LayoutOptions.Start,
				VerticalOptions = LayoutOptions.End,
				HeightRequest = 40,
				Text = "New to Groupster?",
				FontSize = Device.GetNamedSize(NamedSize.Medium, typeof(Label))
			};

			var registerLink = new Label {
				HorizontalOptions = LayoutOptions.Start,
				VerticalOptions = LayoutOptions.End,
				HeightRequest = 40,
				Text = "Register here",
				FontSize = Device.GetNamedSize(NamedSize.Medium, typeof(Label)),
				FontAttributes = FontAttributes.Italic
			};

//			var registerLink = new Button { 
//				Text = "Register here", 
//				HorizontalOptions = LayoutOptions.Center,
//				VerticalOptions = LayoutOptions.End,
//				HeightRequest = 20,
//				FontSize = Device.GetNamedSize(NamedSize.Small, typeof(Label)),
//				FontAttributes = FontAttributes.Italic,
//				BackgroundColor = AppColors.BaseColor,
//				TextColor = Color.Default
//			};
//
//			registerLink.Clicked += RegisterMe;

			var registerLayout = new StackLayout {
				HorizontalOptions = LayoutOptions.Center,
				VerticalOptions = LayoutOptions.CenterAndExpand,
				Spacing = 10,
				Orientation = StackOrientation.Horizontal,
				Children = {
					new Label{},
					registerLabel,
					registerLink
				}
			};

			var stackLayout = new StackLayout {
				HorizontalOptions = LayoutOptions.Center,
				VerticalOptions = LayoutOptions.Center,
				Spacing = 10,
			};

			stackLayout.Children.Add (loginMessageLabel);
			stackLayout.Children.Add (loginImage); 	
			stackLayout.Children.Add (usernameEntry);
			stackLayout.Children.Add (passwordEntry);
			stackLayout.Children.Add (switchStackLayout);
			stackLayout.Children.Add (loginButton); 	
			stackLayout.Children.Add (registerLayout); 	

			Content = stackLayout;
		}