Announcement

Collapse
No announcement yet.

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:
    https://ninjatrader.com/support/foru...10#post1124507

    In the side panel I have been able to load an XAML using the technique outlined in the following post:
    https://ninjatrader.com/support/foru...egy#post759830

    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>
    <TabControl TabStripPlacement="Top">
    <TabItem Header="Tab1">
    <Label Content="Content goes here..." />
    </TabItem> <TabItem Header="Tab2" /> <TabItem Header="Tab3" />
    </TabControl>
    </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 sidlercom80, Today, 02:40 AM
        0 responses
        7 views
        0 likes
        Last Post sidlercom80  
        Started by b16_aln, Today, 01:52 AM
        0 responses
        7 views
        0 likes
        Last Post b16_aln
        by b16_aln
         
        Started by junkone, Yesterday, 08:55 PM
        1 response
        9 views
        0 likes
        Last Post NinjaTrader_Jason  
        Started by adaeiqendqw, 01-16-2021, 02:56 AM
        1 response
        15 views
        0 likes
        Last Post NinjaTrader_Jason  
        Started by [email protected], Yesterday, 06:10 PM
        5 responses
        16 views
        0 likes
        Last Post NinjaTrader_ChrisSch  
        Working...
        X