[Solved] Popup on top of a Popup

Nov 13, 2015 at 4:54 PM
Edited Nov 28, 2015 at 12:47 PM
Hello,

here a new question of me.

I have a application that open a popup via controler
        Public Function MonthlyReportEntry() As ActionResult

            Return ViewModal(New MonthlyReportEntryViewModel, ViewLevel.Popup)

        End Function
I want on some Fields on the Formular the possibilty to open a calculator window.
      Public Function Calculator() As ActionResult

            Return ViewModal(New CalculatorViewModel, ViewLevel.Popup)

        End Function
The user press F4 and the popup come up. The user do the calculation and close the view. Now the problem is, that the ViewClosed-Event will not be fired. I have implementet like
    Private Sub FinishCalculation()

        UserSelectCancelAction = False
        Controller.CloseViewForModel(Me)
    End Sub
The View is closed but in the ViewModel that initated the View with follwoing command
    ''' <summary>
    ''' Öffnet einen Taschenrechner um etwas zu berechnen und dann anschließend zu übernehmen
    ''' </summary>
    ''' <remarks></remarks>
    Public Sub ExecuteTextBoxF4Command(param As Object)

        CalculatorField = CType(param, String)

        _Context = Controller.Action("Calculator", "Calculator")
        AddHandler DirectCast(_Context.Result, ViewResult).ViewClosed, AddressOf CalculatorViewClosing

    End Sub
The CalculatorViewClosing-Methode is not running.

Is that a Problem that I open a ModalView over the ModalView? How can I do it on the right way?

Thanks for Tipps and helping answers ;-)
Michael

Solution:

The problem was a combination of two misstakes.

1.) I missunderstood the eventhandling of views and viewsmodal. viewsmodal have no ViewClosed-Events.

2.) WPF Binding of child properties in a View. I must create Properties in the view with Notify-Event that write to/read from the child property of an entity.

I found it out, while i debug the source code of code framework and understand the mechanism ;-)

Thanks
Coordinator
Jan 19, 2016 at 3:29 PM
Hmmmm... that is odd. What theme are you using? It def. looks to me like the event should fire. Is there a small repro scenario you could send me so I can check into it?

Markus

PS: Sorry about the late reply. I guess Codeplex's notifications weren't working for a while, so I didn't see these new messages.