View CreateDayRow ()
 {
     var carousel = new CarouselLayout {
         HeightRequest = 40,
         ItemTemplate = new DataTemplate (typeof(DayHeader))
     };
     carousel.SetBinding (CarouselLayout.ItemsSourceProperty, "FullScheduleDays");
     carousel.SetBinding (CarouselLayout.SelectedItemProperty, "SelectedDay");
     return carousel;
 }
        public ChooseSessionView (Slot slot, Session session)
		{
            BaseViewModel.CreateAndBind<ChooseSessionViewModel> (this, slot, session);

			NavigationPage.SetBackButtonTitle (this, "");

            ToolbarItems.Add (CreateSelectButton ());

            SetBinding (ChooseSessionView.NavigationProperty, new Binding ("Navigation"));
            SetBinding (ChooseSessionView.TitleProperty, new Binding ("Title"));
            SetBinding (ChooseSessionView.SelectButtonTextProperty, new Binding ("SelectButtonText"));

			var relativeLayout = new RelativeLayout 
			{
				HorizontalOptions = LayoutOptions.FillAndExpand,
				VerticalOptions = LayoutOptions.FillAndExpand
			};

			var lowerStackLayout = new StackLayout 
			{
				HorizontalOptions = LayoutOptions.CenterAndExpand,
				VerticalOptions = LayoutOptions.EndAndExpand,
				Spacing = 20,
				Padding = new Thickness (0, 20, 0, 20),
			};
			lowerStackLayout.Children.Add (CreatePips ());
			lowerStackLayout.Children.Add (CreateRateButton ());

			relativeLayout.Children.Add (lowerStackLayout,
				Constraint.RelativeToParent ((parent) => { return parent.X; }),
				Constraint.RelativeToParent ((parent) => { return parent.Height - 100; }),
				Constraint.RelativeToParent ((parent) => { return parent.Width; })
			);

			sessionInfoCarousel = CreateSessionInfoCarousel ();
			relativeLayout.Children.Add (sessionInfoCarousel,
				Constraint.RelativeToParent ((parent) => { return parent.X; }),
				Constraint.RelativeToParent ((parent) => { return parent.Y; }),
				Constraint.RelativeToParent ((parent) => { return parent.Width; }),
				Constraint.RelativeToView (lowerStackLayout, (parent,sibling) => { return parent.Height - sibling.Height; })
			);

			var fadeOut = CreateFadeOut ();
			relativeLayout.Children.Add (fadeOut,
				Constraint.RelativeToParent (parent => { return parent.X; }),
				Constraint.RelativeToView (lowerStackLayout, (parent,sibling) => { return sibling.Y - 30; }),
				Constraint.RelativeToParent (parent => { return parent.Width; }),
				Constraint.Constant (40)
			);

			Content = relativeLayout;
		}
		CarouselLayout CreateSessionInfoCarousel ()
		{
			var carousel = new CarouselLayout 
			{
				ItemTemplate = new DataTemplate(typeof(SessionInfoView)),
				HorizontalOptions = LayoutOptions.FillAndExpand,
				VerticalOptions = LayoutOptions.FillAndExpand
			};

			carousel.SetBinding (CarouselLayout.ItemsSourceProperty, "SlotSessions");
			carousel.SetBinding (CarouselLayout.SelectedItemProperty, "SlotSession");

			return carousel;
		}
예제 #4
0
        View CreateCurrentSessionsCarousel ()
        {
            var carousel = new CarouselLayout 
			{
				HorizontalOptions = LayoutOptions.FillAndExpand,
				VerticalOptions = LayoutOptions.FillAndExpand,
                ItemTemplate = new DataTemplate(typeof(HomeCurrentSessionView))
            };
            carousel.SetBinding (CarouselLayout.ItemsSourceProperty, "CurrentSessions");
            carousel.SetBinding (CarouselLayout.SelectedItemProperty, "CurrentSession");

            return carousel;
        }