Possible Duplicate:
WPF: XAML property declarations not being set via Setters?
I am stuck on seemingly silly problem.
I have a user control, MyControl.xaml, and MyControl.xaml.cs defines a public dependency property:
public static readonly DependencyProperty VisibleItemsProperty =
DependencyProperty.Register("VisibleItems", typeof(object), typeof(MyControl));
public object VisibleItems
{
get { return (object)GetValue(VisibleItemsProperty); }
set { SetValue(VisibleItemsProperty, value); }
}
Within another view SomeOtherViewA, i declare my control:
<cc:MyControl VisibleItems="{Binding VisibleTables}" />
VisibleTables is a dependency property on the viewmodel SomeOtherViewModelA.
I know that VisibleTables returns values, because it is bound to other controls within SomeOtherViewA (such as ListBox) and they work fine.
For some reason the dependency property within my custom user control is never set. Am i missing something obvious?