• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

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.
    https://ninjatrader.com/support/foru...830#post759830
    Chelsea B.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by ajsdnyyrr1234DDf, Today, 09:39 AM
    2 responses
    13 views
    0 likes
    Last Post ajsdnyyrr1234DDf  
    Started by Delerium, Today, 10:03 AM
    2 responses
    11 views
    0 likes
    Last Post Delerium  
    Started by pjsmith, Today, 09:54 AM
    1 response
    6 views
    0 likes
    Last Post NinjaTrader_PatrickG  
    Started by afoschini, Today, 09:18 AM
    2 responses
    7 views
    0 likes
    Last Post afoschini  
    Started by rexsole, Today, 08:02 AM
    1 response
    18 views
    0 likes
    Last Post NinjaTrader_PatrickG  
    Working...
    X