Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
1233
Bind DataRecordPresenter Record
posted

I have a hieracrhical data structure where children records are of different types.  I am binding the ActiveDataItem, but that only works for the parent selection.  When selecting a child, the activedataitem binds null, and nothing captures the child selection.  I want to bind both the parent and the child to properties in my datacontext.

Currently, I am using RecordActivated event to manually set one-way binding.

if (e.Record != null && e.Record.ParentDataRecord != null)

container.ParentProperty = e.Record.ParentDataRecord.DataItem as ParentPropertyType;

else

container.ParentProperty = null;

 

var dataRecord = e.Record as DataRecord;

if (dataRecord != null)

container.Property = dataRecord.DataItem as PropertyType;

else

container.Property =  null;

 

 

Is there a way that I can bind the DataRecordPresenter.Record.ParentDataRecord to my datacontext?

 

Parents
No Data
Reply
  • 28407
    posted

    HI ,

     You can not bind to the DataRecordPresenter's Record property because it is not a framework element.
     
     The target of a binding must be a dependency property and a framework element.

     Sincerely,
     Matt
     Developer Support Engineer
     

Children