Fixed Price Projects          Flexibele IT oplossingen

Software op maat              Web Applications

Add public class

PublicClassCheckBoxSelectionChangedRoutedEventsArgs

InheritsRoutedEventArgs

PublicSubNew(sourceAsObject, routedEventAsRoutedEvent)

MyBase.New(RoutedEvent, source)

EndSub

EndClass



Add region in your usercontrol class

#Region"External Events"

'add a ChangedEvent

PublicDelegateSubSelectionChangedEventHandler(senderAsObject, argsAsCheckBoxSelectionChangedRoutedEventsArgs)

 

PublicSharedReadOnlySelectionChangedEventAsRoutedEvent=EventManager.RegisterRoutedEvent("SelectionChanged", _

RoutingStrategy.Bubble,GetType(SelectionChangedEventHandler),GetType(ucDovyCheckBoxSelection))

 

' Provide CLR accessors for the event

PublicCustomEvent_SelectionChangedAsSelectionChangedEventHandler

AddHandler(ByValvalueAsSelectionChangedEventHandler)

Me.AddHandler(SelectionChangedEvent, value)

EndAddHandler

 

RemoveHandler(ByValvalueAsSelectionChangedEventHandler)

Me.RemoveHandler(SelectionChangedEvent, value)

EndRemoveHandler

 

RaiseEvent(ByValsenderAsObject,ByValeAsCheckBoxSelectionChangedRoutedEventsArgs)

Me.RaiseEvent(e)

EndRaiseEvent

EndEvent

 

' This method raises the Changed event

PrivateSubRaiseChangedEvent()

DimnewEventArgsAsNewCheckBoxSelectionChangedRoutedEventsArgs(Me,ucDovyCheckBoxSelection.SelectionChangedEvent)

MyBase.RaiseEvent(newEventArgs)

EndSub

#EndRegion

 

Call the onchange event from your onchange

PrivateSubchkOptie_CheckedChanged(senderAsObject, eAsRoutedEventArgs)

 

DimchkAsCheckBox=DirectCast(sender,CheckBox)

IfNotMe.inCheckedChangedAndAlso_ToonAllemaalThen

Me.inCheckedChanged =True

 

Ifchk.Name ="chkAllemaal"Then

SetAndereOpties(chk.IsChecked)

Else

SetAllemaal()

 

EndIf

Me.RaiseChangedEvent()

Me.inCheckedChanged =False

 

….

Categorie: .NET
Actions: E-mail | Permalink |

waardering