Esempio n. 1
0
        private async void addToolbarItem_Click(object sender, EventArgs e)
        {
            var editViewModel = new EntryEditViewModel(null, viewModel.IsNotGeneral ? 0 : 1, viewModel.ForUser, viewModel.EntryDate);

            editViewModel.EntrySaved += (object sender2, EventArgs e2) =>
            {
                viewModel.Entries.Add(new EntryItem()
                {
                    Entry = sender2 as DataLayer.Models.Entry
                });
            };
            var page = new EntryEditPage();

            page.BindingContext = editViewModel;
            await((MainPage)App.Current.MainPage).NavigateTo(page, true);
        }
Esempio n. 2
0
        protected async void Handle_ItemTapped(object sender, EventArgs e)
        {
            if (entryItem == null)
            {
                return;
            }
            var editViewModel = new EntryEditViewModel(entryItem.Entry, entryItem.Entry.EntryTypeValue, ForUser, entryItem.Entry.EntryDateValue);

            editViewModel.EntrySaved += (object sender2, EventArgs e2) =>
            {
                entryItem.ResetStatuses();
                populateControls();
            };
            var page = new EntryEditPage();

            page.BindingContext = editViewModel;
            await((MainPage)App.Current.MainPage).NavigateTo(page, true);
            //Deselect Item
            // ((ListView)sender).SelectedItem = null;
        }