468,321 Members | 1,765 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,321 developers. It's quick & easy.

Problem with RaiseEvent - Again

ffa
I have a number of classes that declare a public Event called RefreshData:

Public Class Client
Implements INotifyPropertyChanged

Implements IDisposable

Implements IDataErrorInfo

Public Event PropertyChanged(ByVal sender As Object, ByVal e As
System.ComponentModel.PropertyChangedEventArgs) Implements
System.ComponentModel.INotifyPropertyChanged.Prope rtyChanged

Public Event ErrorMsg(ByVal ErrMsg As String)

Public Event RefreshData() '<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<

Private WithEvents _ValidationRules As New Validation.brokenRules(Me)

<snip>

The event is reaised whenever the class does a data fetch:

<snip>

_Updated = CDate(IfNull(.Item("Updated"), Date.MinValue))

_Operator_ID = CInt(IfNull(.Item("Operator_ID"), 0))

End With

_Memo = New ClientMemo(_DatabaseName, _ID)

HasData = True

IsDirty = False

CanDelete = Can_Delete("Client", _ID, _DatabaseName)

RaiseEvent RefreshData() '<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<

In any form where this is used it is declared as follows:

Private WithEvents oClient As TRM8.WFL.Client

and is handled as follows:

Private Sub oClient_Refresh() Handles oClient.RefreshData

With oClient

mnuEditClient.Enabled = .HasData

End With

End Sub

The problem I am experiencing is that the "oClient_Refresh" method is no
longer being called (it was working). Added to this several other classes
with the same event are displaying the same behaviour. I have triple checked
my code and all appears well.

Has anyone seen this behaviour before? ....or can offer any suggestions.

Thank you
Sep 24 '07 #1
2 1237
In the debugger, if you put a break point at the RaiseEvent RefreshData
statement, does everything look cool? In other words, when this happens to
me, usually something is going on deeper in the code and the event is never
raised.
"ff*@newsgroup.nospam" wrote:
I have a number of classes that declare a public Event called RefreshData:

Public Class Client
Implements INotifyPropertyChanged

Implements IDisposable

Implements IDataErrorInfo

Public Event PropertyChanged(ByVal sender As Object, ByVal e As
System.ComponentModel.PropertyChangedEventArgs) Implements
System.ComponentModel.INotifyPropertyChanged.Prope rtyChanged

Public Event ErrorMsg(ByVal ErrMsg As String)

Public Event RefreshData() '<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<

Private WithEvents _ValidationRules As New Validation.brokenRules(Me)

<snip>

The event is reaised whenever the class does a data fetch:

<snip>

_Updated = CDate(IfNull(.Item("Updated"), Date.MinValue))

_Operator_ID = CInt(IfNull(.Item("Operator_ID"), 0))

End With

_Memo = New ClientMemo(_DatabaseName, _ID)

HasData = True

IsDirty = False

CanDelete = Can_Delete("Client", _ID, _DatabaseName)

RaiseEvent RefreshData() '<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<

In any form where this is used it is declared as follows:

Private WithEvents oClient As TRM8.WFL.Client

and is handled as follows:

Private Sub oClient_Refresh() Handles oClient.RefreshData

With oClient

mnuEditClient.Enabled = .HasData

End With

End Sub

The problem I am experiencing is that the "oClient_Refresh" method is no
longer being called (it was working). Added to this several other classes
with the same event are displaying the same behaviour. I have triple checked
my code and all appears well.

Has anyone seen this behaviour before? ....or can offer any suggestions.

Thank you
Sep 24 '07 #2
ffa
Thanks Mike
Yes, I put a breakpoint where you suggested and the code just jumps to the
next statement in the class method without calling the "oClient_Refresh()
Handles oClient.RefreshData" method. Really wierd

"Family Tree Mike" <Fa************@discussions.microsoft.comwrote in
message news:82**********************************@microsof t.com...
In the debugger, if you put a break point at the RaiseEvent RefreshData
statement, does everything look cool? In other words, when this happens
to
me, usually something is going on deeper in the code and the event is
never
raised.
"ff*@newsgroup.nospam" wrote:
>I have a number of classes that declare a public Event called
RefreshData:

Public Class Client
Implements INotifyPropertyChanged

Implements IDisposable

Implements IDataErrorInfo

Public Event PropertyChanged(ByVal sender As Object, ByVal e As
System.ComponentModel.PropertyChangedEventArgs) Implements
System.ComponentModel.INotifyPropertyChanged.Prop ertyChanged

Public Event ErrorMsg(ByVal ErrMsg As String)

Public Event RefreshData() '<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<

Private WithEvents _ValidationRules As New Validation.brokenRules(Me)

<snip>

The event is reaised whenever the class does a data fetch:

<snip>

_Updated = CDate(IfNull(.Item("Updated"), Date.MinValue))

_Operator_ID = CInt(IfNull(.Item("Operator_ID"), 0))

End With

_Memo = New ClientMemo(_DatabaseName, _ID)

HasData = True

IsDirty = False

CanDelete = Can_Delete("Client", _ID, _DatabaseName)

RaiseEvent RefreshData() '<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<

In any form where this is used it is declared as follows:

Private WithEvents oClient As TRM8.WFL.Client

and is handled as follows:

Private Sub oClient_Refresh() Handles oClient.RefreshData

With oClient

mnuEditClient.Enabled = .HasData

End With

End Sub

The problem I am experiencing is that the "oClient_Refresh" method is no
longer being called (it was working). Added to this several other classes
with the same event are displaying the same behaviour. I have triple
checked
my code and all appears well.

Has anyone seen this behaviour before? ....or can offer any suggestions.

Thank you

Sep 25 '07 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

8 posts views Thread by Nicolas | last post: by
18 posts views Thread by Derek Martin | last post: by
8 posts views Thread by Scott Meddows | last post: by
reply views Thread by fiaolle | last post: by
7 posts views Thread by Onokiyo | last post: by
3 posts views Thread by Martin | last post: by
1 post views Thread by Terry Olsen | last post: by
reply views Thread by NPC403 | last post: by
1 post views Thread by howard w | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.