vb.net - Simple databinding - How to handle bound field/property change. Winforms, .Net -


I have a custom control with binding property: -

  objects and Private _ value as lieutenant; Bindable (True), ... & gt; _ Public property value () return as object _ value expired set (by value as value) _Value = value ending property  

field at any time, with that value It's bound, change, I need this type of.

I do it in two places. First OnBindingContextChanged: -

  Protected Overrides sub-on-binding tontax changed (ByVal and System.InstantArgs) MyBase.OnBindingContextChanged (e) RemoveHandler Me.DataBindings.CollectionChanged, AddressOf DataBindings_CollectionChanged AddHandler Me DataBindings.CollectionChanged, AddressOf Even after this, I am doing, if I end the sub  

for me, then for me. Adding a handler to DataBindings.CollectionChanged event. This is the second place, which I get back to: -

  Private sub-databasesololbol switch (By-send as an object, by-system as a system.commentemodel.cliction change auctor ) If E. Action = Collection Change Action. B = binding as the B: Direct Seast (E. element, binding) if b.PropertyName = "value" then Me.GetValueType (B) End and End End End End  

The first place is required because the BindingContextChanged event is not run for a period of time until it starts. The second place is required if the binding field has been changed programmatically.

Am I handling the right events here or is there a cleaner way of doing this?

Note: My Gate Value Type Method

Cheers,

JULUS

ETA: Just to be clear here, I want it To know when the bound field has changed, the bound field value is not.

It looks as if you are looking for the INotifyPropertyChange interface, which automatically indicates the bound control of the update Will do


Comments

Popular posts from this blog

MySql variables and php -

url rewriting - How to implement the returnurl like SO in PHP? -

Which Python client library should I use for CouchdB? -