drag and drop into a collection

2 posts, 0 answers
  1. Peppi Vecchio
    Peppi Vecchio avatar
    10 posts
    Member since:
    Mar 2010

    Posted 20 May 2010 Link to this post

    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?


  2. Tina Stancheva
    Tina Stancheva avatar
    3299 posts

    Posted 26 May 2010 Link to this post

    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.

    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.
Back to Top