MessageText property gets updated only when I hit another control. What is more if I press any button it's Click handler isn't executed and the MessageText set is executed instead. I've broken my head.
<TextBox x:Name="messageText" Grid.Row="1" Grid.Column="0"
TextWrapping="Wrap" Text="{Binding Path=MessageText, Mode=TwoWay}"/>
private void ChatView_Loaded(object sender, RoutedEventArgs e)
{
DataContext = viewModel;
}
public string MessageText
{
get
{
return this.messageText;
}
set
{
this.messageText = value;
OnProperyChanged("MessageText");
}
}
You can adjust UpdateSourceTrigger to PropertyChanged
<TextBox x:Name="messageText" Grid.Row="1" Grid.Column="0"
TextWrapping="Wrap" Text="{Binding Path=MessageText, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"/>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With