Quick Overview
I've created a custom control "InputValuePage". I've registered a dependency property with this control named InputTitle. Binding within the User Control InputTitle to a textblock works great however I when using this custom control as a child in a frame or window I can't use a binding to set my dependency properties. Below is the code used for the InputTitle property.
Custom Control Class Code Behind :
public partial class InputValuePage : Page
{
public static readonly DependencyProperty InputTitleProperty =
DependencyProperty.Register("InputTitle", typeof(string), typeof(InputValuePage));
public string InputTitle
{
get { return (string)GetValue(InputTitleProperty); }
set { SetValue(InputTitleProperty, value); }
}
public InputValuePage()
{
InitializeComponent();
}
}
Example Usage:
<Frame Grid.Row="2"
Grid.ColumnSpan="2"
Grid.RowSpan="2"
x:Name="DisFrame">
<Frame.Content>
<local:InputValuePage
InputMessage="This gets set in the control."
InputTitle="{Binding ElementName=DisFrame, Path=Name}"
HostWindow="{Binding ElementName=DemoWindow}">
</local:InputValuePage>
</Frame.Content>
</Frame>
To clarify the three values set in the XAML are all dependency properties. Input Message and Title can successfully set when a string is provided however data bindings never actually set a value. What am I missing to allow for binding data?