/// <summary> /// Initializes a new instance of the <see cref="ProductVM"/> class from the model. /// </summary> /// <param name="entity">The model.</param> /// <param name="access"></param> /// <param name="dataService"></param> public RootVM(Root entity, AccessType access, RootDataService dataService) : base(access) { InitializeData(dataService); _model = entity; if(entity.ProductDefection != null) CurrentProductDefection = new ProductDefectionVM(entity.ProductDefection, Access, ProductDefectionDataService, RelationDirection.Straight); FishbonesVM = new RootFishbonesVM(this, CurrentProductDefection, Access); }
public override void Save(object param) { RootDataService.AttachModel(_model); _model = RootDataService.GetSingle(_model.Id); OnPropertyChanged("ModifiedBy");OnPropertyChanged("ModifiedDate");Mode = ModificationStatus.Saved; }
private void FixupRoot(Root previousValue) { if (previousValue != null && previousValue.FishboneNodes.Contains(this)) { previousValue.FishboneNodes.Remove(this); } if (Root != null) { if (!Root.FishboneNodes.Contains(this)) { Root.FishboneNodes.Add(this); } } }