Monday, 15 August 2011

c# - Exception Using Dynamically adding controls to silverlight? -



c# - Exception Using Dynamically adding controls to silverlight? -

i have parameterised constructor in application. want add together controls dynamically silverlight page, gives null reference exception. why returns null time? can help me find solution?

public pdfexport(frameworkelement graphtile1, frameworkelement graphtile2, frameworkelement graphtile3) { button btngraph1 = new button(); string name = graphtile1.name; btngraph1.content = name; btngraph1.width = name.length; btngraph1.height = 25; btngraph1.click += new routedeventhandler(btngraph1_click); objstack.children.add(btngraph1); layoutroot.children.add(objstack); // here getting null reference exception _graphtile1 = graphtile1; _graphtile2 = graphtile2; _graphtile3 = graphtile3; }

thanks.

c# silverlight silverlight-4.0 silverlight-3.0

No comments:

Post a Comment