Ejemplo n.º 1
0
        public RegisterWorkDayPage()
        {
            InitializeComponent();

            BindingContext = viewModel = new RegisterWorkDayViewModel();
            AzureDataStore = new AzureDataStore();
        }
        public SearchWorkDaysPage()
        {
            InitializeComponent();

            AzureDataStore = new AzureDataStore();
            BindingContext = viewModel = new SearchWorkDaysViewModel();
        }
Ejemplo n.º 3
0
        private void SubscribeForEvents()
        {
            MessagingCenter.Subscribe <NewExpensePage, Expense>(this, "AddExpense", async(obj, expense) =>
            {
                var newExpense = expense as Expense;
                Expenses.Add(newExpense);
                await AzureDataStore.AddItemAsync(newExpense);
            });

            MessagingCenter.Subscribe <FamilyAllExpensesPage, Expense>(this, "AddExpense2", async(obj, expense) =>
            {
                var newExpense = expense as Expense;
                Expenses.Insert(0, newExpense);
                await AzureDataStore.AddItemAsync(newExpense);
            });


            MessagingCenter.Subscribe <ExpenseService, UpdateStatusMessage>(this, "UpdateStatusMessage", (obj, args) =>
            {
                UpdateStatusMessage updateStatusMessage = args as UpdateStatusMessage;
                if (updateStatusMessage != null)
                {
                    if (updateStatusMessage.UpdateStatus == Enums.UpdateStatus.Completed)
                    {
                    }
                    StatusMessage = updateStatusMessage;
                }
            });
        }
Ejemplo n.º 4
0
 public WorkDaysViewModel()
 {
     Title               = "WorkDays";
     WorkDays            = new ObservableCollection <WorkDay>();
     AzureDataStore      = new AzureDataStore();
     LoadWorkDaysCommand = new Command(async() => await ExecuteLoadWorkDaysCommand());
 }
        public RegisterWorkDayViewModel()
        {
            Title                = "New WorkDay";
            WorkDay              = new WorkDay();
            _currentDate         = new DateTime();
            _currentDate         = DateTime.Now;
            _startDate           = _currentDate;
            _endDate             = _currentDate;
            AzureDataStore       = new AzureDataStore();
            CreateWorkDayCommand = new Command(async() => await ExecuteCreateWorkDayCommand());

            MessagingCenter.Subscribe <RegisterWorkDayPage>(this, "StartTimeNowButtonClicked", (sender) =>
            {
                StartTime = DateTime.Now.TimeOfDay;
            });

            MessagingCenter.Subscribe <RegisterWorkDayPage>(this, "EndTimeNowButtonClicked", (sender) =>
            {
                EndTime = DateTime.Now.TimeOfDay;
            });
        }