views:

306

answers:

1

Hi,

Might be this question a blunder :(...

I have a a button in silverlight application...

<Button Height="25" Width="100" Grid.Column="0" Grid.Row="0" Click="Button_Click"/>

I read that silverlight need WCF to interact with server side... So is it like to access my "Button_Click" event I need WCF ?

+3  A: 

No you dont need WCF to access you Button_Click event. You can direcly go to Code Behind and use the EventArgs e event handler.

The server side is normally database access and that is not needed for events!

Niike2
Then ...in which case we have to use WCF to access server side?
Anish Mohan
The codebehind is compiled into the XAP file that is used clientside. If you need to retrieve data on your clickevent you would typically use a WCF service to call from your clickevent to the server.
xamlgeek
So...If i have a grid in my xaml page...to populate the same I need a WCF call...right...similar way for all databound controls I need a WCF ?
Anish Mohan
The DataBind control is not a specific WCF control. You can create a simple Generic<List> and DataBind that to you gridview. Only when you need a separation layer between DB and the XAP file you should use WCF or any other number of mapper there is out there.Look at some tutorials on Silverlight homepage how to bind a DataBase (Table data) to your grid. That could help.
Niike2