Actualización de enlace de cuadro de texto en WPF [duplicado]
Esta pregunta ya tiene una respuesta aquí:
- WPF MVVM: Cuadro de texto y enlace de botón predeterminado se actualiza demasiado tarde 3 respuestas
La propiedad messageText se actualiza solo cuando presiono otro control. Lo que es más si presiono cualquier botón es controlador de clic no se ejecuta y el conjunto messageText se ejecuta en su lugar. He roto mi cabeza.
<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");
}
}
47
1 answers
Puede ajustar UpdateSourceTrigger a PropertyChanged
<TextBox x:Name="messageText" Grid.Row="1" Grid.Column="0"
TextWrapping="Wrap" Text="{Binding Path=MessageText, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"/>
115
Author: Aghilas Yakoub,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2014-08-13 12:26:35
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2014-08-13 12:26:35