public getTable(string tableName, ClosableRefreshableTabItem CRTI, misc.TableGroup RDTT)
        {
            InitializeComponent();
            this.tableName     = tableName;
            this.closingTarget = CRTI;
            this.rdtt          = RDTT;
            switch (ClientKeeper.NPC.GetPrivileges())
            {
            case UserPrivileges.Admin:
                break;

            case UserPrivileges.Guest:
                DG.CanUserAddRows    = false;
                DG.CanUserDeleteRows = false;
                DG.IsReadOnly        = true;
                break;
            }
        }
        private void GetTable(object s, RoutedEventArgs e)
        {
            ClosableRefreshableTabItem CRTI = new ClosableRefreshableTabItem();
            TextBlock H = new TextBlock()
            {
                Text = "Редактирование: " + (s as FrameworkElement).Name
            };

            CRTI.SetHeader(H);
            CRTI.Style   = (Style)this.Resources["TabItemStyle"];
            CRTI.Content = new Frame();
            this.Tabs.Items.Add(CRTI);
            this.Tabs.SelectedIndex = this.Tabs.Items.Count - 1;

            Custom_Controls.ExtendedMenuItem EMI = s as Custom_Controls.ExtendedMenuItem;
            getTable GT = new getTable(EMI.OrderedTableName, CRTI, EMI.TableType);

            CRTI.RTB.Click += GT.RefreshClick;
            CRTI.CTB.Click += GT.CloseClick;
            (CRTI.Content as Frame).Content = GT;
            e.Handled = true;
        }