c# - Navigating from Page/ Page Function to PageFunction Null Reference Exception occurs -
page.cs
private void pagebutton_click(object sender, routedeventargs e) { pagefunction pagefunction = new pagefunction(); pagefunction.return += new returneventhandler<string>(pagefunction_return); this.navigationservice.navigate(pagefunction); } static void pagefunction_return(object sender, system.windows.navigation.returneventargs<string> e) { string returnedvaule = e.result; messagebox.show(returnedvaule); }
pagefunction.cs
private void pagefunctionbutton_click(object sender, routedeventargs e) { onreturn(new returneventargs<string>("returned")); }
as shown above have page , pagefunction.
on pagebutton_click of page.cs, navigating pagefunction, after execution of whole pagebutton_click event, null reference exception (i.e, object reference not set instance of object).
and dont know why exception ocurred.
help me out problem.
thanks.
remember -> pagefunction<string>
may you.
Comments
Post a Comment