Closed ora8 closed 4 years ago
Thanks for reporting! Will write UI-tests for it. Sorry about the bug.
What do you mean by destroys the value? I found existing UI-tests for this
[Test]
public static void WhenStringFormatChanges()
{
using var app = Application.AttachOrLaunch(ExeFileName, WindowName);
var window = app.MainWindow;
var doubleBox = window.FindTextBox("LostFocusValidateOnPropertyChangedBox");
window.FindTextBox("StringFormat").Text = "F1";
doubleBox.Text = "1.23456";
window.FindButton("lose focus").Click();
Assert.AreEqual(false, doubleBox.HasValidationError());
Assert.AreEqual("1.23456", doubleBox.Text);
Assert.AreEqual("1.2", doubleBox.FormattedView().Text);
Assert.AreEqual("1.23456", window.FindTextBox("ViewModelValue").Text);
Assert.AreEqual(TextSource.UserInput, doubleBox.TextSource());
window.FindTextBox("StringFormat").Text = "F4";
window.FindButton("lose focus").Click();
Assert.AreEqual(false, doubleBox.HasValidationError());
Assert.AreEqual("1.23456", doubleBox.Text);
Assert.AreEqual("1.2346", doubleBox.FormattedView().Text);
Assert.AreEqual("1.23456", window.FindTextBox("ViewModelValue").Text);
Assert.AreEqual(TextSource.UserInput, doubleBox.TextSource());
window.FindTextBox("StringFormat").Text = "F1";
window.FindButton("lose focus").Click();
Assert.AreEqual(false, doubleBox.HasValidationError());
Assert.AreEqual("1.23456", doubleBox.Text);
Assert.AreEqual("1.2", doubleBox.FormattedView().Text);
Assert.AreEqual("1.23456", window.FindTextBox("ViewModelValue").Text);
Assert.AreEqual(TextSource.UserInput, doubleBox.TextSource());
}
Thank You very much for testing. It is not issue. There was a problem with using a SelectionChanged event of Combo Box. The value was always set to dirty. Sorry for the wrong alert.
No problem, keep the issues coming! I'm closing this issue.
This does not work
The value of TextBoxPi2 will be destroyed. Is there a workarround?
Thanks