public PackPropertyItemModel(PickProperty p) // loading item { PropertyDef = p; ActiveProperty = CustomProperties.FirstOrDefault(x => (x as PropertyItemViewModel).Name == PropertyDef.Name) as PropertyItemViewModel; RemoveCommand = new RelayCommand(Remove); Messenger.Default.Register <CustomPropertyChangedMessage>(this, action => CustomPropertyChanged(action)); }
public PackagePropertyModel(PackagePropertyModel p, IdeCollection <IdeBaseItem> src) : base(src) // copy item { PropertyDef = new PickProperty(); ActiveProperty = p.ActiveProperty; PropertyDef.Value = p.PropertyDef.Value; Messenger.Default.Register <CustomPropertyChangedMessage>(this, action => CustomPropertyChanged(action)); }
public PackPropertyItemModel() // new item { PropertyDef = new PickProperty(); ActiveProperty = CustomProperties.First() as PropertyItemViewModel; RemoveCommand = new RelayCommand(Remove); Messenger.Default.Register <CustomPropertyChangedMessage>(this, action => CustomPropertyChanged(action)); }
public PackPropertyItemModel(PackPropertyItemModel p) // copy item { PropertyDef = new PickProperty(); ActiveProperty = p.ActiveProperty; PropertyDef.Value = p.PropertyDef.Value; RemoveCommand = new RelayCommand(Remove); Messenger.Default.Register <CustomPropertyChangedMessage>(this, action => CustomPropertyChanged(action)); }
public PackagePropertyModel(PickProperty p, IdeCollection <IdeBaseItem> src) : base(src) // loading item { if (p is NamePickProperty) { _def = new PickProperty { Property = PropertyTabViewModel.NameProperty._property, Value = p.Value }; ActiveProperty = PropertyTabViewModel.NameProperty; } else { _def = (PickProperty)p; ActiveProperty = (PropertyItemModel)CustomProperties.FirstOrDefault(x => ((PropertyItemModel)x)._property == _def.Property); } Messenger.Default.Register <CustomPropertyChangedMessage>(this, action => CustomPropertyChanged(action)); }
public PackagePropertyModel(PickProperty p, IdeCollection <IdeBaseItem> src) : base(src) // loading item { PropertyDef = p; ActiveProperty = (PropertyItemModel)CustomProperties.FirstOrDefault(x => ((PropertyItemModel)x)._property == PropertyDef.Property); Messenger.Default.Register <CustomPropertyChangedMessage>(this, action => CustomPropertyChanged(action)); }
public PackagePropertyModel(IdeCollection <IdeBaseItem> src) : base(src) // new item { PropertyDef = new PickProperty(); ActiveProperty = (PropertyItemModel)CustomProperties.First(); Messenger.Default.Register <CustomPropertyChangedMessage>(this, action => CustomPropertyChanged(action)); }