Monday, May 27, 2013

Monotouch Dialog Simple pattern.

public class PrintDialog : DialogViewController
    {
        string path;
        public PrintDialog (string Path) : base (new RootElement(""))
        {
            path = Path;
            this.Pushing = true;
            this.Root = GetUI ();
            this.RefreshRequested += delegate {
                this.Root = GetUI();
                this.ReloadComplete();
            };
        }
        public RootElement GetUI()
        {
           // Generate Your Root Element
        }
    }


I like having my Monotouch Dialogs refresh on drag.

I also like my navigation controller.  Decided I'd post a small bit of code without implementation details that makes me very happy.