• 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

How use custom XAML windows in charts?

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

    How use custom XAML windows in charts?



    we can add button on chart, like:

    var newControl = new System.Windows.Controls.TextBox { Name = "asd", Text ="WPF textbox", Width = 100, Background = Brushes.Green};
    myGrid.Children.Add(newControl);
    System.Windows.Controls.Grid.SetColumn((UIElement) newControl, 0);
    this.UserControlCollection.Add(myGrid);


    however, what steps need to be done (i am completely new to XAML field) to add WPF control instead of simple textbox, that has it's own .xaml file?


    so, it is like :

    var newControl = new CustomControls.CustomBox()....
    which has it's own xaml.

    #2
    Hello ttodua,

    Xaml files can be loaded with FileStream and XamlReader.Load().

    Below is a link to an example.
    http://ninjatrader.com/support/forum...059#post477059
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Thanks ChelseasB.
      That example is totally for AddonWindow.
      Could you show me an example in this already done indicator?
      just to replace textbox with a sample WPF element which has XAML:

      https://pastebin.com/raw/YdDDNUAN

      Comment


        #4
        Hello ttodua,

        I don't have any examples of this for an indicator specifically but the code to read from a xaml file is not different in an indicator. This is the same in any script.
        Chelsea B.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by catinabag, Today, 06:09 AM
        0 responses
        1 view
        0 likes
        Last Post catinabag  
        Started by Fiocco, Today, 05:59 AM
        0 responses
        2 views
        0 likes
        Last Post Fiocco
        by Fiocco
         
        Started by Perceivedshift, Today, 05:17 AM
        0 responses
        7 views
        0 likes
        Last Post Perceivedshift  
        Started by herbertmack, Today, 03:19 AM
        0 responses
        5 views
        0 likes
        Last Post herbertmack  
        Started by b16_aln, Today, 03:11 AM
        1 response
        130 views
        0 likes
        Last Post b16_aln
        by b16_aln
         
        Working...
        X