public TestModel2Page(TestModel2 model) { InitializeComponent(); var viewModel = DependencyService.Get <TestModel2ViewModel>(); viewModel.Model = model; BindingContext = viewModel; }
private async void CreateDBRecord2() { if (string.IsNullOrEmpty(ModelName)) { Message = "Enter a name for the model!"; return; } var newDate = DateTime.Now.AddDays(_record2NumberCounter); var testRecord = new TestModel2 { Name = ModelName, Number = _record2NumberCounter, Date = newDate }; _record2NumberCounter++; await SaveRecordAsync(testRecord).ConfigureAwait(false); }
private void EditModel(TestModel2 model) { var page = new TestModel2Page(model); App.Current.MainPage.Navigation.PushAsync(page); }