Hi,
I have just realized I've been coercing binding/dependency properties and not really fundamentally understanding the concept.
Heres the dependency property:
public string Problem
{
get { return (string)GetValue(ProblemProperty); }
set { SetValue(ProblemProperty, value); }
}
public static readonly DependencyProperty ProblemProperty =
DependencyProperty.Register(
"Problem",
typeof(string),
typeof(TextBox));
The XAML is as so:
<TextBlock Text="{Binding Path=Problem}"/>
I'm manually setting the Problem
property to a value in the constructor of the object but it doesn't update the TextBlock
accordingly . . . any ideas? I've tried Mode="OneWay"
and Mode="TwoWay"
on the binding and it still doesn't work.
I thought this was supposed to work automatically? Or am i fundamentally getting something wrong?
Thanks