If I create an dependency property on a custom control that takes an IEnumerable<T>
.
For example with an IEnumerable<string>
:
public static readonly DependencyProperty MyCollectionProperty =
DependencyProperty.Register("MyCollection", typeof(IEnumerable<string>), typeof(MyControl), new PropertyMetadata(new List<string>()));
public IEnumerable<string> MyCollection
{
get { return (IEnumerable<string>)GetValue(MyCollectionProperty); }
set { SetValue(MyCollectionProperty, value); }
}
If I databind an ObservableCollection<T>
or <string>
in this case to it. Does Silverlight take care of the two-way databinding for me?