public override void UpdateView ()
		{
			base.UpdateView ();

			Bookings bookings = (Bookings)Model;
			BookingsPage page = (BookingsPage)View;

			TableSection section = new TableSection ();

			foreach (Booking booking in bookings.bookings) {

				TextLabelCell cell = new TextLabelCell {
					Label = booking.workshopID + " " + booking.topic,
					LabelColor = Color.Black,
					HasLabelShadow = false,
				};

				cell.Tapped += (object sender, EventArgs e) => ShowSelectedWorkshop (booking);
				section.Add (cell);
			}

			page.RecordAttendanceButton.Tapped += (sender, e) => ScanQRCode();

			(page.BookingsListView.Root = new TableRoot ()).Add (new TableSection {page.RecordAttendanceButton});
			page.BookingsListView.Root.Add (section);
		}
Example #2
0
        public void AddSkinButton(string name, Color color)
        {
            var cell = new TextLabelCell (){ Label = name, LabelColor = Color.White, BackgroundColor = color };

            cell.HasArrow = false;
            cell.Tapped += (sender, e) => App.MainNavigationPage.BarBackgroundColor = color;
            cell.XAlign = TextAlignment.Center;

            SkinButtonsSection.Add (cell);
        }
Example #3
0
        public void AddTextLabelCell(string label, string text, Action action = null)
        {
            var cell = new TextLabelCell (){ Label = label, Text = text };

            if (action != null) {
                cell.HasArrow = true;
                cell.Tapped += (sender, e) => action ();
            }

            BasicInfoSection.Add (cell);
        }
        public override void UpdateView()
        {
            base.UpdateView ();

            Workshops sessions = (Workshops)Model;
            WorkshopsPage page = (WorkshopsPage)View;

            page.Title = sessions.RelatedWorkshopSet.Name;

            TableSection section = new TableSection ();

            foreach (Workshop session in sessions.workshops) {

                TextLabelCell cell = new TextLabelCell {
                    Label = session.topic,
                    HasArrow = true
                };

                //Simple theme
                if (((WorkshopsPage)View).BackgroundColor.A == 1) {

                    var cellAction = new MenuItem ();

                    if (session.BookingStatus == BookingStatuses.Booked) {

                        cellAction.Text = "Cancel";
                        cellAction.IsDestructive = true;
                        cellAction.Clicked += (sender, e) => CancelWorkShop (session);

                    } else if (session.BookingStatus == BookingStatuses.NotBooked) {

                        cellAction.Text = "Book";
                        cellAction.IsDestructive = false;
                        cellAction.Clicked += (sender, e) => BookWorkShop (session);
                    } else if (session.BookingStatus == BookingStatuses.Booking) {

                        cellAction.Text = "Booking";
                        cellAction.IsDestructive = false;
                    } else {

                        cellAction.Text = "Canceling";
                        cellAction.IsDestructive = false;
                    }

                    cell.ContextActions.Add (cellAction);
                }

                cell.Tapped += (object sender, EventArgs e) => ShowSelectedWorkshop (session);
                section.Add (cell);
            }

            (page.WorkshopsListView.Root = new TableRoot ()).Add (section);
        }
        public void AddSkinButton(string name)
        {
            var cell = new TextLabelCell (){ Label = name };

            cell.HasArrow = false;
            cell.Tapped += (sender, e) => {

                App.Setting.SetSettingValue ("pageBackground", name);
                View.BackgroundColor = App.GetContentPageBackgroundColor();
            };
            cell.XAlign = TextAlignment.Center;

            section.Add (cell);
        }
        public void AddSkinButton(string name, Color color, Color textColor)
        {
            var cell = new TextLabelCell (){ Label = name, LabelColor = Color.White, BackgroundColor = color };

            cell.HasArrow = false;
            cell.Tapped += (sender, e) => {

                App.ApplyNavBarColor(name);
                App.Setting.SetSettingValue ("NavBarColor", name);
            };
            cell.XAlign = TextAlignment.Center;

            section.Add (cell);
        }
        public void AddInformation(string label, string text, Action action = null)
        {
            if (text == null)
                return;

            if (text.Equals (""))
                return;

            TextLabelCell cell = new TextLabelCell();
            cell.Label = label;
            cell.Text = text;

            if (cell.HasArrow = action != null) {

                cell.Tapped += (sender, e) => action();
            }

            section.Add(cell);
        }
		public override void UpdateData ()
		{
			base.UpdateData ();

			MySelfPage view = (MySelfPage)View;
			MySelf model = (MySelf)Model;

			view.BuildTable (Model.HelpsData);

			view.BuildSkinTable ();


			var signOutButton = new TextLabelCell () {
				HasArrow = false,
				Label = "Sign out",
				Text = null,
				XAlign = TextAlignment.Center,
				BackgroundColor = Color.Red,
				LabelColor = Color.White
			};

			signOutButton.Tapped += (sender, e) => SignOut();

			view.SelfTable.Root.Add (new TableSection {
				signOutButton
			});

			var aboutButton = new TextLabelCell () {
				HasArrow = true,
				Label = "About",
			};

			aboutButton.Tapped += (sender, e) => View.Navigation.PushAsync (new AboutPage ());

			view.SelfTable.Root.Add (new TableSection {
				aboutButton
			});

			model.RegStudent (model.Info.StudentId, (IsSuccess) => {
			});
		}
        public override void UpdateView()
        {
            base.UpdateView ();

            WorkShopSets shops = (WorkShopSets)Model;
            WorkShopSetsPage page = (WorkShopSetsPage)View;

            TableSection section = new TableSection ();

            foreach (WorkshopSet shop in shops.Sets) {

                TextLabelCell cell = new TextLabelCell {
                    Label = shop.Name,
                    Text = shop.Archived,
                };

                cell.Tapped += (sender, e) => ShowSectionsInWorkshopSet (shop);
                section.Add (cell);
            }

            (page.ShopSetsListView.Root = new TableRoot ()).Add (section);
        }
        public void BuildSkinList()
        {
            TableSection section = new TableSection ();

            Action <string, Action> AddSkinCell = (string text, Action func) => {

                TextLabelCell cell = new TextLabelCell();
                cell.Label = text;
                cell.XAlign = TextAlignment.Start;
                cell.HasArrow = true;

                cell.Tapped += (sender, e) => func();

                section.Add(cell);
            };

            AddSkinCell ("Color", () => View.Navigation.PushAsync((new SimpleSkinController()).View));
            AddSkinCell ("Backgrond", () => View.Navigation.PushAsync((new BackgroundSkinController()).View));
            //AddSkinCell ("Weather Skin", WeatherSkinSetting ());

            SkinTable.Root.Add (section);
        }
