Просто создайте свойство зависимостей в UserControl и свяжите его со своим внутренним контролем, как показано ниже:
1) Добавьте свойство зависимости в CustomControl:
public System.Collections.IEnumerable ItemsSource
{
get { return (System.Collections.IEnumerable)GetValue(ItemsSourceProperty); }
set { SetValue(ItemsSourceProperty, value); }
}
// Using a DependencyProperty as the backing store for ItemsSource. This enables animation, styling, binding, etc...
public static readonly DependencyProperty ItemsSourceProperty =
DependencyProperty.Register("ItemsSource", typeof(System.Collections.IEnumerable), typeof(UserControl1), new UIPropertyMetadata(null));
2) Привязать внутренний контроль со свойством зависимости:
<UserControl ... x:Name="control" ... >
<ListBox ItemsSource="{Binding ElementName=control, Path=ItemsSource}" />
Редактировать : Реализация Источника Предметов