mobileNavlogo
headerlogo

Blog

Adding WCF Features in the SilverLight Application

20 September, 2018

Related Blogs

Distributing WCF features in the SilverLight Application

Go to solution explorer Screenshot_7 right click on silverlight foler Screenshot_7 click on ‘add. Service reference Address: http: //loathes : /003 / servicel.svc Click on go button Screenshot_7 click on ok button

Note

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; } } }

Note:-

while declaring addstrcompleted event press two times tab key after giving “+= Using addstrcompleted event eventArgs parameter we can get WCF method data  

Effects In the SilverLight

Effects are used to give rich interactive web graphical features, the silver light support two types of effects
  1. Blur effect
  2. Shadow effect

SilverLight Blur Effect

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>  

Blur Effect giving at Runtime

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;
  1. Effect = b;
} Else { Bl. Effect = null; } }  

SilverLight Shadow Effect

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>
About Author
Authorlogo
Name

TekSlate

Author Bio

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 .