public void Setup() { IDataStore <Product> productsDataStore = new ProductsDataStore(); productsViewModel = new ProductsViewModel(productsDataStore); unitsDataStore = new UnitsDataStore(); unitsViewModel = new UnitsViewModel(UnitBase.Weight, unitsDataStore); }
public UnitsPage() { InitializeComponent(); var vm = new UnitsViewModel(); vm.Navigation = Navigation; BindingContext = vm; }
public ActionResult Create(UnitsViewModel model, string redirectUrl) { if (!ModelState.IsValid) { return(View(model)); } Units units = model.Map <Units>(); Units.Create(units); return(RedirectToLocal(redirectUrl)); }
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)); }
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)); }
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); } }
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); }
public UnitsPage() { InitializeComponent(); BindingContext = new UnitsViewModel(); }
public ActionResult Edit(int id) { UnitsViewModel model = Units.GetById(id).Map <UnitsViewModel>(); return(View(model)); }
public UnitsPage() { _units = new UnitsViewModel(); DataContext = _units; InitializeComponent(); }
public UnitsPage(UnitBase unitBase) { InitializeComponent(); BindingContext = viewModel = new UnitsViewModel(unitBase); }