private void InputField_OnTextChanged(object sender, TextChangedEventArgs e) { var inputfield = sender as TextBox; AttachedProperties.SetIsEmpty(inputfield, string.IsNullOrEmpty(inputfield.Text)); }