Burak Seyhan

Burak Seyhan

  • 1.7k
  • 321
  • 25.2k

Wpf CheckBox Problem

Sep 16 2015 4:46 AM
Hi ,
 
I developed wpf application. I have to display user status with images.
 
private void cbVoice_Click(object sender, RoutedEventArgs e)
{
LoginServerStatus status = new LoginServerStatus();
BitmapImage logo = new BitmapImage();
logo.BeginInit();
logo.UriSource = new Uri("Resources/Content/green.png", UriKind.Relative);
logo.EndInit();
imgVoice.Source = logo;
}
private void cbVoice_Unchecked(object sender, RoutedEventArgs e)
{
BitmapImage logo = new BitmapImage();
logo.BeginInit();
logo.UriSource = new Uri("Resources/Content/red.png", UriKind.Relative);
logo.EndInit();
imgVoice.Source = logo;
}
 
When I check the checkbox, check event works . However unchecked method works but Image doesn't update. Why and How can i fixed the problem?_
 
 
Thanks 

Answers (7)