Click here to Skip to main content
15,897,371 members
Home / Discussions / WPF
   

WPF

 
GeneralRe: MVVM Question Pin
_Maxxx_23-Feb-11 12:47
professional_Maxxx_23-Feb-11 12:47 
QuestionHow to return the value in Silverlight? [modified] Pin
Tesic Goran13-Feb-11 22:52
professionalTesic Goran13-Feb-11 22:52 
AnswerRe: How to return the value in Silverlight? Pin
Pete O'Hanlon14-Feb-11 0:32
mvePete O'Hanlon14-Feb-11 0:32 
GeneralRe: How to return the value in Silverlight? Pin
Tesic Goran14-Feb-11 0:56
professionalTesic Goran14-Feb-11 0:56 
GeneralRe: How to return the value in Silverlight? Pin
Pete O'Hanlon14-Feb-11 0:58
mvePete O'Hanlon14-Feb-11 0:58 
GeneralRe: How to return the value in Silverlight? Pin
Tesic Goran14-Feb-11 2:04
professionalTesic Goran14-Feb-11 2:04 
GeneralRe: How to return the value in Silverlight? Pin
Mycroft Holmes14-Feb-11 13:32
professionalMycroft Holmes14-Feb-11 13:32 
GeneralRe: How to return the value in Silverlight? Pin
Tesic Goran14-Feb-11 19:29
professionalTesic Goran14-Feb-11 19:29 
Thank you. I know that in theory. But, I can't find any code sample that could help me practically.

Simply, what should I do in my case? It's very simple. I call one method from WCF service and that method returns the list of strings. It looks like this in WPF:

List<string> lstSubsystems = client.GetSubsystemsByTestRunID(testRunID).ToList();


The call from WCF sevice above is only part of big method. In that big method, I have more WCF service calls after and they also return something. Therefore, it means, I need all those returning objects to be in that big method. It works normally in WPF application. But, it doesn't work in Silverlight application in that way. Yes, I wrote these 2 lines in Silverlight application:

client.GetSubsystemsByTestRunIDCompleted +=
 new EventHandler<GetSubsystemsByTestRunIDCompletedEventArgs>(client_GetSubsystemsByTestRunIDCompleted);
client.GetSubsystemsByTestRunIDAsync(testRunID);


And I have callback method:

private void client_GetSubsystemsByTestRunIDCompleted(
  object sender, GetSubsystemsByTestRunIDCompletedEventArgs e)
{
  lstSubsystems = new List<string>();
  if (e.Result != null)
    lstSubsystems = e.Result;
}


But, the callback method isn't executed. It's too late. The program flow is going further.

So, I know what the problem is, but I don't know how to handle it in code. I've tried a few things I found on internet, but it doesn't help. This is really basic thing in programming - call the method from another method and use the returning object further. How can I accomplish it in Silverlight?

Thank you in advance.
GeneralRe: How to return the value in Silverlight? Pin
Tesic Goran14-Feb-11 22:12
professionalTesic Goran14-Feb-11 22:12 
GeneralRe: How to return the value in Silverlight? Pin
Mycroft Holmes14-Feb-11 23:14
professionalMycroft Holmes14-Feb-11 23:14 
GeneralRe: How to return the value in Silverlight? Pin
Tesic Goran15-Feb-11 0:28
professionalTesic Goran15-Feb-11 0:28 
GeneralRe: How to return the value in Silverlight? Pin
Mycroft Holmes15-Feb-11 13:27
professionalMycroft Holmes15-Feb-11 13:27 
GeneralRe: How to return the value in Silverlight? Pin
Pete O'Hanlon16-Feb-11 7:37
mvePete O'Hanlon16-Feb-11 7:37 
GeneralRe: How to return the value in Silverlight? Pin
Tesic Goran17-Feb-11 1:27
professionalTesic Goran17-Feb-11 1:27 
GeneralRe: How to return the value in Silverlight? Pin
Tesic Goran17-Feb-11 3:18
professionalTesic Goran17-Feb-11 3:18 
GeneralRe: How to return the value in Silverlight? Pin
Pete O'Hanlon17-Feb-11 8:44
mvePete O'Hanlon17-Feb-11 8:44 
Questionwpf mvvm pattern Checkboxes to be checked by default. Pin
Himanshu0614198213-Feb-11 20:40
Himanshu0614198213-Feb-11 20:40 
AnswerRe: wpf mvvm pattern Checkboxes to be checked by default. Pin
Abhinav S13-Feb-11 21:15
Abhinav S13-Feb-11 21:15 
QuestionOpacityMask Brush Pin
HoltDan12-Feb-11 6:14
HoltDan12-Feb-11 6:14 
AnswerRe: OpacityMask Brush Pin
SledgeHammer0112-Feb-11 8:15
SledgeHammer0112-Feb-11 8:15 
GeneralRe: OpacityMask Brush Pin
HoltDan12-Feb-11 8:50
HoltDan12-Feb-11 8:50 
QuestionSilverlight or WPF Pin
Toniyo Jackson10-Feb-11 20:45
Toniyo Jackson10-Feb-11 20:45 
AnswerRe: Silverlight or WPF Pin
Mycroft Holmes10-Feb-11 21:06
professionalMycroft Holmes10-Feb-11 21:06 
GeneralRe: Silverlight or WPF Pin
Toniyo Jackson10-Feb-11 21:39
Toniyo Jackson10-Feb-11 21:39 
AnswerRe: Silverlight or WPF Pin
Abhinav S10-Feb-11 21:40
Abhinav S10-Feb-11 21:40 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.