public ActionResult Index() { if (!IsAdmin()) { return(Redirect("/")); } NewItemVM ni = new NewItemVM(); ni.AllItems = _itemService.GetAll(); return(View(ni)); }
public ActionResult Edit(Guid id) { if (!IsAdmin()) { return(Redirect("/")); } NewItemVM ni = new NewItemVM(); ni.AllItems = _itemService.GetAll(); ni.Item = _itemMapper.ConvertToVM(_itemService.FindById(id), 0, "", new Guid()); return(View("Index", ni)); }
public NewItemPage() { InitializeComponent(); viewModel = new NewItemVM(); BindingContext = viewModel; // When Below Message Recieved, close page. MessagingCenter.Subscribe <App>((App)Application.Current, Constants.CLOSE_NEW_ITEM_PAGE, (sender) => { // Do Stuff Navigation.PopPopupAsync(); }); }
public NewItemWindow() { InitializeComponent(); ucTop.SetButtons( new ItemFormActionBar.AvailableButtons[] { ItemFormActionBar.AvailableButtons.abNew, ItemFormActionBar.AvailableButtons.abCancel } ); DataContext = new NewItemVM(); ((NewItemVM)DataContext).CloseAsOK += CloseWindowAsOK; //ucTop.SetButtons( // new ItemFormActionBar.AvailableButtons[] // { // ItemFormActionBar.AvailableButtons.abNew, // ItemFormActionBar.AvailableButtons.abCancel // } //); }
public BtnItemsTabbedCommand(NewItemVM itemsTabbedVM) { this.itemsTabbedVM = itemsTabbedVM; }
public NewItemCommand(NewItemVM newItemVM) { viewModel = newItemVM; }