コード例 #1
0
        public ActionResult Index()
        {
            if (!IsAdmin())
            {
                return(Redirect("/"));
            }
            NewItemVM ni = new NewItemVM();

            ni.AllItems = _itemService.GetAll();
            return(View(ni));
        }
コード例 #2
0
        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));
        }
コード例 #3
0
        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();
            });
        }
コード例 #4
0
ファイル: NewItemWindow.xaml.cs プロジェクト: KohrAhr/XTask
        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
            //    }
            //);
        }
コード例 #5
0
 public BtnItemsTabbedCommand(NewItemVM itemsTabbedVM)
 {
     this.itemsTabbedVM = itemsTabbedVM;
 }
コード例 #6
0
ファイル: NewItemCommand.cs プロジェクト: daf101/ShoppingList
 public NewItemCommand(NewItemVM newItemVM)
 {
     viewModel = newItemVM;
 }