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 knowmad, Today, 03:52 AM
    0 responses
    16 views
    0 likes
    Last Post knowmad
    by knowmad
     
    Started by tradingnasdaqprueba, Today, 03:42 AM
    0 responses
    11 views
    0 likes
    Last Post tradingnasdaqprueba  
    Started by Haiasi, 04-25-2024, 06:53 PM
    4 responses
    63 views
    0 likes
    Last Post effraenk  
    Started by ccbiasi, 11-23-2017, 06:06 AM
    5 responses
    2,210 views
    0 likes
    Last Post leodavis  
    Started by kujista, Yesterday, 12:39 AM
    2 responses
    14 views
    0 likes
    Last Post kujista
    by kujista
     
    Working...
    X