Rank: Newbie Groups: Member
Joined: 6/24/2009 Posts: 6 Location: Belgium
|
Since I'm using an EntityPresenter to show TextBoxPropertyPresenters which are generated at runtime. I was wondering if it's possible to set the Properties property on the EntityPresenter by binding to an ObservableCollection property on the PageController.
At the moment I add the controls using an Extension Method from the code behind, for which I had to implement multiple DependencyProperties, bound to PageController properties.
|
Rank: Advanced Member Groups: Vidyano Team
Joined: 11/20/2008 Posts: 4
|
Hello,
the Properties property on the EntityPresenter control is read-only.
Regards, David
Edit: If I understand correctly, what you want to do is dynamically (at-runtime) add TextBoxPropertyPresenter instances to this collection. My suggestion would be to add a single DependencyProperty of type ObservableCollection<object> and bind this to an ObservableCollection<object> property on the pagecontroller. Then hook the CollectionChanged event and whenever an object is added/deleted on the pagecontroller collection, add/delete a TextBoxPropertyPresenter object to the Properties collection on the EntityPresenter.
|
Rank: Newbie Groups: Member
Joined: 6/24/2009 Posts: 6 Location: Belgium
|
Thanks, that realy helped me out. I did hook in on the PropertyChanged event I got of the SelectedInvoice property, instead of creating an ObservableCollection<object> property and hooking in on the CollectionChanged event. But the general idea is the same
|