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

Displaying the WPF's normal TabControl using XAML

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

    Displaying the WPF's normal TabControl using XAML

    I have a working side panel based on the sample provided in the following post:
    Hello All, Moving forward this will be maintained in the help guide reference samples and no longer maintained on the forum. Creating Chart WPF (UI) Modifications from an Indicator - https://ninjatrader.com/support/help...ui)-modifi.htm (https://ninjatrader.com/support/helpGuides/nt8/creating-chart-wpf-(ui)-modifi.htm) I've


    In the side panel I have been able to load an XAML using the technique outlined in the following post:


    I am using the technique outlined in the LoadXaml method to load the XAML using FileStream(. XAML file )

    As I stated before, everything is working correctly.

    In the XAML file I would like to display a normal (not the one used in NT8) TabControl. Here is the XAML for it:

    Code:
    <Grid>[INDENT]<TabControl TabStripPlacement="Top">[/INDENT][INDENT=2]<TabItem Header="Tab1">[/INDENT][INDENT=3]<Label Content="Content goes here..." />[/INDENT][INDENT=2]
    </TabItem>
    
    <TabItem Header="Tab2" />
    
    <TabItem Header="Tab3" />[/INDENT][INDENT]
    </TabControl>[/INDENT]
     
    </Grid>
    Regardless of how I try to add a normal TabControl, I get NT8's TabControl. Please picture.

    In the screenshot I cannot even control the locations of the tab by setting the TabStripPlacement attribute to "Top".

    Based on the behavior that I am getting, I would guess that the NT8 TabControl layout/template is taking control over the standard/normal TabControl. How can I possibly display the normal TabControl? Is there any attribute that I can add to the TabControl tag to deactivate the NT8 TabControl layout?

    Once I get it to work, the TabItem will hold buttons and labels; It will never hold a NT8 chart.


    #2
    Got it!
    I need to add the
    Style="{x:Null}"
    attribute to disable the NT8 TabControl.

    Comment


      #3
      The next obvious question would be if I want the TabItems to look like the ones of NT8, what would be the Style value that I would have to use?

      Comment


        #4
        Hello GARZONJ,

        Thank you for the post.

        Just to clarify most WPF controls have styles applied through the use of the platforms styles. Because of that using WPF controls may differ from normal WPF design because they could be using a combination of styles or other applied items like style triggers/logic. Using a null style on the control would revert it back to a standard WPF control with no styles applied, that also means other child controls from that parent may not work as expected.

        For the tab items to look like NT8 you would really need to leave the tab control style because the tab items are part of the tab controls style. You may be able to individually apply the style to a tab item through some means but I am not aware if there is an individual style for that. We don't have any kind of list of the internal style names to be able to say what would be needed here, the style exists in internal code.

        The standard tab control with no style will not match the platforms overall look or use, if you plan to export this for others to use I would highly suggest leaving the default styles so that the skins work for the user.

        An alternative may be to hide your tab control and then make custom buttons in whatever style you wanted to control the tab control.



        Please let me know if I may be of additional assistance.

        JesseNinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by bortz, 11-06-2023, 08:04 AM
        47 responses
        1,606 views
        0 likes
        Last Post aligator  
        Started by jaybedreamin, Today, 05:56 PM
        0 responses
        8 views
        0 likes
        Last Post jaybedreamin  
        Started by DJ888, 04-16-2024, 06:09 PM
        6 responses
        18 views
        0 likes
        Last Post DJ888
        by DJ888
         
        Started by Jon17, Today, 04:33 PM
        0 responses
        4 views
        0 likes
        Last Post Jon17
        by Jon17
         
        Started by Javierw.ok, Today, 04:12 PM
        0 responses
        13 views
        0 likes
        Last Post Javierw.ok  
        Working...
        X