http://msdn.microsoft.com/en-us/library/ee658248.aspx search on the page for
'static event' should find the best ways to do this.
Typically the child will unsubscribe itself inside Dispose()
On 2 Apr 2012, at 02:21, Stephen Price wrote:
> Hey all,
>
> I've got a Static class that's behaving li
I'd consider holding weak references in the static class
|-Original Message-
|From: ozdotnet-boun...@ozdotnet.com [mailto:ozdotnet-
|boun...@ozdotnet.com] On Behalf Of Stephen Price
|Sent: Monday, 2 April 2012 11:21 AM
|To: ozDotNet
|Subject: Unhooking events from Handler
|
|Hey all,
|
|I'
In the past I have done something like this:
class Disposable : IDisposable
{
private readonly Action _action;
public Disposable(Action action)
{
_action = action;
}
public void Dispose()
{
_action();
}
}
public interface IHandle
{
void Handle(TMessage message);
}
publ
Thanks David,
yep, that's essentially my problem, but unfortunately I have no idea how
many events will be hooked up.
Its a status indicator that keeps track of the current loading status. ie
Loading, Searching, Normal, etc. (each one being an enum). I wanted to put
something into the baseviewmodel
: ozDotNet
Subject: Re: Unhooking events from Handler
In the past I have done something like this:
class Disposable : IDisposable
{
private readonly Action _action;
public Disposable(Action action)
{
_action = action;
}
public void Dispose()
{
_action();
}
}
public interface
mes.
>
> ** **
>
> *From:* ozdotnet-boun...@ozdotnet.com [mailto:
> ozdotnet-boun...@ozdotnet.com] *On Behalf Of *Michael Minutillo
> *Sent:* Monday, 2 April 2012 11:11
> *To:* ozDotNet
> *Subject:* Re: Unhooking events from Handler
>
> ** **
>
> In the past I h
heers.
>>
>> ** **
>>
>> James.
>>
>> ** **
>>
>> *From:* ozdotnet-boun...@ozdotnet.com [mailto:
>> ozdotnet-boun...@ozdotnet.com] *On Behalf Of *Michael Minutillo
>> *Sent:* Monday, 2 April 2012 11:11
>> *To:* ozDotNet
>>
r solving this problem. I use it myself
>>> quite a lot. I think it is perfect for Stephen.
>>>
>>> ** **
>>>
>>> Cheers.
>>>
>>> ** **
>>>
>>> James.
>>>
>>> ** **
>>>
>>> *
t; ja...@chapman-smith.com> wrote:
>>>
>>>> Hi Michael,
>>>>
>>>> ** **
>>>>
>>>> This is an awesome pattern for solving this problem. I use it myself
>>>> quite a lot. I think it is perfect for Stephen.
>>&g
;
>>>> Thanks!
>>>>
>>>> On Mon, Apr 2, 2012 at 10:37 AM, James Chapman-Smith <
>>>> ja...@chapman-smith.com> wrote:
>>>>
>>>>> Hi Michael,
>>>>>
>>>>> ** **
>>>>
10 matches
Mail list logo