This thread looks to be a little on the old side and therefore may no longer be relevant. Please see if there is a newer thread on the subject and ensure you're using the most recent build of any software if your question regards a particular product.
This thread has been locked and is no longer accepting new posts, if you have a question regarding this topic please email us at support@mindscape.co.nz
|
Hello, I have full version of property grid. I have simple class with few properties where most of them are just getters and setters. For displaying in PropertyGrid, I'm using MultipleObjectWrapper so I can detect property changes (however, there is only one object in MOW)*. Now, when I change some property outside PropertyGrid application blocks for a 2-3 seconds. If object is not shown in PropertyGrid, no blocking happens. System.Windows.Data Warning: 4 : Cannot find source for binding with reference 'RelativeSource FindAncestor, AncestorType='Mindscape.WpfPropertyGrid.PropertyGrid', AncestorLevel='1''. BindingExpression:Path=SelectedGridItem; DataItem=null; target element is 'TreeListViewItem' (Name=''); target property is 'NoTarget' (type 'Object')
*It would be nice to have event on changing/ed property in PropretyGrid itself, so for single object wouldn't be need for MultipleObjectWrapper. |
|
|
We made some performance improvements post-RTM. If you're not already using the nightly build, could you download it and try that? If you are already using the nightly, or it doesn't solve your problem, could you post the code for the object you're binding to? Thanks! But you shouldn't need to use a MOW to monitor for property change events on a single object: just use the object's INotifyPropertyChanged/Changing implementation and subscribe to its PropertyChanged/Changing event directly. (That's all the MOW is doing!) |
|
|
Thank you for your reply. Interesting, how MOW detects changes if my class doesn't implement INotifyPropertyChanged interface? Actualy, I did use MOW in onrder to avoid implementing that interface and raising event in every property :) |
|
|
Hmm, I misspoke a bit there. You're right, the MOW *does* detect changes even on non-notifying objects -- when those changes are made through the property grid. It can do this because the grid binds to the MOW (rather than directly to the wrapped object(s)); therefore all property accesses go through the MOW, which can intercept and raise events for property sets. But for changes made *outside* the property grid, as in your current case, the MOW *does* rely on the wrapped object raising PropertyChanged. So if your class doesn't implement INotifyPropertyChanged then I'm surprised the grid is doing anything at all when a property is changed from outside the grid *grin*! Anyway, apologies for the confusion! |
|
|
Problem is solved when I removed MOW. I implemented INotifyPropertyChanged interface, added object directly to PropretyGrid and used event from from object. It works exelent now. I hope that this thread will be helpful to you in further development of PropertyGrid, too. |
|