Click here to Skip to main content
15,886,518 members
Home / Discussions / WPF
   

WPF

 
QuestionDisplaying Data fetched asyncronously Pin
Adriaan Davel12-Jul-09 20:27
Adriaan Davel12-Jul-09 20:27 
AnswerRe: Displaying Data fetched asyncronously Pin
Mark Salsbery15-Jul-09 10:13
Mark Salsbery15-Jul-09 10:13 
GeneralRe: Displaying Data fetched asyncronously Pin
Adriaan Davel15-Jul-09 19:46
Adriaan Davel15-Jul-09 19:46 
GeneralRe: Displaying Data fetched asyncronously Pin
Michael Sync23-Jul-09 7:03
Michael Sync23-Jul-09 7:03 
GeneralRe: Displaying Data fetched asyncronously Pin
Adriaan Davel23-Jul-09 19:52
Adriaan Davel23-Jul-09 19:52 
GeneralRe: Displaying Data fetched asyncronously Pin
Michael Sync23-Jul-09 20:11
Michael Sync23-Jul-09 20:11 
GeneralRe: Displaying Data fetched asyncronously Pin
Adriaan Davel23-Jul-09 21:32
Adriaan Davel23-Jul-09 21:32 
GeneralRe: Displaying Data fetched asyncronously Pin
Michael Sync24-Jul-09 2:23
Michael Sync24-Jul-09 2:23 
Adriaan Davel wrote:
There might be other mechanisms to achive this, I'm sure one of the CP experts will enlighten us...


yeah..


In our project, we are sharing the service classes that invoke the WCF proxy between Silverlight and WPF. So, it's really painful and we can't ensure one function does one thing. If we follow one function does one thing then the code will be very messy like this example below with a lot of lambda expression.

void GetAllDogOwners(){

var dogServiceClient = new DogServiceClient();

dogServiceClient.GetAllDogsCompleted += (sender, e) => {

var dogs = e.Result;

var ownerServiceClient = new DogOwnerService();

ownerServiceClient.GetAllOwnersCompleted += (sdr, result) => {

var owners = result.Result;

foreach(var owner in owners){
owner.Dogs = (from dog in dogs
join person in owners
on dog.DogId equals person.OwnerID
select dog).ToObservable();
}
};
ownerServiceClient.GetAllOwnersAsync()

};
dogServiceClient.GetAllDogsAsync();
}

If I make if

void GetAllDogOwners(){
var dogServiceClient = new DogServiceClient();
dogServiceClient.GetAllDogsCompleted += new delegate(OnGetAllDogsCompleted);
dogServiceClient.GetAllDogsAsync();
}

void OnGetAllDogsCompleted(sender, e) {

var dogs = e.Result;

var ownerServiceClient = new DogOwnerService();

ownerServiceClient.GetAllOwnersCompleted += (sdr, result) => {

var owners = result.Result;

foreach(var owner in owners){
owner.Dogs = (from dog in dogs
join person in owners
on dog.DogId equals person.OwnerID
select dog).ToObservable();
}
};
ownerServiceClient.GetAllOwnersAsync()
}

we are thinking to remove all async calls now in WPF.. Smile | :)

Thanks and Regards,
Michael Sync ( Blog: http://michaelsync.net)

Microsoft MVP (Silverlight), WPF/Silverlight Insiders

GeneralRe: Displaying Data fetched asyncronously Pin
Jeremy Likness26-Jul-09 3:17
professionalJeremy Likness26-Jul-09 3:17 
GeneralRe: Displaying Data fetched asyncronously Pin
Adriaan Davel27-Jul-09 1:42
Adriaan Davel27-Jul-09 1:42 
AnswerRe: Displaying Data fetched asyncronously Pin
Daniel Vaughan9-Jan-10 7:33
Daniel Vaughan9-Jan-10 7:33 
QuestionWPF TreeListView Control Not Working!!!!! Pin
ub3rst4r11-Jul-09 15:01
ub3rst4r11-Jul-09 15:01 
AnswerRe: WPF TreeListView Control Not Working!!!!! Pin
Christian Graus13-Jul-09 7:33
protectorChristian Graus13-Jul-09 7:33 
GeneralRe: WPF TreeListView Control Not Working!!!!! Pin
ub3rst4r13-Jul-09 8:24
ub3rst4r13-Jul-09 8:24 
GeneralRe: WPF TreeListView Control Not Working!!!!! Pin
Christian Graus13-Jul-09 8:42
protectorChristian Graus13-Jul-09 8:42 
QuestionDid you ever wonder, What the origin of XAML is? [modified] Pin
ProtoBytes10-Jul-09 10:29
ProtoBytes10-Jul-09 10:29 
AnswerRe: Did you ever wonder, What the origin of XAML is? Pin
Christian Graus11-Jul-09 4:39
protectorChristian Graus11-Jul-09 4:39 
GeneralRe: Did you ever wonder, What the origin of XAML is? Pin
ProtoBytes12-Jul-09 1:53
ProtoBytes12-Jul-09 1:53 
GeneralRe: Did you ever wonder, What the origin of XAML is? Pin
Christian Graus12-Jul-09 4:37
protectorChristian Graus12-Jul-09 4:37 
GeneralRe: Did you ever wonder, What the origin of XAML is? Pin
ProtoBytes12-Jul-09 6:00
ProtoBytes12-Jul-09 6:00 
QuestionRe: Here is a question, Mind doing me a favor? Pin
ProtoBytes12-Jul-09 2:09
ProtoBytes12-Jul-09 2:09 
GeneralRe: Did you ever wonder, What the origin of XAML is? Pin
Super Lloyd15-Jul-09 0:38
Super Lloyd15-Jul-09 0:38 
AnswerRe: Did you ever wonder, What the origin of XAML is? Pin
#realJSOP11-Jul-09 9:13
mve#realJSOP11-Jul-09 9:13 
GeneralRe: Did you ever wonder, What the origin of XAML is? Pin
ProtoBytes12-Jul-09 2:02
ProtoBytes12-Jul-09 2:02 
QuestionSilverlight 3 Released! Pin
Mark Salsbery10-Jul-09 8:56
Mark Salsbery10-Jul-09 8:56 

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.