Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

The interface member can not be implemented

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    The interface member can not be implemented

    Hello!

    I am trying to implement my own add window.
    The documentation has guided me to the following code:

    HTML Code:
    public class AddOnFrameworkWindow : NTWindow, IWorkspacePersistence
        {
            public AddOnFrameworkWindow()
            {
                TabControl tc = new TabControl();
    
                TabControlManager.SetIsMovable(tc, true);
                TabControlManager.SetCanAddTabs(tc, true);
                TabControlManager.SetCanRemoveTabs(tc, true);
    
                TabControlManager.SetFactory(tc, new AddOnFrameworkWindowFactory());
    
                Content = tc;
            }
        }​
    But when I compile the code, I have the following error message:
    'NinjaTrader.NinjaScript.Indicators.AddOnFramework Window' does not implement the interface member 'NinjaTrader.Gui.Tools.IWorkspacePersistence.Resto re(System.Xml.Linq.XDocument, System.Xml.Linq.XElement)'.
    Is there any specific using declaration to be added except those in the "#region Using declarations" list when we create a new indicator?
    Could someone please points out where I am mistaking?

    I would appreciate any help.

    Best regards,

    #2
    Hello Stanfillirenfro,

    Thank you for your post.

    You also need to add the Restore() and Save() methods which are required for restoring the window from a workspace and saving the window to a workspace. The following page has a section "Setting Up Workspace Persistence" that covers this information:


    Please let us know if we may be of further assistance.

    Comment


      #3
      Many thanks NinjaTrader_Emily for your help.

      Now I am receiving another error message such as: XElement, XDocument can not be found. Are these specific "includes"?
      Could you please advise me how to fix this problem?

      Many thanks in advance.

      Comment


        #4
        Originally posted by Stanfillirenfro View Post
        Many thanks NinjaTrader_Emily for your help.

        Now I am receiving another error message such as: XElement, XDocument can not be found. Are these specific "includes"?
        Could you please advise me how to fix this problem?

        Many thanks in advance.
        I compared the AddOnFramework script with a fresh AddOn script created via the NinjaScript Wizard. It appears that the new script does not have the following using statement that includes the XElement and XDocument information needed:
        Code:
        using System.Xml.Linq;​
        Please add this to the Using Declarations region at the top of your script and it should resolve the compile errors.

        Thank you for your time and patience.

        Comment


          #5
          Thank again NinjaTrader_Emily for your help.

          I think I need other using statements. TabControl in
          Code:
          TabControl tc = new TabControl();
          and AddOnFrameworkWindowFactory in
          Code:
          TabControlManager.SetFactory(tc, new AddOnFrameworkWindowFactory());
          can not be found.

          I would really appreciate your help to find this statements.

          Many thanks in advance.

          Comment


            #6
            Hello Stanfillirenfro,

            Thank you for your reply.

            TabControl is associated with this using statement:
            using System.Windows.Controls;

            TabControlManager is associated with this using statement:
            ​using NinjaTrader.Gui.Tools;

            I was able to get this information from the "AddOn Framework NinjaScript Basic" file found on this page:


            I hovered my mouse over TabControl to see the class it is part of and did the same for TabControlManager. You may even be able to just compare your script's using declarations with those from the sample and copy whichever ones you are missing.

            Thank you for your time and patience.

            Comment


              #7
              Many thanks NinjaTrader_Emily for your valuable help.

              Sorry to disturb you again, but I am just failing to find the using statement of
              Code:
              AddOnFrameworkWindowFactory()
              .
              The error message is as followed:
              The namespace AddOnFrameworkWindowFactory can not be found.
              I have downloaded the file you have attached above and uploaded it. Only three of using statements were missing.

              Since the AddOnFrameworkWindowFactory() is a function, by hovering the mouse over it, the corresponding class can not been puped up.

              I would appreciate your help.

              Thanks in advance.

              Comment


                #8
                Hello Stanfillirenfro,

                The AddOnFrameworkWindowFactory class is a custom class that is explained on this page in the help guide:


                I highly suggest reviewing the "AddOn Development Overview" page and its subpages in the help guide:Unfortunately, in the support department at NinjaTrader it is against our policy to create, debug, or modify, code or logic for our clients. Further, we do not provide C# programming education services or one-on-one educational support in our NinjaScript Support department. This is so that we can maintain a high level of service for all of our clients as well as our associates.

                That said, through email or on the forum we are happy to answer any questions you may have about NinjaScript if you decide to code this yourself. We are also happy to assist with finding resources in our help guide as well as simple examples, and we are happy to assist with guiding you through the debugging process to assist you with understanding unexpected behavior.

                You can also contact a professional NinjaScript Consultant who would be eager to create or modify this script at your request or assist you with your script. The NinjaTrader Ecosystem has affiliate contacts who provide educational as well as consulting services. Please let me know if you would like our NinjaTrader Ecosystem team to follow up with you with a list of affiliate consultants who would be happy to create this script or any others at your request or provide one-on-one educational services.​

                Please let us know if we may be of further assistance.

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by Geovanny Suaza, 02-11-2026, 06:32 PM
                0 responses
                571 views
                0 likes
                Last Post Geovanny Suaza  
                Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                0 responses
                331 views
                1 like
                Last Post Geovanny Suaza  
                Started by Mindset, 02-09-2026, 11:44 AM
                0 responses
                101 views
                0 likes
                Last Post Mindset
                by Mindset
                 
                Started by Geovanny Suaza, 02-02-2026, 12:30 PM
                0 responses
                549 views
                1 like
                Last Post Geovanny Suaza  
                Started by RFrosty, 01-28-2026, 06:49 PM
                0 responses
                549 views
                1 like
                Last Post RFrosty
                by RFrosty
                 
                Working...
                X