ObjectStatus and IsDirty binding

ObjectStatus and IsDirty binding

Old forum URL: forums.lhotka.net/forums/t/8074.aspx


Devman posted on Wednesday, December 02, 2009

Hi,
I have a CslaDataProvider and ObjectStatus declared in xaml in the resources section of my custom window class. In the constructor i set the window's datacontext to the CslaDataProvider.That way i can bind properties of the window to data retrieved.

I want to be able to bind a property on the window to the ObjectStatus IsDirty property but have not figured out how to do this successfully.

I can bind to properties of the objectstatus if i add child controls such as a checkbox to the window as shown in the project tracker but this is not what i required.

Any assistance would be greatly appreciated

Regards,
David

RockfordLhotka replied on Wednesday, December 02, 2009

You want to bind properties of the Window control itself?

I don't know how to do that either. Since the resource is inside the Window I have not seen a way to bind to a "contained object", only to something higher in the visual tree...

Devman replied on Wednesday, December 02, 2009

RockfordLhotka:

You want to bind properties of the Window control itself?

I don't know how to do that either. Since the resource is inside the Window I have not seen a way to bind to a "contained object", only to something higher in the visual tree...



In a nutshell yes!  I had this problem initially binding window properties to the CslaDataProvider. This was solved by setting the windows DataContext property in the window contructor.  I wasn't fully happy with that solution either as it involved code-behind.... This one's got me stumped!! :-\

Copyright (c) Marimer LLC