I'm trying to bind a UserControl
to a property in my code.
The binding works in the constructor, but as I try to assign another value to the property after pressing a button, the UserControl
does not change it's value.
XAML:
<UserControl Content="{Binding MainDock, UpdateSourceTrigger=PropertyChanged}"/>
The binded property:
public UserControl MainDock { get; set; }
Constructor:
public DBControl()
{
InitializeComponent();
this.DataContext = this;
MarkerControl mc = new MarkerControl();
MainDock = mc;
}
Button method:
private void ShowItemsToPrint(object sender, RoutedEventArgs e)
{
ItemsToPrintControl sitp = new ItemsToPrintControl();
MainDock = sitp;
}