none
How to create a bindable collection dependency property?! RRS feed

  • Question

  • Hi!

    I'm trying create an "ItemsSource"-Proeperty on my Custom Control. So i want to do something like this:

    <c:MyControl ItemsSource={Binding Items}/>
    

    where in the current DataContext is an Object of this class:

    public class MyClass {
    
    	public ObservableCollection<MyItem> Items { get; set; }
    
    	...
    
    }
    

    so the question here is, how should the dependencyproperty 'ItemsSource' in 'MyControl' look like?! I have searched and tried a lot, but didn't come up with a solution! Please help!

    thx in advance

    Friday, August 6, 2010 6:45 AM

Answers

  • sry, i know the difference very well... but I solved the problem analysing the Code of the new WPF-RibbonControl, which offers exactly such ItemSource-Properties..

    • Marked as answer by DSchiefer Friday, August 6, 2010 10:13 AM
    Friday, August 6, 2010 10:13 AM

All replies