user controls - How to pass main page method to Childwindow Silverlight? -
this has been issue long time,i have method inside main page open application, need invoke when user control clicked. when creating usercontrol need pass method , call inside usercontrol click event.
right doing this,
private void grid_mouseleftbuttonup(object sender, mousebuttoneventargs e) { mainpage m = new mainpage(); m.openapplication("stock"); }
but throwing null reference exception.help me on this.
rather creating instance of mainpage, can pass mainpage argument usercontrol , below,
usercontrol(mainpage m); private void grid_mouseleftbuttonup(object sender, mousebuttoneventargs e) { m.openapplication("stock"); }
creating instance make null references if values not assigned.
Comments
Post a Comment