Example #1
0
 void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) {
     switch (connectionId)
     {
     case 1:
     this.MainRibbon = ((DevComponents.WpfRibbon.Ribbon)(target));
     return;
     case 2:
     this.ribbonBarClipboard = ((DevComponents.WpfRibbon.RibbonBar)(target));
     return;
     case 3:
     this.ribbonBarDPO = ((DevComponents.WpfRibbon.RibbonBar)(target));
     return;
     case 4:
     this.ribbonBarTool = ((DevComponents.WpfRibbon.RibbonBar)(target));
     return;
     case 5:
     this.edtRowPerPage = ((DevComponents.WpfEditors.IntegerInput)(target));
     
     #line 151 "..\..\MainWindow.xaml"
     this.edtRowPerPage.ValueChanged += new System.Windows.RoutedEventHandler(this.edtRowPerPage_ValueChanged);
     
     #line default
     #line hidden
     return;
     case 6:
     this._statusServer = ((System.Windows.Controls.Primitives.StatusBarItem)(target));
     return;
     case 7:
     this.AppDock = ((DevComponents.WpfDock.DockSite)(target));
     return;
     case 8:
     this.rightPanel = ((DevComponents.WpfDock.SplitPanel)(target));
     return;
     case 9:
     this.dockWindowGroup = ((DevComponents.WpfDock.DockWindowGroup)(target));
     return;
     case 10:
     this.rightPanelTool = ((DevComponents.WpfDock.DockWindow)(target));
     return;
     case 11:
     this.renderView = ((DevComponents.WpfDock.SplitPanel)(target));
     return;
     case 12:
     this.dockGroup = ((DevComponents.WpfDock.DockWindowGroup)(target));
     return;
     case 13:
     this.renderWindow = ((DevComponents.WpfDock.DockWindow)(target));
     return;
     case 14:
     this.renderingDock = ((System.Windows.Controls.DockPanel)(target));
     return;
     case 15:
     this.dgPassenger = ((PAU.UserControls.ucPassenger)(target));
     return;
     case 16:
     this.dgDPO = ((PAU.UserControls.ucDPO)(target));
     return;
     case 17:
     this.dgNationality = ((PAU.UserControls.ucNationality)(target));
     return;
     }
     this._contentLoaded = true;
 }
Example #2
0
        private bool SpawnNewDockWindow(string header, out DataGrid grid)
        {
            DockWindow window = null;
            bool exist = false;
            grid = null;

            foreach (DockWindow w in DockGroup.Items)
            {
                string h = "";
                if (w.Header is TextBlock)
                {
                    TextBlock tb = (TextBlock)w.Header;
                    h = tb.Text;
                }
                else if (w.Header is string)
                {
                    h = (string)w.Header;
                }

                if (h.Equals(header, StringComparison.OrdinalIgnoreCase))
                {
                    exist = true;
                    window = w;
                    break;
                }
            }

            if (!exist)
            {
                window = new DockWindow();
                window.CanAutoHide = false;
                window.CanFloat = false;
                window.CanTearOff = false;
                window.CanClose = true;
                window.Header = header;

                DockPanel panel = new DockPanel();
                panel.LastChildFill = true;

                window.Content = panel;

                ucPassenger passengerGrid = new ucPassenger(this, header, false, false);
                passengerGrid.PagingEnabled = false;
                panel.Children.Add(passengerGrid);
                grid = passengerGrid.DataGrid;

                _mapWindowToGrid.Add(window, grid);

                DockGroup.Items.Add(window);

            }
            else
            {
                if (_mapWindowToGrid.ContainsKey(window))
                {
                    grid = _mapWindowToGrid[window];
                }
            }

            window.Visibility = Visibility.Visible;
            int index = DockGroup.Items.IndexOf(window);
            DockGroup.SelectedIndex = index;

            return exist;
        }