By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,760 Members | 1,644 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,760 IT Pros & Developers. It's quick & easy.

Problem with RaiseEvent - Again

P: n/a
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
Share this Question
Share on Google+
2 Replies


P: n/a
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

P: n/a
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.