3using System.Windows.Input;
4using System.Windows.Media;
14 private bool xmlOk =
true;
15 private bool toOk =
false;
22 private void CustomXml_TextInput(
object Sender, TextCompositionEventArgs e)
26 string s = e.Text.Trim();
28 if (!
string.IsNullOrEmpty(s))
30 XmlDocument Doc =
new XmlDocument();
33 this.CustomXml.Background =
null;
39 this.CustomXml.Background =
new SolidColorBrush(Colors.PeachPuff);
44 this.SendButton.IsEnabled = this.xmlOk && this.toOk;
48 private void To_TextChanged(
object Sender, System.Windows.Controls.TextChangedEventArgs e)
50 string s = this.To.Text.Trim();
52 this.toOk = !
string.IsNullOrEmpty(s);
53 this.To.Background = this.toOk ? null :
new SolidColorBrush(Colors.PeachPuff);
55 this.SendButton.IsEnabled = this.xmlOk && this.toOk;
58 private void SendButton_Click(
object Sender, RoutedEventArgs e)
60 if (this.xmlOk && this.toOk)
61 this.DialogResult =
true;
64 private void CancelButton_Click(
object Sender, RoutedEventArgs e)
66 this.DialogResult =
false;