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

Popular posts from this blog

java.util.scanner - How to read and add only numbers to array from a text file -

rewrite - Trouble with Wordpress multiple custom querystrings -

php - Accessing static methods using newly created $obj or using class Name -