Go to solution explorer right click on silverlight foler
click on ‘add. Service reference Address: http: //loathes : /003 / servicel.svc Click on go button
click on ok button
By default the Microsoft given namespace name is ‘service reference1’ Go to main page .XAML code behind window Using silverlight application 53. Service reference1; Namespace silverlight application 53 { Public partical class mainpage: user control { Public mainpage() { Initialize component (); Service 1 client obj = new service 1 client(); Obj. add str completed + = new event handler <addstrcompleted eventargs> (obj_addstrcompleted); Obj.addstraasyncc); } Strubg s; Void obj_add strcompleted (object sender, addstr completed event args e) { S = e.result . tosting(); } Private void button_click (object sender, routed eventrags e) { Textbox1.text = s; } } }
while declaring addstrcompleted event press two times tab key after giving “+= Using addstrcompleted event eventArgs parameter we can get WCF method data
Effects are used to give rich interactive web graphical features, the silver light support two types of effects
Open new silver light application Go to XAML mode In the canvas tag <canvas> <button X:name = “b1” height = “100” width = “250” content = “welcome” fontsize = “36” click = “b1- click”> <button. Effect> <blur effect radius = “100” > </bluer effect > </button. Effect> </button> </canvas>
Go to button click event Using system. Windows. Media. Effects; Private void bl-clicks (objet sender, routed event args e ) { If (bl.effect == null) { Blur effect b = new blureffet (); b.radius = 100;
} Else { Bl. Effect = null; } }
Open new silverlight application Go to SAML mode In the canvas tag <canvas> <button X: name = “bi” Height = “100” width = “250” content = “welcome” font size = “40” canvas. Left = “60” canvas . top : “100”> <button. Effect> <dropshoadow effect blurradius = “100” shadow depth = “100”> </dropshadow effect> </button. Effect> </button> </canvas>
You liked the article?
Like: 0
Vote for difficulty
Current difficulty (Avg): Medium
TekSlate is the best online training provider in delivering world-class IT skills to individuals and corporates from all parts of the globe. We are proven experts in accumulating every need of an IT skills upgrade aspirant and have delivered excellent services. We aim to bring you all the essentials to learn and master new technologies in the market with our articles, blogs, and videos. Build your career success with us, enhancing most in-demand skills in the market.