So I have been using DependencyProperties on TemplatedControls and had no issues... I am now making a UserControl that is derived from a TemplateControl... The class "Toolbar" is a TemplatedControl and is the base for other toolbars. The class "DataToolbar" is a UserControl derived from "Toolbar", it adds some specific content to the base toolbar and adds a DependencyProperty for a Map control...For the life of me I cannot get the Map property to be anything other than null, it is not binding... any ideas would be great! Thanks... Heres a code snippet:CodeBehind:
public partial class DataToolbar : Toolbar
{
//Members - Dependency Properties
protected static readonly DependencyProperty dependencyPropertyMap = DependencyProperty.Register("Map", typeof(Map), typeof(DataToolbar), null);
//Properties
public Map Map
{
get { return (Map)GetValue(dependencyPropertyMap); }
set { SetValue(dependencyPropertyMap, value); }
}
}
XAML:
<local:DataToolbar x:Name="DataToolbar" Map="{Binding ElementName=MyMap}" />
Thanks a lot!!!