Quantcast
Channel: Windows Presentation Foundation (WPF) forum
Viewing all articles
Browse latest Browse all 18858

Event Handling of text boxes using MVVM

$
0
0
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?

Viewing all articles
Browse latest Browse all 18858

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>