// GET: Stores/Details/5 public async Task <IActionResult> Details(int?id) { // create a new view model instance StoreDetailViewModel sdvm = new StoreDetailViewModel(); // find any flags for the store var flag = await _context.StoreFlag.Include("Flag").Where(f => f.StoreId == id).SingleOrDefaultAsync(); // attach flag info to the view model sdvm.Flag1 = flag; if (id == null) { return(NotFound()); } var store = await _context.Store .Include(s => s.SalesRep) .Include(s => s.State) .Include(s => s.Status) .SingleOrDefaultAsync(m => m.StoreId == id); if (store == null) { return(NotFound()); } // attach the store to the view model sdvm.Store = store; // return the view model return(View(sdvm)); }
public StoreDetailPage(object x) { InitializeComponent(); if (x != null) { ViewModel = new StoreDetailViewModel(); ViewModel.KeyValue = (KeyValuePair <string, Store>)x; this.BindingContext = ViewModel; } }
public ProductDetails(string Name, string Image, string Description, string Barcode) { InitializeComponent(); ProdName.Text = Name; ProdImage.Source = new UriImageSource() { Uri = new Uri(Image) }; ProdDescription.Text = Description; ProductListModel productListModel = new ProductListModel(); productListModel.Barcode = Barcode; BindingContext = new StoreDetailViewModel(productListModel); }
public StoreDetailPage() { InitializeComponent(); BindingContext = new StoreDetailViewModel(); }
public StoreDetailPage(StoreDetailViewModel viewModel) { InitializeComponent(); BindingContext = viewModel; }
public StoreDetail(StoreDetailViewModel viewModel) { InitializeComponent(); BindingContext = this.detailViewModel = viewModel; }