Community
Welcome Guest Search | Active Topics | Members | Log In | Register

Adding Controls to an EntityPresenter at runtime Options
Xenthiro
Posted: Wednesday, June 24, 2009 12:20:46 PM
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.
David
Posted: Wednesday, June 24, 2009 12:39:34 PM
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.
Xenthiro
Posted: Wednesday, June 24, 2009 2:36:57 PM
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 angel
Users browsing this topic
Guest


Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Main Forum RSS : RSS

FlatEarth Theme Created by Jaben Cargman (Tiny Gecko)
Powered by Yet Another Forum.net version 1.9.1.8 (NET v4.0) - 3/29/2008
Copyright © 2003-2008 Yet Another Forum.net. All rights reserved.

 
www.rhea.be