Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7897059
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T08:03:29+00:00 2026-06-03T08:03:29+00:00

I have two nested DialogViewControllers – a View and an Edit. Both render data

  • 0

I have two “nested” DialogViewControllers – a “View” and an “Edit”. Both render data from an internal data structure using StringElements. In the Edit DVC, I hook the StringElement’s Changed event to update my internal data structure. I also hook the Edit DVC’s ViewDissapearing (sic) event to re-render the View DVC, and also send the edits to a cloud service.

My issue is that the Changed event handler gets invoked after the ViewDissapearing event handler, so my internal data structure isn’t updated in time.

The code that sets up the DVC’s looks something like this:

    var root = RenderViewItem(ThisItem);            
    var dvc = new DialogViewController(root, true);

    // create an Edit button which pushes the edit view onto the nav stack
    dvc.NavigationItem.RightBarButtonItem = new UIBarButtonItem(UIBarButtonSystemItem.Edit, delegate {
        var editRoot = RenderEditItem(ThisItem, true /* render the list field */);
        editViewController = new DialogViewController(editRoot, true);
        editViewController.ViewDissapearing += (sender, e) => 
        { 
            // trigger a sync with the service when the view disappears                    
            App.ViewModel.SyncWithService(); 

            // reload the View page 
            dvc.BeginInvokeOnMainThread(() =>
            {
                var oldroot = root;
                root = RenderViewItem(ThisItem);
                dvc.Root = root;
                dvc.ReloadData();
                oldroot.Dispose();
            });
        };    
        controller.PushViewController(editViewController, true);
    });

    // push the "view item" view onto the nav stack
    controller.PushViewController(dvc, true);

Inside RenderEditItem(), I add StringElements based on the internal data structure, and add the Changed EventHandler in the usual way:

stringElement.Changed += delegate { /* change a data structure */ };

Is there a way to get the Changed event handlers to fire before the ViewDissapearing event handler?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T08:03:31+00:00Added an answer on June 3, 2026 at 8:03 am

    Good news! MonoTouch.Dialog version 5.2.11 made a behavior change to the way the EntryElement.Changed event is raised – it is now raised for every keystroke as opposed to only when a focus change happens. So my “race condition” no longer occurs and I am now able to eliminate the NSTimer hack.

    A related benefit from this change is that you no longer have to call EntryElement.FetchValue() to ensure that EntryElement.Value is current.

    http://docs.xamarin.com/ios/releases/MonoTouch_5/MonoTouch_5.2#11 for more info.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have two tables nested (master view) for representing my data. The parent table
I have two classes generated by LINQ2SQL both from the same table so they
I have two entity lists being retrieved from the database they are using the
I have two nested div s that are supposed to both be 400 pixels
I have two functions that I'm using to add or remove slashes from a
Here is my situation - I have two nested view models: <%=Html.EditorFor(x => x.DisplayEntitiesWithRadioboxesViewModel)%><br
I have two nested loop in XSL like this, at this moment I use
I have two masterpages. A main.Master and a search.Master. The search.Master is a nested
I have two tables: Campaigns, Campaign_statistics. I need to output campaigns list with nested
I have a navigation bar that has two dropdowns (as nested ul's). I'm trying

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.