Click here to Skip to main content
15,910,981 members
Home / Discussions / WPF
   

WPF

 
GeneralRe: How to sort the items under some node in Silverlight tree view? Pin
Tesic Goran17-Feb-11 19:35
professionalTesic Goran17-Feb-11 19:35 
Answersymbols not loaded Pin
cmichaelgraham17-Feb-11 3:04
cmichaelgraham17-Feb-11 3:04 
GeneralRe: symbols not loaded Pin
SledgeHammer0117-Feb-11 7:12
SledgeHammer0117-Feb-11 7:12 
GeneralRe: symbols not loaded Pin
Abhinav S17-Feb-11 17:49
Abhinav S17-Feb-11 17:49 
QuestionHow to restyle tab control in WPF Pin
Tridip Bhattacharjee16-Feb-11 23:09
professionalTridip Bhattacharjee16-Feb-11 23:09 
AnswerRe: How to restyle tab control in WPF Pin
SledgeHammer0117-Feb-11 7:10
SledgeHammer0117-Feb-11 7:10 
QuestionOpen a new Window from a Page in silverlight 4.0 Pin
Member-495917616-Feb-11 22:54
Member-495917616-Feb-11 22:54 
AnswerRe: Open a new Window from a Page in silverlight 4.0 Pin
#realJSOP17-Feb-11 7:11
professional#realJSOP17-Feb-11 7:11 
Questionbackground worker Pin
arkiboys14-Feb-11 3:48
arkiboys14-Feb-11 3:48 
AnswerRe: background worker Pin
Pete O'Hanlon14-Feb-11 10:08
mvePete O'Hanlon14-Feb-11 10:08 
GeneralRe: background worker Pin
arkiboys15-Feb-11 2:40
arkiboys15-Feb-11 2:40 
GeneralRe: background worker Pin
Ian Shlasko15-Feb-11 3:16
Ian Shlasko15-Feb-11 3:16 
GeneralRe: background worker Pin
musefan15-Feb-11 3:44
musefan15-Feb-11 3:44 
GeneralRe: background worker Pin
Ian Shlasko15-Feb-11 4:19
Ian Shlasko15-Feb-11 4:19 
GeneralRe: background worker Pin
musefan15-Feb-11 4:54
musefan15-Feb-11 4:54 
GeneralRe: background worker Pin
Ian Shlasko15-Feb-11 4:58
Ian Shlasko15-Feb-11 4:58 
GeneralRe: background worker Pin
Pete O'Hanlon15-Feb-11 5:19
mvePete O'Hanlon15-Feb-11 5:19 
GeneralRe: background worker Pin
Tesic Goran16-Feb-11 3:50
professionalTesic Goran16-Feb-11 3:50 
Hello Ian,

Could I please you to help me with my problem?

I have this code in big method in my Silverlight application that uses WCF service:

private void F()
{
        // WCF service
	DatabaseServiceClient client = new DatabaseServiceClient();

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

	// I want to use lstSubsystems list returned from first async in foreach loop
        treeAdditionalInfo.Items.Clear();
        foreach (string subsystemName in lstSubsystems)
        {
          TreeViewItem subsystemItem = new TreeViewItem();
          subsystemItem.Header = subsystemName;
          subsystemItem.FontSize = 14;
          treeAdditionalInfo.Items.Add(subsystemItem);
        }

	// Second async
        List<KeyValuePair<string, List<TestLogSmall>>> lstFormsAndActions =
          client.GetFormsAndActions(testRunID).ToList();
        client.GetFormsAndActionsCompleted +=
          new EventHandler<GetFormsAndActionsCompletedEventArgs>(client_GetFormsAndActionsCompleted);
        client.GetFormsAndActionsAsync(testRunID);

        ...
}


The code in first 2 callbacks is this:

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

private void client_GetFormsAndActionsCompleted(
  object sender, GetFormsAndActionsCompletedEventArgs e)
{
  lstFormsAndActions = new List<KeyValuePair<string, List<TestLogSmall>>>();
  if (e.Result != null)
    lstFormsAndActions = e.Result;
}


I need to get the list after this call:

client.GetSubsystemsByTestRunIDAsync(testRunID);


And to get the list after this call as well:

client.GetFormsAndActionsAsync(testRunID);


How can I do that? What should I write?

Thank you in advance.
GeneralRe: background worker Pin
Ian Shlasko16-Feb-11 5:29
Ian Shlasko16-Feb-11 5:29 
GeneralRe: background worker Pin
Tesic Goran16-Feb-11 21:37
professionalTesic Goran16-Feb-11 21:37 
GeneralRe: background worker Pin
Pete O'Hanlon16-Feb-11 21:52
mvePete O'Hanlon16-Feb-11 21:52 
GeneralRe: background worker Pin
Pete O'Hanlon16-Feb-11 7:38
mvePete O'Hanlon16-Feb-11 7:38 
GeneralRe: background worker Pin
Tesic Goran16-Feb-11 21:24
professionalTesic Goran16-Feb-11 21:24 
GeneralRe: background worker Pin
Pete O'Hanlon16-Feb-11 21:50
mvePete O'Hanlon16-Feb-11 21:50 
QuestionMVVM Question Pin
_Maxxx_14-Feb-11 0:14
professional_Maxxx_14-Feb-11 0:14 

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.