vb.net - Catch event from item stored in a dependency property -


How do you hold an event from an object raised in dependency property? For example, in general I get something like this

  foo _foo get returned as the public property foo1 get ready (value as foo) _foo = End price set End Property Private WithEvents foo Public Sub Foo_Handler as you want to write _foo () Handle_Foo. Some events' Sophoming & All  

Although you do not have a dependency property as evvavents Can declare. Any idea

Here I came up with the solution. I really do not like it and it does not look right, but it works. If there is a better solution for a person, please provide it as an answer. To provide a little more information about the case of my use, I have a dialogue called Oakkenal diologue. It is basically just a placeholder to present the content to the end user when the user clicks OK, then stops The method is called as isawview, and when the cancel button is clicked on the other side, then cancel it, the method says the problem It was, that the method of saving is usually to save asynchronous items, basically I marked the saved method as a function that would return a boolean (which was closed to the truth) But the problem was that something went wrong while saving, oakcalan digital will already be closed. So now, I call the Save method and saves everything in the scene, this event raises CloseView, which I then capture in OKCancelDialog to close the dialog.

I like to hear other options to complete this.

Interface Issue:

  Public Interface Isav Vee Cancel () Save Sub () Close Event View () Event is Package () End Interface  

Classroom with DP:

  public ViewProperty DependencyProperty = DependencyProperty.Register ("View", GetType (ISaveView), GetType (OkCancelDialog) ), New PropertyMetadata (nothing, New PropertyChangedCallback (AddressOf OnViewChanged))  

CLR Property:

  #Region "View" View public property return form of ISaveView Get DirectCast (GetValue (ViewProperty), ISaveView) Set End Value (As IsaveView) SetValue (View Property, Value) End Set End Property Public SubOvWChanged () _view = View OnPropertyChanged ("View") End Sub Personal WithEvents ISaveView Private Sub View_HasChanges _view () _view.HasChanges Handle okButton.IsEnabled = True End Sub Personal Sub View_CloseView () Handle _view.CloseView Me.Close () End Sub # End Area  

Comments

Popular posts from this blog

ios - How do I use CFArrayRef in Swift? -

eclipse plugin - Run java code error: Workspace is closed -

c - Error on building source code in VC 6 -