0

I am using Xamarin to build a simple app. In my app I use a series of classes that inherit from DialogViewController. In some cases, when the user clicks on an item, I use:

NavigationController.PushViewController( new DialogViewClass() , true );

This when the DialogViewClass() starts and sets up a new view, it might alter the state of the data that requires my current Dialog to be refreshed.

When the user finally backs out of the stack, and reshows my dialog, how do I capture "the event" that says my dialog is being redisplayed, so that I can update my view with current information?

Elenesski
  • 409
  • 1
  • 5
  • 17

1 Answers1

0

Found my answer. In the class that inherits from DialogViewController, add this override:

override void ViewWillAppear( bool animated ) {
    base.ViewWillAppear( animated );
    // Show the page
}

In my case, simply rebuilding the interface based on the values in my constructor is good enough whether the page is being loaded for the first time, or is being reloaded after a POP action.

Elenesski
  • 409
  • 1
  • 5
  • 17
  • Check out this answer (and entire question) for more information about the order of events for iOS: http://stackoverflow.com/a/14644625/1134836. – valdetero Jul 24 '14 at 14:46