public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            var width = (float)UIScreen.MainScreen.Bounds.Width;

            ScrollViewContact.Frame         = new RectangleF(0f, 0f, width, 46.0f);
            ScrollViewContact.ScrollEnabled = true;
            ScrollViewContact.ShowsVerticalScrollIndicator   = false;
            ScrollViewContact.ShowsHorizontalScrollIndicator = true;
            ScrollViewContact.ContentSize = new CGSize(width, 46.0f);
            SaveButton.Enabled            = false;

            var toolbar = new UIToolbar();

            toolbar.BarStyle    = UIBarStyle.Default;
            toolbar.Translucent = true;
            toolbar.SizeToFit();

            var doneButton = new UIBarButtonItem(Application.LocalizedString("Validate"), UIBarButtonItemStyle.Done, (s, e) =>
            {
                AlertMessageTextField.ResignFirstResponder();
            });

            toolbar.SetItems(new UIBarButtonItem[] { doneButton }, true);
            AlertMessageTextField.InputAccessoryView         = toolbar;
            AddRecipientButton.TouchUpInside                += AddRecipientButton_TouchUpInside;
            AddRecipientFromContactBookButton.TouchUpInside += AddRecipientFromContactButton_TouchUpInside;
            SaveButton.TouchUpInside += SaveButton_TouchUpInside;
            App.Locator.AlertSOS.OnAlertSosChanged += AlertSOS_OnAlertSosChanged;
            EmptyDataButton.AddGestureRecognizer(new UITapGestureRecognizer(EmptyDataButton_TouchUpInside));

            // Keyboard popup
            _observer1 = NSNotificationCenter.DefaultCenter.AddObserver
                             (UIKeyboard.DidShowNotification, KeyBoardUpNotification);

            // Keyboard Down
            _observer2 = NSNotificationCenter.DefaultCenter.AddObserver
                             (UIKeyboard.WillHideNotification, KeyBoardDownNotification);
        }
Example #2
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            var width = (float)UIScreen.MainScreen.Bounds.Width;

            ScrollViewContact.Frame         = new RectangleF(0f, 0f, width, 46.0f);
            ScrollViewContact.ScrollEnabled = true;
            ScrollViewContact.ShowsVerticalScrollIndicator   = false;
            ScrollViewContact.ShowsHorizontalScrollIndicator = true;
            ScrollViewContact.ContentSize = new CGSize(width, 46.0f);

            var toolbar = new UIToolbar();

            toolbar.BarStyle    = UIBarStyle.Default;
            toolbar.Translucent = true;
            toolbar.SizeToFit();

            var doneButton = new UIBarButtonItem(Application.LocalizedString("Validate"), UIBarButtonItemStyle.Done, (s, e) =>
            {
                foreach (var view in View.Subviews)
                {
                    if (view.IsFirstResponder)
                    {
                        AlertMessageTextField.ResignFirstResponder();
                    }
                }
            });

            toolbar.SetItems(new UIBarButtonItem[] { doneButton }, true);
            AlertMessageTextField.InputAccessoryView         = toolbar;
            AddRecipientButton.TouchUpInside                += AddRecipientButton_TouchUpInside;
            AddRecipientFromContactBookButton.TouchUpInside += AddRecipientFromContactButton_TouchUpInside;
            EmptyDataButton.AddGestureRecognizer(new UITapGestureRecognizer(EmptyDataButton_TouchUpInside));
            NavigationItem.SetRightBarButtonItem(
                new UIBarButtonItem(Application.LocalizedString("OK"), UIBarButtonItemStyle.Bordered
                                    , (sender, args) => { SaveBarButton_Clicked(); })
                , true);
        }
Example #3
0
        void ReleaseDesignerOutlets()
        {
            if (AddRecipientButton != null)
            {
                AddRecipientButton.Dispose();
                AddRecipientButton = null;
            }

            if (AddRecipientFromContactBookButton != null)
            {
                AddRecipientFromContactBookButton.Dispose();
                AddRecipientFromContactBookButton = null;
            }

            if (AlertMessageTextField != null)
            {
                AlertMessageTextField.Dispose();
                AlertMessageTextField = null;
            }

            if (AlertTitleLabel != null)
            {
                AlertTitleLabel.Dispose();
                AlertTitleLabel = null;
            }

            if (AlertTitleTextField != null)
            {
                AlertTitleTextField.Dispose();
                AlertTitleTextField = null;
            }

            if (EmptyDataButton != null)
            {
                EmptyDataButton.Dispose();
                EmptyDataButton = null;
            }

            if (MaxSizeMessageLabel != null)
            {
                MaxSizeMessageLabel.Dispose();
                MaxSizeMessageLabel = null;
            }

            if (MessageTitleLabel != null)
            {
                MessageTitleLabel.Dispose();
                MessageTitleLabel = null;
            }

            if (RecipientsTitleLabel != null)
            {
                RecipientsTitleLabel.Dispose();
                RecipientsTitleLabel = null;
            }

            if (ScrollViewContact != null)
            {
                ScrollViewContact.Dispose();
                ScrollViewContact = null;
            }

            if (ViewBehindScrollView != null)
            {
                ViewBehindScrollView.Dispose();
                ViewBehindScrollView = null;
            }
        }
        void ReleaseDesignerOutlets()
        {
            if (AddRecipientButton != null)
            {
                AddRecipientButton.Dispose();
                AddRecipientButton = null;
            }

            if (AddRecipientFromContactBookButton != null)
            {
                AddRecipientFromContactBookButton.Dispose();
                AddRecipientFromContactBookButton = null;
            }

            if (AlertMessageTextField != null)
            {
                AlertMessageTextField.Dispose();
                AlertMessageTextField = null;
            }

            if (AlertTitleLabel != null)
            {
                AlertTitleLabel.Dispose();
                AlertTitleLabel = null;
            }

            if (AlertTitleTextField != null)
            {
                AlertTitleTextField.Dispose();
                AlertTitleTextField = null;
            }

            if (EmptyDataButton != null)
            {
                EmptyDataButton.Dispose();
                EmptyDataButton = null;
            }

            if (MessageTitleLabel != null)
            {
                MessageTitleLabel.Dispose();
                MessageTitleLabel = null;
            }

            if (RecipientsTitleLabel != null)
            {
                RecipientsTitleLabel.Dispose();
                RecipientsTitleLabel = null;
            }

            if (SaveButton != null)
            {
                SaveButton.Dispose();
                SaveButton = null;
            }

            if (ScrollAlertSOS != null)
            {
                ScrollAlertSOS.Dispose();
                ScrollAlertSOS = null;
            }

            if (ScrollViewContact != null)
            {
                ScrollViewContact.Dispose();
                ScrollViewContact = null;
            }

            if (SubTitle11Label != null)
            {
                SubTitle11Label.Dispose();
                SubTitle11Label = null;
            }

            if (SubTitle12Label != null)
            {
                SubTitle12Label.Dispose();
                SubTitle12Label = null;
            }

            if (SubTitle13Label != null)
            {
                SubTitle13Label.Dispose();
                SubTitle13Label = null;
            }

            if (Title1Label != null)
            {
                Title1Label.Dispose();
                Title1Label = null;
            }

            if (Title2Label != null)
            {
                Title2Label.Dispose();
                Title2Label = null;
            }

            if (ViewBehindScrollView != null)
            {
                ViewBehindScrollView.Dispose();
                ViewBehindScrollView = null;
            }
        }