private void btnTestEvent_Click(object sender, EventArgs e) { if (MainViewModel.Current == null) { MessageBox.Show("A document must be open before you can test an Expression.", "Warning"); return; } RegularExpressionTest.TestTransform(tbRegularExpression.Text, tbReplaceWith.Text, (Value m) => { tbRegularExpression.Text = m.Expression; tbReplaceWith.Text = m.ReplaceWith; }); }