Пример #1
0
        public AddOnFrameworkWindow()
        {
            // set Caption property (not Title), since Title is managed internally to properly combine selected Tab Header and Caption for display in the windows taskbar
            // This is the name displayed in the top-left of the window
            Caption = "AddOn Framework";

            // Set the default dimensions of the window
            Width  = 1085;
            Height = 900;

            // TabControl should be created for window content if tab features are wanted
            TabControl tc = new TabControl();

            // Attached properties defined in TabControlManager class should be set to achieve tab moving, adding/removing tabs
            TabControlManager.SetIsMovable(tc, true);
            TabControlManager.SetCanAddTabs(tc, true);
            TabControlManager.SetCanRemoveTabs(tc, true);

            // if ability to add new tabs is desired, TabControl has to have attached property "Factory" set.
            TabControlManager.SetFactory(tc, new AddOnFrameworkWindowFactory());
            Content = tc;

            /* In order to have link buttons functionality, tab control items must be derived from Tools.NTTabPage
             * They can be added using extention method AddNTTabPage(NTTabPage page) */
            tc.AddNTTabPage(new NinjaTraderAddOnProject.AddOnPage());

            // WorkspaceOptions property must be set
            Loaded += (o, e) =>
            {
                if (WorkspaceOptions == null)
                {
                    WorkspaceOptions = new WorkspaceOptions("AddOnFramework-" + Guid.NewGuid().ToString("N"), this);
                }
            };
        }
Пример #2
0
        /*
         * This is the constructor for the new NTWindow.
         * This document sets up the basic window before it gets displayed.
         * This also defines what TabPage will be used and the Window Factory that will be used in the window creation process.
         * This document is also where you would set Tab defaults like if this window will have a tab control, if the tabs are movable etc..
         */
        public AddonShellWindow()
        {
            // set Caption property (not Title), since Title is managed internally to properly combine selected Tab Header and Caption for display in the windows taskbar
            // This is the name displayed in the top-left of the window
            Caption = "Addon Shell Window";

            // Set the default dimensions of the window
            //Width = 800;
            //Height = 600;

            // TabControl should be created for window content if tab features are wanted
            TabControl tabControl = new TabControl();

            // Attached properties defined in TabControlManager class should be set to achieve tab moving, adding/removing tabs
            TabControlManager.SetIsMovable(tabControl, false);
            TabControlManager.SetCanAddTabs(tabControl, false);
            TabControlManager.SetCanRemoveTabs(tabControl, false);

            // if ability to add new tabs is desired, TabControl has to have attached property "Factory" set.
            TabControlManager.SetFactory(tabControl, new AddonShellWindowFactory());
            Content = tabControl;

            /* In order to have link buttons functionality, tab control items must be derived from Tools.NTTabPage
             * They can be added using extention method AddNTTabPage(NTTabPage page) */
            //tabControl.AddNTTabPage(new AddonShellWindowTabPage());
            tabControl.AddNTTabPage(new NinjaTrader.NinjaScript.AddOns.AddonShellWindow());

            // WorkspaceOptions property must be set
            // This is a inline Window Loaded handler, once the window loads, if the WorkspaceOptions are not present,
            // a new WorkspaceOptions object is created for this window using its GUID.
            Loaded += (o, e) =>
            {
                if (WorkspaceOptions == null)
                {
                    WorkspaceOptions = new WorkspaceOptions("AddonShellWindow" + Guid.NewGuid().ToString("N"), this);
                }
            };
        }