[MonoTouch] how can i add an action when dv disappears?

Jeff Stedfast jeff at xamarin.com
Wed Oct 19 11:06:11 EDT 2011


Hi Andreas,

You can subclass DialogViewController like this:

public class LoginViewController : DialogViewController
{
    public LoginViewController () : base (null)
    {
        Root = new RootElement ("Settings") {
            new Section () {
                new BooleanElement ("Airplane Mode", false),
                new RootElement ("Notifications", 0, 0) {
                    new Section (null, "Turn off Notifications to
disable Sounds\n" +
                        "Alerts and Home Screen Badges for
the\napplications below.") {
                        new BooleanElement ("Notifications", false)
                    }
                }
            }
        } ;
    }

    public override void ViewDidDisappear (bool animated)
    {
        base.ViewDidDisappear (animated);

        // Here is where you can add your custom code for when the
DialogViewController disappears
    }
}

Hope that helps,

Jeff

2011/10/19 Andreas Ploetzeneder <info at ploetzeneder-it.com>
>
> i could subclass this,... how can i do it,..can somebody help me....
> i would like to have the data of root also in the subclass....directly,...
> so mylogincontroller:dialogviewcontroller{
> }
>
> 2011/10/19 Andreas Ploetzeneder <info at ploetzeneder-it.com>
>>
>> public class LoginView
>>
>> {
>>
>> public DialogViewController dv;
>>
>> public LoginView ()
>>
>> {
>>
>> var root = CreateRoot ();
>>
>> dv = new DialogViewController (root, true);
>>
>> }
>>
>> RootElement CreateRoot ()
>>
>> { return new RootElement ("Settings") {
>>
>> new Section (){
>>
>> new BooleanElement ("Airplane Mode", false),
>>
>> new RootElement ("Notifications", 0, 0) {
>>
>> new Section (null, "Turn off Notifications to disable Sounds\n" +
>>
>>     "Alerts and Home Screen Badges for the\napplications below."){
>>
>> new BooleanElement ("Notifications", false)
>>
>> }
>>
>> }}} ;
>>
>> }
>
>
> --
>
>
>
>
>
> Mit freundlichem Gruß,
>
> Andreas Plötzeneder
> CEO
> ihr ploetzeneder it-solutions Team
> Mobile Development – Desktopanwendungen – Webanwendungen
> Tel:  +43 720 30 30 24 10
> Fax: +43 720 30 30 24 20
> Email: info at ploetzeneder-it.com
> web:   http://www.ploetzeneder-it.com
>
> Der Inhalt dieser E-Mail samt aller Anhänge ist vertraulich und ausschließlich für den Adressaten bestimmt. Wenn Sie nicht der vorgesehene Adressat dieser E-Mail oder dessen Vertreter sind, so löschen sie diese bitte und informieren Sie den Absender. Jede Form der Verbreitung oder Veröffentlichung der E-Mail, sei es in ihrer Gesamtheit oder in Teilen, die nicht ihrem Zweck dient, ist unzulässig. Das Internet kann die Unversehrtheit dieser Mitteilung nicht garantieren. ploetzeneder it-solutions übernimmt daher keine Haftung, falls die E-Mail geändert wurde.
>
>
>
> _______________________________________________
> MonoTouch mailing list
> MonoTouch at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/monotouch
>


More information about the MonoTouch mailing list