public EditSales(Model.Sales Selectedsales) { InitializeComponent(); salesCRUD = new SalesCRUD(); productCRUD = new ProductCRUD(); SelSales = Selectedsales; var productlist = productCRUD.GetProductNameList(); picker_product.ItemsSource = productlist; BindingContext = SelSales; }
//============================================= // Reference A3: externally sourced algorithm // Purpose: get Product list in picker in sales tab // Date: 22 Sep 2018 // Source: Microsoft docs // Author: unknown // url: https://docs.microsoft.com/en-us/xamarin/xamarin-forms/user-interface/picker/populating-itemssource // Adaptation required: changed variable name // public Sales() { InitializeComponent(); productCRUD = new ProductCRUD(); products = new Products(); sales = new Model.Sales(); salesCRUD = new SalesCRUD(); var productlist = productCRUD.GetProductNameList(); picker_product.ItemsSource = productlist; }