Tech Off Thread

1 post

Forum Read Only

This forum has been made read only by the site admins. No new threads or comments can be added.

Multiple State Changes In UIP App Block

Back to Forum: Tech Off
  • User profile image
    dlausch

    I am running a Win App which because of my navigation graph allows for the same view to be open multiple times (eg Win1 -> Win2 -> Win3 -> Win2 -> Win1). Whenever I revisit a view that was previously opened (as say in Win2 case), I get multiple calls to the StateChanged event for the Win2 view even though I made a single change to the State. The number of times the event is invoked seems to be tied to the number of times the view has been opened (for the example of Win2 there would be two events invoked). Anyone know why this would occur with the following code:

    Here are snippets of code in my controller class to detail my problem:

    ' Constructor
    Public Sub New( nav As Navigator )
      MyBase.New( nav )
      AddHandler State.StateChanged, AddressOf State_StateChanged
    End Sub

    ' Note that the following event is invoked multiple times even though the State is
    ' changed once
    Private Sub State_StateChanged( sender As Object, e As StateChangedEventArgs )
      
       ' Logic to handle the state change (invoke logic on the associated view)

    End Sub

    ' A line from some function within the controller class. The way that I understand it, the
    ' following line should cause one and one only invocation of the State_StateChanged event
    ' above regardless of how many times the associated view has been revisited
    State("some_index") = "changed"

    Any help with this problem would be appreciated.

    dlausch

Conversation locked

This conversation has been locked by the site admins. No new comments can be made.