Ejemplo n.º 1
0
        public AddContactPage()
        {
            InitializeComponent();
            _viewModel = App.ViewModelLocator.AddNewItemViewModel;

            BindingContext = _viewModel;
        }
Ejemplo n.º 2
0
 public AddNewItemType(RootViewModel rootViewModel)
 {
     InitializeComponent();
     BindingContext = addNewItemViewModel = new AddNewItemViewModel();
     addNewItemViewModel.navigation    = Navigation;
     addNewItemViewModel.rootViewModel = rootViewModel;
 }
Ejemplo n.º 3
0
        public AddNewItemPage(ListViewModel viewModel)
        {
            var listStore   = new SQLiteListStore(DependencyService.Get <ISQLiteDb>());
            var pageService = new PageService();

            BindingContext = new AddNewItemViewModel(viewModel ?? new ListViewModel(), listStore, pageService);
            InitializeComponent();
        }
        public IActionResult Add([FromBody] AddNewItemViewModel newItem)
        {
            ViewModelToDomainModelMapper mapper = new ViewModelToDomainModelMapper();

            _service.AddItem(mapper.MapToModel(newItem));

            return(Ok());
        }
Ejemplo n.º 5
0
        private AddNewItemViewModel SetupViewModel(SideEffect sideEffect = null)
        {
            if (sideEffect == null)
            {
                sideEffect = new SideEffect();
            }

            var addNewItemVM = new AddNewItemViewModel();

            addNewItemVM.ItemKlass  = sideEffect.KlassName;
            addNewItemVM.Controller = GetType().Name.ToString().Replace("Controller", "");
            addNewItemVM.Name       = sideEffect.Name;
            addNewItemVM.ItemId     = sideEffect.ID;
            addNewItemVM.Tab        = "side-effects";
            return(addNewItemVM);
        }
Ejemplo n.º 6
0
        private AddNewItemViewModel SetupViewModel(Drug drug = null)
        {
            if (drug == null)
            {
                drug = new Drug();
            }

            var addNewItemVM = new AddNewItemViewModel();

            addNewItemVM.ItemKlass  = drug.KlassName;
            addNewItemVM.Controller = GetType().Name.ToString().Replace("Controller", "");
            addNewItemVM.Name       = drug.Name;
            addNewItemVM.ItemId     = drug.ID;
            addNewItemVM.Tab        = "drugs";
            return(addNewItemVM);
        }
        private AddNewItemViewModel SetupViewModel(DiagnosisCategory diagnosisCategory = null)
        {
            if (diagnosisCategory == null)
            {
                diagnosisCategory = new DiagnosisCategory();
            }

            var addNewItemVM = new AddNewItemViewModel();

            addNewItemVM.ItemKlass  = diagnosisCategory.KlassName;
            addNewItemVM.Controller = GetType().Name.ToString().Replace("Controller", "");
            addNewItemVM.Name       = diagnosisCategory.CategoryName;
            addNewItemVM.ItemId     = diagnosisCategory.ID;
            addNewItemVM.Tab        = "diagnosis-categories";
            return(addNewItemVM);
        }