c# - How to make ContentControl listen to non-routed event inside its ContentTemplate -


I have some reusable content controls, which work in the second view as a pseudo-modal popup. It is always there and only its visibility is visible or disappears. Within ContentControl, there will be a custom content template, which is bound to some view modal and represents the content of "modal popups".

  & lt; Dialog: ModalDios DialogHost = "{Binding ElementName = Layout, Mode = One Time}" Content = "{Binding ViewModel.CurrentAditIT}" EyesShown = "{Binding ViewModel.IsInEdit}" & gt; & Lt; Dialog: ModalDialog.ContentTemplate & gt; & Lt; DataTemplate & gt; & Lt; Item Editor: Magnifier View / & gt; & Lt; / DataTemplate & gt; & Lt; / Dialogues: ModalDialog.ContentTemplate & gt; & Lt; / Dialogues: ModalDialog & gt;  

Now I want to reach the following: The root of ContentTemplate (here: item editor view) should apply the following interface.

  Public Interface ICLOS menu {event eventhandler & lt; EventArgs & gt; CloseMe; }  

Whenever CloseMe-Event is removed, the surrounding modal dialog should be set to "hidden" by setting its visibility property hidden.

The scene within the popup (ItemEditorView here) should not be taken into account, whether it is shown in modaliodology or in some other context, i.e. should also know that such a class is not present. It does not involve walking through a logical or visual tree, it will only fire CloseMe-Event, when the cancellation / save-button will be pressed.

In addition, the mechanism should not be implemented / configured in the immediate form of modal dealog, the view should be as dumb as possible. .

Instead, "external" modalodyogic should be activated and listen to closeMe-event. How can I clean it, without implementing MVVM-compliant ways and unnecessary dependencies? Is there an event, after the start of a content template, STT Afterwards, modalodyoga can be evaluated, if its root extends to ICLOSME?

how to iCilaz mee Is that you can set the trigger against XAML?


Comments

Popular posts from this blog

c# - How to capture HTTP packet with SharpPcap -

jquery - SimpleModal Confirm fails to submit form -

php - Multiple Select with Explode: only returns the word "Array" -