Ejemplo n.º 1
0
        private void Initialize()
        {
            IsPanelHidden = _session.InterfaceSettings.IsSideBarHidden;

            _search = new SearchView(_library);
            Add(_search);

            var save = new UIButton(UIButtonType.RoundedRect);

            save.SetTitleColor(UIColor.Black, UIControlState.Normal);
            save.SetTitle("Save", UIControlState.Normal);
            save.TouchUpInside += SaveOnTouchUpInside;
            Add(save);

            _hideShow = new UIButton(UIButtonType.RoundedRect);
            _hideShow.SetTitleColor(UIColor.Black, UIControlState.Normal);
            _hideShow.SetTitle(_session.InterfaceSettings.IsSideBarHidden ? "Show" : "Hide", UIControlState.Normal);
            _hideShow.TouchUpInside += HideShowOnTouchUpInside;
            Add(_hideShow);

            Layout = () =>
            {
                _hideShow.SetSizeThatFits();
                _hideShow.ChangeWidth(70);
                _hideShow.PositionToRightAndCenterInside(this, 10);

                save.SetSizeThatFits();
                save.PositionToRightAndCenterInside(this, (int)_hideShow.Frame.Width + 20);

                _search.ChangeSize(Frame.Width - save.Frame.Width - _hideShow.Frame.Width - 20, Frame.Height);
                _search.ChangePosition(10, 0);
            };

            Layout();
        }