Hi Greg,

I think there may be a few ways to assist you with your project..

Paul Stovell's Bindable Linq propagates changes from collections in memory
to the UI..
http://www.paulstovell.com
http://bindablelinq.codeplex.com/

Also, Sacha Barber wrote an article (a very long one) on Chained Property
Observer.. Sounds like something that may assist you ..
http://www.codeproject.com/KB/cs/ChainedObserve.aspx

Then there is also RX (Reactive Extensions), which I think may also be able
to help you.. I remember reading an article where someone did something
similar to what you're trying to do using RX. I couldn't find the article to
assist you however..  Maybe this article may give you a start..
http://shujaatsiddiqi.blogspot.com/2011/02/wpf-joining-rxs-iobservables-using-linq.html
Larger RX intro and series of articles..
http://leecampbell.blogspot.com/2010/08/reactive-extensions-for-net.html

HTH
Grant

On Mon, May 2, 2011 at 7:42 PM, Michael Minutillo <
michael.minuti...@gmail.com> wrote:

> Whoops. And there was a typo in that one. This one runs :)
>
>
>
> On Mon, May 2, 2011 at 5:41 PM, Michael Minutillo <
> michael.minuti...@gmail.com> wrote:
>
>> How much do you dislike reflection? The attached is a quick LINQPad mockup
>> of a technique I have used in the past. A "real" implementation would need
>> to be more careful (there is no error handling, no real collection support
>> and circular references will result in stack overflows) but the basics are
>> here.
>>
>> Essentially this is a new component that is responsible for listening to
>> INotifyPropertyChanged events. When you bind it to a new object it will
>> search through it's properties (via reflection) and try to bind to them
>> recursively as well. The nice thing is that because it also implements
>> INotifyPropertyChanged and exposed a single boolean value you can bind
>> things (like Button enabledness/visibility) to it directly.
>>
>> It's a cheap trick but it works ;)
>>
>>
>>
>> On Mon, May 2, 2011 at 3:19 PM, Greg Keogh <g...@mira.net> wrote:
>>
>>> Folks, in dialog-like screens with OK/Cancel buttons and a bound data
>>> object I like to implement and listen to INotifyPropertyChanged on the data
>>> object so I know the screen is “dirty” and I enable the OK button.
>>>
>>>
>>>
>>> When the data bound object is composed from a nest of other objects, it
>>> becomes impractical to pass changed events up through the levels of objects
>>> to the top. It can be done by manually sending the event up through
>>> child-parent objects, but the code to create this sort of “event bubbling”
>>> is verbose and tedious.
>>>
>>>
>>>
>>> Is there some trick that I’m not aware of for creating mock property
>>> changed “event bubbling” in my own nested objects?
>>>
>>>
>>>
>>> Greg
>>>
>>>
>>>
>>
>>
>

Reply via email to