Пример #1
0
        public CalendarPage()
        {
            vm = new CalendarVM();
            this.BindingContext = vm;

            System.Diagnostics.Debug.WriteLine(vm.Workout);

            InitializeComponent();

            vm.Date = System.DateTime.Now;

            // set the edit button to push to the EditDayPage
            EditBtn.Clicked += async(sender, e) =>
            {
                await Navigation.PushAsync(new EditDayPage(vm));
            };
        }
Пример #2
0
        public StartPage()
        {
            // setup the page with the data that we need
            vm              = new CalendarVM();
            vm.Date         = DateTime.Now;
            stopwatch       = new Stopwatch();
            tbItem          = new ToolbarItem();
            tbItem.Text     = "Save";
            tbItem.Clicked += saveButtonOnClick;
            vm.Workout      = database.GetWorkouts(vm.Date);

            this.BindingContext = vm;


            InitializeComponent();

            // if there is not workout.  Display a message
            if (vm.Workout.Count == 0)
            {
                System.Diagnostics.Debug.WriteLine("No workout today");
                Label l = new Label
                {
                    Text              = "No workout scheduled today!",
                    VerticalOptions   = LayoutOptions.CenterAndExpand,
                    HorizontalOptions = LayoutOptions.CenterAndExpand,
                    FontSize          = Device.GetNamedSize(NamedSize.Large, typeof(Label))
                };
                MainContent.Children.Add(l);
            }
            else
            {
                startStopButton.IsVisible = true;
                startStopButton.IsEnabled = true;
                startStopButton.Clicked  += startStopButtonOnClick;
            }
        }
Пример #3
0
 public EditDayPage(CalendarVM vm)
 {
     this.BindingContext = vm;
     InitializeComponent();
 }