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

WPF

 
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 
Hi,
At present I have developed the following code which works on th esilverlight page.

private void GetLatestData()
        {
            WinService.ClassNameClient client = new WinService.ClassNameClient();
            client.GetDataCompleted += new EventHandler<WinService.GetDataCompletedEventArgs>(client_GetDataCompleted);
            client.GetDataAsync();
        }

void client_GetDataCompleted(object sender, WinService.GetDataCompletedEventArgs e)
        {

txtCount.Text = e.Result.Count.ToString();

}


Question:
I would like to use a backgroundworker to do the above job in the silverlight page...
I have managed to do the following but not sure what to do next to complete this work?
Any thoughts please?
Thanks

using System.ComponentModel;
...
...
private BackgroundWorker backgroundWorker = new BackgroundWorker();

public ClassName()
{
InitializeComponent();

            backgroundWorker.WorkerReportsProgress = true;
            backgroundWorker.WorkerSupportsCancellation = true;
            backgroundWorker.DoWork += backgroundWorker_DoWork;
            backgroundWorker.RunWorkerCompleted += backgroundWorker_RunWorkerCompleted;
}

private void backgroundWorker_DoWork(object sender, DoWorkEventArgs e)
        {
            if (backgroundWorker.CancellationPending)
            {
                e.Cancel = true;
                return;
            }

            //GetData();
            // Return the result.
            e.Result = ??;
        }

private void backgroundWorker_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e)
        {

        }

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 PinPopular
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 
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 
AnswerRe: MVVM Question Pin
Pete O'Hanlon14-Feb-11 0:22
mvePete O'Hanlon14-Feb-11 0:22 

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.