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

how to raise a cutom event

P: 1
I have a Custom method and i wnat fire it when i change time:

Private Sub TimeQuery_SelectedTimeChanged(sender As System.Object, e As System.Windows.Controls.SelectionChangedEventArgs)

added the handler :
AddHandler queryfield.SelectedTimeChanged, AddressOf TimeQuery_SelectedTimeChanged

in Timepicker class i write handler

Public Custom Event SelectedTimeChanged As TimeSelectedChangedEventHandler
AddHandler(ByVal value As TimeSelectedChangedEventHandler)
[AddHandler](SelectedTimeChangedEvent, value)
End AddHandler
RemoveHandler(ByVal value As TimeSelectedChangedEventHandler)
[RemoveHandler](SelectedTimeChangedEvent, value)
End RemoveHandler
' RaiseEvent(ByVal sender As Object, ByVal value As TimeSelectedChangedRoutedEventArgs)
RaiseEvent(ByVal sender As Object, ByVal e As TimeSelectedChangedRoutedEventArgs)
End RaiseEvent
End Event
#End Region

this is the delegate
Public Delegate Sub TimeSelectedChangedEventHandler(ByVal sender As Object, ByVal e As TimeSelectedChangedRoutedEventArgs)

so this is my code now in XAML file i have a datePickercontrol(Custom control) and when i change the date TimeQuery_SelectedTimeChanged method suppose to raise but cant raise it can anybody help me?
Thanks in advance
Shankar
Apr 5 '12 #1
Share this question for a faster answer!
Share on Google+

Post your reply

Sign in to post your reply or Sign up for a free account.