Пример #1
0
        public void Setup()
        {
            IDataStore <Product> productsDataStore = new ProductsDataStore();

            productsViewModel = new ProductsViewModel(productsDataStore);

            unitsDataStore = new UnitsDataStore();
            unitsViewModel = new UnitsViewModel(UnitBase.Weight, unitsDataStore);
        }
Пример #2
0
        public UnitsPage()
        {
            InitializeComponent();

            var vm = new UnitsViewModel();

            vm.Navigation = Navigation;

            BindingContext = vm;
        }
Пример #3
0
        public ActionResult Create(UnitsViewModel model, string redirectUrl)
        {
            if (!ModelState.IsValid)
            {
                return(View(model));
            }
            Units units = model.Map <Units>();

            Units.Create(units);

            return(RedirectToLocal(redirectUrl));
        }
Пример #4
0
 public VehicleChronologicalParameterViewModel(VehicleChronologicalParameter model)
 {
     if (model == null)
     {
         throw new ArgumentNullException("model");
     }
     this.model = model;
     foreach (var pair in model.Values)
     {
         DataForGraph.Add(pair);
     }
     units = new UnitsViewModel(
         AnalyticRuleStatisticsMeasureUnitsResolver.Resolve(model.Type));
 }
Пример #5
0
        public ActionResult Edit(UnitsViewModel model, string redirectUrl)
        {
            var unit = Units.GetById(model.UnitsId);

            if (unit != null)
            {
                unit.Name        = model.Name;
                unit.Description = model.Description;

                Units.Update(unit);
            }

            return(RedirectToLocal(redirectUrl));
        }
Пример #6
0
        private void OnViewAttached(object sender, ViewModelEventArgs e)
        {
            UnitsViewModel viewModel = e.ViewModel as UnitsViewModel;

            if (viewModel == null)
            {
                return;
            }
            Type unitType = viewModel.UnitType;
            IContextMenuIntegration integration;

            if (_collection.TryGetValue(unitType, out integration))
            {
                integration.Integrate(viewModel);
            }
        }
Пример #7
0
        public PsaParameterDataViewModel(PsaParameterData model)
        {
            if (model == null)
            {
                throw new ArgumentNullException("model");
            }
            this.model = model;
            type       = new PsaParameterTypeViewModel(model.Type);

            foreach (string value in model.Values)
            {
                double d;
                double.TryParse(value, NumberStyles.Float,
                                CultureInfo.InvariantCulture, out d);
                values.Add(d);
            }
            units = new UnitsViewModel(model.Units);
        }
Пример #8
0
 public UnitsPage()
 {
     InitializeComponent();
     BindingContext = new UnitsViewModel();
 }
Пример #9
0
        public ActionResult Edit(int id)
        {
            UnitsViewModel model = Units.GetById(id).Map <UnitsViewModel>();

            return(View(model));
        }
Пример #10
0
 public UnitsPage()
 {
     _units      = new UnitsViewModel();
     DataContext = _units;
     InitializeComponent();
 }
Пример #11
0
 public UnitsPage(UnitBase unitBase)
 {
     InitializeComponent();
     BindingContext = viewModel = new UnitsViewModel(unitBase);
 }