/// <summary>
        /// Updates state.
        /// </summary>
        private void _UpdateState()
        {
            _handler = null;
            _collectionSource.Source = null;

            if (GridItemsSourceChanging != null)
            {
                GridItemsSourceChanging(this, EventArgs.Empty);
            }

            if (null != _schedulePage.CurrentSchedule)
            {
                _handler = new OrdersViewContextHandler(_schedulePage);

                _collectionSource.Source =
                    new SortedDataObjectCollection <Order>(_schedulePage.CurrentSchedule.UnassignedOrders, new CreationTimeComparer <Order>());

                if (GridItemsSourceChanged != null)
                {
                    GridItemsSourceChanged(this, EventArgs.Empty);
                }
            }

            _ChangeCommandButtonsSet();
        }
        /// <summary>
        /// Updates state when view changed visibility.
        /// </summary>
        private void _VisibileStateChanged(object sender, EventArgs e)
        {
            if (this.IsVisible)
            {
                if (null != _schedulePage)
                {
                    _UpdateState();
                    _SubscribeEvents();
                }

                // update Locked UI.
                _CheckLocked();
            }
            else
            {
                CancelNewObject(true);
                SaveEditedItem();

                _UnsubscribeEvents();

                _handler = null;
                _collectionSource.Source = null;
            }

            if (!_schedulePage.GeocodablePage.IsGeocodingInProcess && _schedulePage.EditingManager.EditedObject != null)
            {
                _schedulePage.CancelObjectEditing();
            }
        }
        /// <summary>
        /// Updates state.
        /// </summary>
        private void _UpdateState()
        {
            _handler = null;
            _collectionSource.Source = null;

            if (GridItemsSourceChanging != null)
                GridItemsSourceChanging(this, EventArgs.Empty);

            if (null != _schedulePage.CurrentSchedule)
            {
                _handler = new OrdersViewContextHandler(_schedulePage);

                _collectionSource.Source =
                   new SortedDataObjectCollection<Order>(_schedulePage.CurrentSchedule.UnassignedOrders, new CreationTimeComparer<Order>());

                if (GridItemsSourceChanged != null)
                    GridItemsSourceChanged(this, EventArgs.Empty);
            }

            _ChangeCommandButtonsSet();
        }