コード例 #1
0
        // 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));
        }
コード例 #2
0
 public StoreDetailPage(object x)
 {
     InitializeComponent();
     if (x != null)
     {
         ViewModel           = new StoreDetailViewModel();
         ViewModel.KeyValue  = (KeyValuePair <string, Store>)x;
         this.BindingContext = ViewModel;
     }
 }
コード例 #3
0
        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);
        }
コード例 #4
0
 public StoreDetailPage()
 {
     InitializeComponent();
     BindingContext = new StoreDetailViewModel();
 }
コード例 #5
0
 public StoreDetailPage(StoreDetailViewModel viewModel)
 {
     InitializeComponent();
     BindingContext = viewModel;
 }
コード例 #6
0
 public StoreDetail(StoreDetailViewModel viewModel)
 {
     InitializeComponent();
     BindingContext = this.detailViewModel = viewModel;
 }