예제 #1
0
        private async System.Threading.Tasks.Task AddTerm()
        {
            var detailViewModel = new TermDetailViewModel();

            var detailPage = new TermDetailPage(true, new Term(0))
            {
                BindingContext = detailViewModel
            };

            await this.Navigation.PushAsync(detailPage, true);
        }
예제 #2
0
        public async void BtnEdit_Clicked(object sender, EventArgs e)
        {
            var button = (ImageButton)sender;
            var termId = Convert.ToInt32(button.CommandParameter.ToString());

            var detailViewModel = new TermDetailViewModel();

            var currentTerm = await App.Database.GetTermAsync(termId);

            var page = new TermDetailPage(false, currentTerm)
            {
                BindingContext = detailViewModel
            };

            await this.Navigation.PushAsync(page, true);
        }