private void txtUsername_LostFocus(object sender, RoutedEventArgs e) { string usergrouptxt = txtUsername.Text; try { if (string.IsNullOrEmpty(usergrouptxt)) { txtUsername.BorderBrush = new SolidColorBrush(Colors.Red); } else { } } catch (SqlException usrgrpexc) { MessageBox.Show(usrgrpexc.ToString()); } }How can I do the above operation in my ViewModel in MVVM?
↧
Event Handling of text boxes using MVVM
↧