If I have a class
class ContentList
{
public string Content1 { get; set; }
public string Content2 { get; set; }
}
and a textbox in my XAML file with a binding
<TextBox Text="{Binding Content1, Mode=TwoWay}" ... />
I set the DataContext in my .cs file by
protected override void LoadState(Object navigationParameter, Dictionary<String, Object> pageState)
{
this.DataContext = new ContentList();
}
How do I change the binding to Content2?
Also, how do I access and change Content1 in code? this.DataContext.Content1 = "string" does not work.