/*=========================*/
        #endregion

        #region Keywords
        /*=========================*/

        /// <summary>
        /// Add a gateway to an dataItem
        /// </summary>
        private void Page_dialog_New(object sender, RoutedEventArgs e)
        {
            // Create an editable new row
            Oltp.PageRow editVersion = Dialog_MakeEditVersion <Oltp.PageDataTable, Oltp.PageRow>(_pages, null);
            editVersion.AccountID   = this.Window.CurrentAccount.ID;
            editVersion.IsMonitored = true;

            // Show the dialog
            Page_dialog.Title = "New Page";

            _reservationTable = new Oltp.GatewayReservationDataTable();
            _reservationItems = new ObservableCollection <DataRow>();
            _reservationListView.ListView.ItemsSource = _reservationItems;

            Page_dialog.BeginEdit(editVersion, _pages);
        }
        /// <summary>
        /// Open the dialog
        /// </summary>
        private void Page_dialog_Open(object sender, RoutedEventArgs e)
        {
            // Set dataItem as current item
            ListViewItem currentItem = _listTable.GetParentListViewItem(e.OriginalSource as FrameworkElement);

            Oltp.PageRow row = currentItem.Content as Oltp.PageRow;

            // Show the dialog
            Page_dialog.Title = "Editing Page";

            // Disable editing page value
            //_urlField.IsReadOnly = true;

            Page_dialog.BeginEdit(
                Dialog_MakeEditVersion <Oltp.PageDataTable, Oltp.PageRow>(_pages, row),
                row
                );

            using (OltpLogicClient proxy = new OltpLogicClient())
            {
                _reservationTable = proxy.Service.GatewayReservation_GetByPage(Window.CurrentAccount.ID, row.GK);
            }

            _reservationItems = new ObservableCollection <DataRow>();
            foreach (DataRow r in _reservationTable.Rows)
            {
                _reservationItems.Add(r);
            }

            _reservationListView.ListView.ItemsSource = _reservationItems;

            // When opening, select it only if no more than one is already selected
            if (_listTable._listView.SelectedItems.Count < 2)
            {
                _listTable._listView.SelectedItems.Clear();
                currentItem.IsSelected = true;
            }
        }