Exemple #1
0
        private void InitializeComponent()
        {
            // initialize controls
            Name = new MultilineEntryElement("Name", "")
            {
                Lines = 3
            };
            Name.Changed += (sender, e) =>
            {
                Name.FetchValue();
                if (String.IsNullOrWhiteSpace(Name.Value))
                {
                    listsSection.Caption = "Navigate to list:";
                }
                else
                {
                    listsSection.Caption = "Add to list:";
                }
                Name.GetImmediateRootElement().Reload(listsSection, UITableViewRowAnimation.None);
            };

            listsSection = new Section("Navigate to list:");

            var pushToTalkButton = new ButtonListElement()
            {
                new Button()
                {
                    Background = "Images/redbutton.png",
                    Caption    = "Touch to speak",
                    Clicked    = SpeechButton_Click
                },
            };

            pushToTalkButton.Margin = 0f;

            // create the dialog
            var root = new RootElement("Add Item")
            {
                new Section()
                {
                    Name,
                },
                listsSection,
                new Section()
                {
                    pushToTalkButton
                },
            };

            // create and push the dialog view onto the nav stack
            dialogViewController = new DialogViewController(root, false);
            //dialogViewController.NavigationItem.HidesBackButton = true;
            dialogViewController.Title = NSBundle.MainBundle.LocalizedString("Add Item", "Add Item");

            // set up the "pull to refresh" feature
            dialogViewController.RefreshRequested += delegate
            {
                App.ViewModel.SyncCompleteArg = dialogViewController;
                App.ViewModel.SyncComplete   += RefreshHandler;
                App.ViewModel.SyncWithService();
            };

            this.PushViewController(dialogViewController, false);
        }
Exemple #2
0
        private void InitializeComponent()
        {
            // initialize controls
            Name = new MultilineEntryElement("Name", "") { Lines = 3 };
            Name.Changed += (sender, e) =>
            {
                Name.FetchValue();
                if (String.IsNullOrWhiteSpace(Name.Value))
                    listsSection.Caption = "Navigate to list:";
                else
                    listsSection.Caption = "Add to list:";
                Name.GetImmediateRootElement().Reload(listsSection, UITableViewRowAnimation.None);
            };

            listsSection = new Section("Navigate to list:");

            var pushToTalkButton = new ButtonListElement()
            {
                new Button()
                {
                    Background = "Images/redbutton.png",
                    Caption = "Touch to speak",
                    Clicked = SpeechButton_Click
                },
            };
            pushToTalkButton.Margin = 0f;

            // create the dialog
            var root = new RootElement("Add Item")
            {
                new Section()
                {
                    Name,
                },
                listsSection,
                new Section()
                {
                    pushToTalkButton
                },
            };

            // create and push the dialog view onto the nav stack
            dialogViewController = new DialogViewController(root, false);
            //dialogViewController.NavigationItem.HidesBackButton = true;
            dialogViewController.Title = NSBundle.MainBundle.LocalizedString("Add Item", "Add Item");

            // set up the "pull to refresh" feature
            dialogViewController.RefreshRequested += delegate
            {
                App.ViewModel.SyncCompleteArg = dialogViewController;
                App.ViewModel.SyncComplete += RefreshHandler;
                App.ViewModel.SyncWithService();
            };

            this.PushViewController(dialogViewController, false);
        }