Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

Need help building simple Addon

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

    Need help building simple Addon

    I am trying to build a simple addon to reset all simulation accounts but I keep receiving this error when debugging with visual studio. I've racked my brain, Maybe someone smarter than me can look at my code.

    System.Windows.Markup.XamlParseException
    HResult=0x80131501
    Message='Failed to create a 'Click' from the text 'btnResetYes_Click'.' Line number '21' and line position '141'.
    Source=PresentationFramework
    StackTrace:
    at System.Windows.Markup.XamlReader.RewrapException(E xception e, IXamlLineInfo lineInfo, Uri baseUri)
    at System.Windows.Markup.WpfXamlLoader.Load(XamlReade r xamlReader, IXamlObjectWriterFactory writerFactory, Boolean skipJournaledProperties, Object rootObject, XamlObjectWriterSettings settings, Uri baseUri)
    at System.Windows.Markup.WpfXamlLoader.Load(XamlReade r xamlReader, Boolean skipJournaledProperties, Uri baseUri)
    at System.Windows.Markup.XamlReader.Load(XamlReader xamlReader, ParserContext parserContext)
    at System.Windows.Markup.XamlReader.Load(XmlReader reader, ParserContext parserContext, XamlParseMode parseMode)
    at System.Windows.Markup.XamlReader.Load(Stream stream, ParserContext parserContext)
    at NinjaTrader.Custom.AddOns.ResetAllSimAccounts.Rese tAllSimAccountsWindow.LoadXaml() in ..................8\bin\Custom\AddOns\ResetAllSimA ccounts.cs:line 129

    Inner Exception 1:
    ArgumentException: Cannot bind to the target method because its signature or security transparency is not compatible with that of the delegate type.
    Attached Files

    #2
    Hello cutzpr,

    The xaml files are not generated by visual studio and visual studio is not auto-generating cs code when editing the xaml behind the scenes this way.

    You will need to add the click event handler to the buttons click event from the code of the script.

    Below is a link to an example.
    Chelsea B.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Barry Milan, Yesterday, 10:35 PM
    3 responses
    10 views
    0 likes
    Last Post NinjaTrader_Manfred  
    Started by WeyldFalcon, 12-10-2020, 06:48 PM
    14 responses
    1,428 views
    0 likes
    Last Post Handclap0241  
    Started by DJ888, 04-16-2024, 06:09 PM
    2 responses
    9 views
    0 likes
    Last Post DJ888
    by DJ888
     
    Started by jeronymite, 04-12-2024, 04:26 PM
    3 responses
    41 views
    0 likes
    Last Post jeronymite  
    Started by bill2023, Yesterday, 08:51 AM
    2 responses
    16 views
    0 likes
    Last Post bill2023  
    Working...
    X