예제 #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 TermDetailView(Term term = null)
        {
            Term = term;

            InitializeComponent();
            BindingContext = new TermDetailViewModel(Navigation)
            {
                TermId        = term.TermId,
                TermStartDate = term.TermStartDate,
                TermEndDate   = term.TermEndDate,
                TermTitle     = term.TermTitle
            };
        }
예제 #3
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);
        }
예제 #4
0
 public TermDetailPage(Term term)
 {
     InitializeComponent();
     _term          = term;
     BindingContext = new TermDetailViewModel(term);
 }