Hello
I have own class which implements ICustomTypeDescriptor interface.
I`ve noticed that function GetProperties(Attribute[] attrbiutes) is called in Thread.
I dont know why many times (for example: when first time set the SelectedObject property in PropertyGrid is called 1, second time 2, next time 4, next 5...etc. In addition in different threads - sometimes in main Thread)
It causes error (calling thread cannot access to other thread) when I raise NotifyPropertyChanged event, because I have property editor which is UIElement and he is binded to my object.
Here is example, what am I doing
I have object with many properties, when I change one property it causes automatic change in other property.Sometimes (when GetProperties was called in thread) I get error that calling thread cannot access to other thread)
Is bug, or I try do something wrong?
[Modified at 03/17/2009 02:14 AM]
I have own class which implements ICustomTypeDescriptor interface.
I`ve noticed that function GetProperties(Attribute[] attrbiutes) is called in Thread.
I dont know why many times (for example: when first time set the SelectedObject property in PropertyGrid is called 1, second time 2, next time 4, next 5...etc. In addition in different threads - sometimes in main Thread)
It causes error (calling thread cannot access to other thread) when I raise NotifyPropertyChanged event, because I have property editor which is UIElement and he is binded to my object.
Here is example, what am I doing
I have object with many properties, when I change one property it causes automatic change in other property.
IPropertyDataAccessor accessor = VisualTreeHelperExtended.GetAncestor(channelsContainer, typeof(IPropertyDataAccessor)) as IPropertyDataAccessor;
accessor.Value = myList; - I set my first property, but it causes that in my object I must refresh other property - so I call NotifyPropertyChanged
myObject.NotifyPropertyChanged("MySecondProperty"); (NotifyPropertyChanged is my method when I raise NotifyPropertyChangedHandler)
Is bug, or I try do something wrong?
[Modified at 03/17/2009 02:14 AM]