[MonoTouch] prevent leaving a view
René Ruppert
rene.ruppert at googlemail.com
Sat Dec 17 10:24:39 EST 2011
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: monotouch-bounces at lists.ximian.com
[mailto:monotouch-bounces at lists.ximian.com] Im Auftrag von Richard
Gesendet: Freitag, 16. Dezember 2011 15:55
An: monotouch at lists.ximian.com
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
MonoTouch at lists.ximian.com
http://lists.ximian.com/mailman/listinfo/monotouch
More information about the MonoTouch
mailing list