public override void ButtonContinueClick() { Page3ViewModel vm = new Page3ViewModel(); Page3 p3 = new Page3(); p3.DataContext = vm; Navigator.NavigationService.Navigate(p3); }
public Page3() { InitializeComponent(); // set the BindingContext Property of the Page3 to a new instance of Page3ViewModel. // i.e. set the datasource for all the objects in the Page3 View to the Page3ViewModel. BindingContext = new Page3ViewModel(); }
public Page3Page() { InitializeComponent(); BindingContext = new Page3ViewModel(Navigation); }
public async Task <OfferRenderViewModel> FillViewModel(Guid Id, OfferRenderViewModel offerrender) { ICollection <EstimateConnects> Connect; ICollection <Offers> offers; using (var context = new DataBaseContext()) { offers = context.Offer .Include(offermodel => offermodel.Estimate) .Include(users => users.CreatedBy) .Include(users => users.UpdatedBy) .ToList(); Connect = context.EstimateConnects .Include(line => line.EstimateLines) .ToList(); } Offers offer = await OfferRepository.FindAsync(Id); var dboffer = offers.FirstOrDefault(x => x.Id.Equals(Id)); var estimate = await EstimateRepository.FindAsync(dboffer.Estimate.Id); var connectlines = Connect.Where(x => x.Estimate.Id.Equals(dboffer.Estimate.Id)).ToList(); float exclbtw = 0; float btw = 0; float totalcost = 0; foreach (var item in connectlines) { exclbtw = exclbtw + item.EstimateLines.TotalCost; } btw = exclbtw / 100 * 21; totalcost = exclbtw + btw; #region var Page3ViewModel = new Page3ViewModel { CustomerZipCode = "7957EJ", CustomerStreet = "Oosterakker 21", CustomerName = "K.Broekstra", CustomerCompany = "Broekstra B.V.", CustomerEmail = "*****@*****.**", DocumentVersion = offer.DocumentVersion }; var FrontPageViewModel = new FrontPageViewModel { CreatedBy = dboffer.CreatedBy.FirstName + " " + dboffer.CreatedBy.LastName, LastUpdated = offer.LastUpdatedAt.ToString(), ProjectName = offer.ProjectName, DocumentCode = offer.DocumentCode, CustomerZipCode = "7957EJ", CustomerStreet = "Oosterakker 21", CustomerName = "K.Broekstra", CustomerCompany = "Broekstra B.V.", CustomerCountry = "The Netherlands" }; var EstimateTablePage = new EstimateTablePage { EstimateConnects = connectlines, BTW = btw.ToString("#,##0.00"), ExclBtw = exclbtw.ToString("#,##0.00"), Totaal = totalcost.ToString("#,##0.00") }; offerrender.EstimateTablePage = EstimateTablePage; offerrender.FrontPage = FrontPageViewModel; offerrender.Page3 = Page3ViewModel; #endregion return(offerrender); }
public Page1() { InitializeComponent(); viewmodel = new Page3ViewModel(); BindingContext = viewmodel; }