Пример #1
0
        private void ProgrammaticDockSite_OnLoaded(object sender, RoutedEventArgs e)
        {
            var dockSite = sender as DockSite;

            if (dockSite == null)
            {
                return;
            }

            LayoutManager.AddTabbedMdiHost(dockSite);

            var docWindow1 = LayoutManager.CreateDocumentWindow(dockSite, LayoutKey.Window, "Chart title", null, new ChartPanel());

            docWindow1.Activate(true);

            // Top right
            var twNews = LayoutManager.CreateToolWindow(LayoutKey.OrderLog, "News", LocalizedStrings.News, new NewsGrid(), true);

            LayoutManager.DockToolWindowToDockSite(dockSite, twNews, Dock.Right);

            // Bottom left
            var twSecurities = LayoutManager.CreateToolWindow(LayoutKey.Security, "Securities", LocalizedStrings.Securities,
                                                              _secView, true);

            LayoutManager.DockToolWindowToDockSite(dockSite, twSecurities, Dock.Bottom);

            var twMyTrades = LayoutManager.CreateToolWindow(LayoutKey.Trade, "MyTrades", LocalizedStrings.MyTrades,
                                                            new MyTradeGrid(), true);

            LayoutManager.DockToolWindowToToolWindow(twSecurities, twMyTrades, Direction.Content);

            // Bottom right
            var twOrders = LayoutManager.CreateToolWindow(LayoutKey.Order, "Orders", LocalizedStrings.Orders, new OrderGrid(),
                                                          true);

            LayoutManager.DockToolWindowToToolWindow(twSecurities, twOrders, Direction.ContentRight);

            var twOrderLog = LayoutManager.CreateToolWindow(LayoutKey.OrderLog, "OrderLog", LocalizedStrings.OrderLog,
                                                            new OrderLogGrid(), true);

            LayoutManager.DockToolWindowToToolWindow(twOrders, twOrderLog, Direction.Content);

            // Right bottom
            var twPositions = LayoutManager.CreateToolWindow(LayoutKey.Portfolio, "Positions", LocalizedStrings.Str972,
                                                             new PortfolioGrid(), true);

            LayoutManager.DockToolWindowToToolWindow(twNews, twPositions, Direction.ContentBottom);

            var twTrades = LayoutManager.CreateToolWindow(LayoutKey.Trade, "Trades", LocalizedStrings.Ticks, new TradeGrid(),
                                                          true);

            LayoutManager.DockToolWindowToToolWindow(twPositions, twTrades, Direction.Content);

            LayoutManager.IsLoaded = true;
        }