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

WPF

 
GeneralRe: Silverlight file is not diplayed Pin
nizam babu30-Aug-09 22:49
nizam babu30-Aug-09 22:49 
QuestionMessage Removed Pin
13-Jul-09 10:59
professionalN_tro_P13-Jul-09 10:59 
AnswerRe: WPF animation background processing Pin
Christian Graus13-Jul-09 11:25
protectorChristian Graus13-Jul-09 11:25 
QuestionDataGrid Bindings not working Pin
Jacobus0113-Jul-09 4:06
Jacobus0113-Jul-09 4:06 
AnswerRe: DataGrid Bindings not working Pin
laprathab13-Jul-09 21:50
laprathab13-Jul-09 21:50 
GeneralRe: DataGrid Bindings not working Pin
Jacobus0113-Jul-09 22:36
Jacobus0113-Jul-09 22:36 
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 
Adriaan Davel wrote:
When I subscribe to the response event in my cached object, how would I unsubscribe that specific instance of my method call?


Same way you'd unsubscribe to any event.

The "instance" concept depends on how your handler is defined.

If the handler is static, it is a class handler so it has no access to
non-static members of the class the handler is in. When you remove a
static handler from the event, it doesn't matter which one is removed
since there's no object instance associated with the handler. But then
if you're using a static handler, the same delegate typically will only be
added to the event once anyway.

If the handler is non-static, there is an implicit object associated with
the handler that is added to the event, so in a sense, there IS a "a unique
handle for that subscription". When you add a handler, it is added
in the context of an object of the handling class. If you later remove the
handler from the event, only the handler for the removing object will be removed.

Given that, it's up to you to design your code appropriately.


Adriaan Davel wrote:
Could anonymous methods work for this? Do I need to unsubscribe anonymous methods?


Yes and yes. Same rules apply. However, an anonymous method would need to be assigned
to a variable for later removal...is it really anonymous any more if you
do that? Smile | :)


Adriaan Davel wrote:
How do I manage the user browsing away form my window before my response event fires (rending my data target non-existent)?


Try it. You'll see your handler(s) will never get called.


Adriaan Davel wrote:
(I really wish they would bring sync calls into Silverlight, I have argued with a number of async fans, and I NEED sync calls)


Assuming we're talking about calls from the browser here, like to a web service...

If you NEED sync calls, implement them yourself. Simply block on a
WaitHandle (like an EventWaitHandle) until the handler delegate signals
the event. That's a really bad idea in Silverlight, especially if you
block the UI thread. So instead of blocking the UI thread, you might think
"use a worker thread to wait for completion". Well, that gets just as
complex (if not more) as using async calls, doesn't it?

Nobody NEEDS sync calls... Smile | :)

Mark Salsbery
Microsoft MVP - Visual C++

Java | [Coffee]

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 
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 

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.