//----------------------------------------------------------------------- public void WrappedItemPropertyChanged(object sender, PropertyChangedEventArgs args) { if (args.PropertyName == "Description") { Future.Call(() => { RaisePropertyChangedEvent("Description"); }, 100, this); } else if (args.PropertyName == "Name") { Name = ""; if (Parent != null) { Name = "[" + Parent.Children.IndexOf(this) + "] "; } if (WrappedItem != null) { Name += WrappedItem.Name; } } else if (args.PropertyName == "ToolTip") { ToolTip = WrappedItem.ToolTip; } else if (args.PropertyName == "TextColour") { TextColour = WrappedItem.TextColour; } }
//----------------------------------------------------------------------- public void WrappedItemPropertyChanged(object sender, PropertyChangedEventArgs args) { if (args.PropertyName == "Description") { Future.Call(() => { RaisePropertyChangedEvent("Description"); }, 100, this); } }
//----------------------------------------------------------------------- public ReferenceItem(DataDefinition definition, UndoRedoManager undoRedo) : base(definition, undoRedo) { SelectedDefinition = (Tuple <string, string>)(definition as ReferenceDefinition).ItemsSource.GetItemAt(0); PropertyChanged += (e, args) => { if (args.PropertyName == "DataModel") { if (WrappedItem != null) { WrappedItem.DataModel = DataModel; } } else if (args.PropertyName == "Parent") { if (WrappedItem != null) { Future.Call(() => { try { Name = Parent is CollectionChildItem && !(((Parent as CollectionChildItem).ParentCollection.Definition as CollectionDefinition)?.ChildrenAreUnique ?? false) ? WrappedItem.Name : Definition.Name + " (" + WrappedItem.Name + ")"; } catch (Exception) { } }, 10); } } }; }
//----------------------------------------------------------------------- public override void ChildPropertyChanged(object sender, PropertyChangedEventArgs args) { base.ChildPropertyChanged(sender, args); if (args.PropertyName == "Description") { Future.Call(() => { RaisePropertyChangedEvent("Description"); }, 100, this); } }