So? Fact is: you have to catch all places where the user is able to navigate away. Instead of C# delegates you can also use NSNotificationCenter to post your own notifications and let the observer (e.g. your app delegate) know who wants to update the views. The observer can then decide centrally if it is okay to leave or not and trigger an action accordingly on the sender of the notification.
It might also be worth to let all of your participating controllers inherit from a base, like "ConditionalDisappearController" that has an abstract or virtual method: CanNavigateAway(). Whenever something wants to navigate away, you'll call CanNavigateAway(). If it returns true, you're good to go. It does not matter if that occurs in the left or right view controller. If something happens on the left controller YOU are the one that updates the right controller, so you can check just as fine on the left controller. René -----Ursprüngliche Nachricht----- Von: [email protected] [mailto:[email protected]] Im Auftrag von Richard Gesendet: Freitag, 16. Dezember 2011 15:55 An: [email protected] Betreff: Re: [MonoTouch] prevent leaving a view Thing is Rupert, this is the rightsection of a splitviewcontroller so the user could select another option on the leftside or hit the back-button of the navigation -- View this message in context: http://monotouch.2284126.n4.nabble.com/prevent-leaving-a-view-tp4204269p4204 911.html Sent from the MonoTouch mailing list archive at Nabble.com. _______________________________________________ MonoTouch mailing list [email protected] http://lists.ximian.com/mailman/listinfo/monotouch _______________________________________________ MonoTouch mailing list [email protected] http://lists.ximian.com/mailman/listinfo/monotouch
