Exemplo n.º 1
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();
            LableStatus.Font            = UIFont.SystemFontOfSize(21);
            View.BackgroundColor        = UIColor.FromRGB(237, 237, 237);
            ConstTopText.Constant       = 8 + NavigationController.NavigationBar.Frame.Height + 20;
            ButtonCheck.BackgroundColor = UIColor.FromRGB(239, 60, 57);
            ButtonCheck.SetTitle("Check", UIControlState.Normal);
            ButtonCheck.SetTitleColor(UIColor.White, UIControlState.Normal);
            ButtonCheck.Layer.CornerRadius = 5;
            ButtonCheck.ClipsToBounds      = true;
            TextCode.Placeholder           = "Write your work order here";
            //TextCode.ClearsOnBeginEditing = true;
            ButtonClose.SetImage(UIImage.FromBundle("CloseButton"), UIControlState.Normal);
            var noItemsView = NoItemsView.Create(TablePoints);

            TablePoints.BackgroundView       = noItemsView;
            TablePoints.BackgroundView.Alpha = 0;
            TablePoints.SeparatorStyle       = UITableViewCellSeparatorStyle.None;
            var leftIcon = new UIBarButtonItem[1]
            {
                new UIBarButtonItem(UIImage.FromBundle("NavBar").ImageWithRenderingMode(UIImageRenderingMode.AlwaysOriginal)
                                    , UIBarButtonItemStyle.Plain
                                    , (sender, args) =>
                {
                })
                {
                    Enabled = false
                }
            };

            _rightIcons = new UIBarButtonItem[1]
            {
                new UIBarButtonItem(UIImage.FromBundle("List").ImageWithRenderingMode(UIImageRenderingMode.AlwaysTemplate)
                                    , UIBarButtonItemStyle.Plain
                                    , (sender, args) =>
                {
                    _presenter?.ChangeViewTypeClicked();
                    TextCode.ResignFirstResponder();
                })
                {
                    TintColor = UIColor.FromRGB(239, 60, 57)
                }
            };
            NavigationItem.RightBarButtonItems = _rightIcons;
            NavigationItem.LeftBarButtonItems  = leftIcon;
            DismissKeyboardOnBackgroundTap();
            TextCode.ReturnKeyType = UIReturnKeyType.Done;
            TextCode.ShouldReturn += (textField) =>
            {
                textField.ResignFirstResponder();
                ButtonCheck.SendActionForControlEvents(UIControlEvent.TouchUpInside);
                return(true);
            };
        }
Exemplo n.º 2
0
 private void ChangeViewTypeClicked(object sender, EventArgs e)
 {
     _viewIcon.HideKeyboard();
     _presenter.ChangeViewTypeClicked();
 }