Here's my situation - I am starting my first SL application coming from a Windows background where I have the MVC pattern in place. I am thinking I can take advantage of tha pattern, so I jump right in to creating a SL application (solution) with 3 projects --> 1 holding my Model (business objects from before), SL app (automatically generated when I picked SL project), and 1 SL.Web project (automatically generated when I picked SL project).
Here are the steps I did: I dropped a blank grid onto my xaml file, created a service and it is being recognized w/o any problems. Added a "Silverlight-enabled WCF Service" to my Web project and w/in my project I referenced my "Model" project. Within [OperationContract], I created the following method (service):
[OperationContract]
public EmployeeCollection GetEmployees()
{
EmployeeCollection employees = Model.EmployeeCollection.GetAllEmployees();
return employees;
}
When I debug though this and put a breakpoint, I DO see data on return of employees, so I KNOW data is being returned.
Now, on my page.xaml.cs file, it seems that that my grid is not being populated somehow, but don't why.
I have the following snippet:
void MyWebService_GetEmploteesCompleted(object sender, EmployeeWebService.GetEmployeesCompletedEventArgs e)
{
dataGrid.ItemsSource = e.Result;
}
Where else should I be looking? What can I be missing? Do I have to add other snippets of code to work w/ my BLL (Model)?
Thanks for any advice.
=============================
BTW, while debugging, in the "Autos" window, I notice the following values coming through on _GetEMployeesCompleted():
dataGrid.ItemSource ........... Count = 30 e.Result ......... Count = 30
Why aren't the values showing up on my DataGrid?