Prevent storing data after pre-filling

This commit is contained in:
tsommer committed 2022-09-20 19:31:09 +02:00
1 parent d9629ab53d
commit d521aca2f7
1 file changed
+8
@@ -10,6 +10,7 @@ public sealed partial class Translation : UserControl
private readonly Timer saveTimer;
private int currentTranslationId = -1;
private bool isLoading = false;
public Translation()
{
@@ -40,13 +41,20 @@ public sealed partial class Translation : UserControl
public void Configure(DataModel.Database.Translation translation)
{
this.isLoading = true;
this.currentTranslationId = translation.Id;
this.textBox.Multiline = translation.TextElement.IsMultiLine;
this.textBox.Text = translation.Text;
this.isLoading = false;
}
private async void textBox_TextChanged(object sender, EventArgs e)
{
if(this.isLoading)
return;
if(this.saveTimer.Enabled)
this.saveTimer.Stop();