c# - Fire RadioButton checked routed event programmatically -


is there anyway raise radiobutton checked routed event code, in order handle in parent control?

this situation:

var radio = new radiobutton(); radio.ischecked = true; radio.raiseevent(new routedeventargs(radiobutton.checkedevent)); 

the third line not work.

googling, found way based on radiobuttonautomationpeer, had not found way make work.

does have hint?

thanks in advance.

var radio = new radiobutton(); radio.checkedchanged +=new eventhandler(radio_checkedchanged); radio.ischecked = true;  private void radio_checkedchanged(object sender, eventargs e) {         if (radio.checked)         {             messagebox.show("true");         }         else         {             messagebox.show("false");         }  } 

Comments

Popular posts from this blog

android - Get AccessToken using signpost OAuth without opening a browser (Two legged Oauth) -

org.mockito.exceptions.misusing.InvalidUseOfMatchersException: mockito -

google shop client API returns 400 bad request error while adding an item -