Reputation: 41
Thanks to Kent Boogart's answer everything is right now. Thank you very much for all answers!
Hello,
I need to self host a WCF service inside WPF gui. I'm using ServiceHost.
But I still can't solve the problem.
First I host a service:
ServiceHost host;
Service.ISORClient service = new Service.SORClient();
//The next are in window constructor
host = new ServiceHost(service);
host.Open();
And i want to refresh data when I press button, so:
dataGrid1.ItemsSource = service.GetPatients();
It works, but only once. If I try to refresh it more than one time, it just doesn't work.
Here's my WCF service declaration:
[ServiceBehavior(InstanceContextMode=InstanceContextMode.Single)]
public class SORClient : ISORClient
... and all the methods come here...
Weird thing is, that when I connect from a client app. I can get all the data, and everything is correct. I just can't get the data into GUI (well, I can get it only one time).
Thank you very much in advance!
Upvotes: 4
Views: 3431
Reputation: 178630
Putting aside questions of design, I suspect you've been bitten by the Equals() override issue.
Try this to prove it:
dataGrid1.ItemsSource = null;
dataGrid1.ItemsSource = service.GetPatients();
Upvotes: 2