コード例 #1
0
 //-----------------------------------------------------------------------
 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;
     }
 }
コード例 #2
0
 //-----------------------------------------------------------------------
 public void WrappedItemPropertyChanged(object sender, PropertyChangedEventArgs args)
 {
     if (args.PropertyName == "Description")
     {
         Future.Call(() => { RaisePropertyChangedEvent("Description"); }, 100, this);
     }
 }
コード例 #3
0
        //-----------------------------------------------------------------------
        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);
                    }
                }
            };
        }
コード例 #4
0
        //-----------------------------------------------------------------------
        public override void ChildPropertyChanged(object sender, PropertyChangedEventArgs args)
        {
            base.ChildPropertyChanged(sender, args);

            if (args.PropertyName == "Description")
            {
                Future.Call(() => { RaisePropertyChangedEvent("Description"); }, 100, this);
            }
        }