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;
container.Property = null;
HI,
I am just following up on this thread.
Please let me know if you can provide further assistance.
Sincerely,
Matt Developer Support Engineer
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