Пример #1
0
        public UIListPager()
        {
            _firstCommand    = new UIListPagerCommand(this, UIListPagerCommandType.FirstPage, -1);
            _lastCommand     = new UIListPagerCommand(this, UIListPagerCommandType.LastPage, -1);
            _nextCommand     = new UIListPagerCommand(this, UIListPagerCommandType.NextPage, -1);
            _previousCommand = new UIListPagerCommand(this, UIListPagerCommandType.PreviousPage, -1);

            _commands = new UIListPagerCommand[0];
        }
Пример #2
0
        private void resetPageCommands()
        {
            Debug.Assert(_commands.Length == PageCommands.Count);
            Debug.Assert(CheckAccess());

            if (_commands.Length != this.PageCount)
            {
                UIListPagerCommand[] newCommands = new UIListPagerCommand[this.PageCount];
                for (int i = 0; i < newCommands.Length; i++)
                {
                    if (i < _commands.Length)
                    {
                        newCommands[i] = _commands[i];
                    }
                    else
                    {
                        newCommands[i] = new UIListPagerCommand(this, UIListPagerCommandType.SpecificPage, i);
                    }
                }

                _commands = newCommands;
                SetValue(PageCommandsPropertyKey, new ReadOnlyCollection <UIListPagerCommand>(_commands));
            }
        }