Example #11
0
        public void BuildSkinTable()
        {
            TableSection section = new TableSection ();

            var cell = new TextLabelCell (){ Label = "Change skin"};

            cell.HasArrow = true;
            cell.Tapped += (sender, e) => Navigation.PushAsync ((new UICustomController ()).View);

            section.Add (cell);

            SelfTable.Root.Add (section);
        }
Example #12
0
        public void PopSelectionEditor(string title, string []selectionsText, Action<string> selection)
        {
            TableView selectionTable = new TableView { Intent = TableIntent.Menu, BackgroundColor = new Color(1, 1, 1, 0) };
            TableSection mainSection = new TableSection ();

            for (int i = 0; i < selectionsText.Length; i++) {
                TextLabelCell cell = new TextLabelCell { Label = selectionsText [i] };

                if (selection != null) {
                    cell.Tapped += (object sender, EventArgs e) => {
                        selection (cell.Label);
                        Navigation.PopAsync();
                    };
                }

                mainSection.Add (cell);
            }

            (selectionTable.Root = new TableRoot ()).Add (mainSection);

            ContentPage popPage = new ContentPage {
                Title = title,
                Content = selectionTable,
                BackgroundColor =  new Color(1, 1, 1, 0.2)
            };

            Navigation.PushAsync (popPage);
        }