This is a migrated thread and some comments may be shown as answers.

drag and drop into a collection

1 Answer 62 Views
DragAndDrop
This is a migrated thread and some comments may be shown as answers.
Peppi Vecchio
Top achievements
Rank 1
Peppi Vecchio asked on 20 May 2010, 03:14 PM
Good day,

With your help, I've been able to create some excellent functionality dragging custom controls from a toolbar into a stackpanel and viewing the controls properties in another stackpanel.

My question is: If I drop multiple controls into a stackpanel, is it helpful to add these to a collection (like ObservableCollection<T>) so that I may also leverage INotifyPropertyChanged? I'm currently using something like: this.StackPanel.Children.Add(customcontrol).

My goal is to drop custom (generic) controls into a stackpanel and update their properties from a third stackpanel, setting the name, height, width, etc. when the control is infocus. When I focus on another control, I'd like to access and manipulate it's properties. And so on. So that I'm dragging custom controls into the main stackpanel and changing the properties on the fly from a separate panel.

Is this a sensible approach?

TIA,

JV

1 Answer, 1 is accepted

Sort by
0
Tina Stancheva
Telerik team
answered on 26 May 2010, 08:41 AM
Hi Peppi Vecchio,

If you need to data bind certain items to a business object, you can use ObservableCollection. However, INotifyPropertyChanged can be implemented by any business class, so using ObservablleCollection is not mandatory at all times.

Also, it is not necessary to add your items into an ObservableCollection in this case.

Greetings,
Tina Stancheva
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Tags
DragAndDrop
Asked by
Peppi Vecchio
Top achievements
Rank 1
Answers by
Tina Stancheva
Telerik team
Share this question
or