Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7031013
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T00:44:48+00:00 2026-05-28T00:44:48+00:00

I am learning to use styles in wpf and I am creating a style

  • 0

I am learning to use styles in wpf and I am creating a style for a Tab Control. I was wandering if someone can please tell how I can stop a style propagating down, for example I have a Tab control that where one of the tabitems holds another tabcontrol, of closable tabitems, (yes Nested TabControl O.o).

So in my first UserControl it holds the “Master” TabControl this UserControl also has a UserControl.Rescource that has a style for this TabControl. This style propogates down to the nested tabcontrol, how can I stop this from happening?

The other tab control is kept in a seperate usercontrol class.
Looks Something like this:

<UserControl.Resources>
    <Style TargetType="{x:Type TabControl}">
        <Setter Property="SnapsToDevicePixels" Value="true"/>
        <Setter Property="Template">
         ...
         <!-- The Style -->
         ...
</UserControl.Resources>

<TabControl SelectedIndex="{Binding Path=TabIndexFocus}">
    <TabItem Header="Tab1" IsEnabled="{Binding Path=IsEnabled_WorkSpace}" >
        <View:NestedTabControl/>
    </TabItem>
    <TabItem Header="Tab2">
        <View:SomeOtherView />
    </TabItem> 
    .....
</TabControl>

Thanks All 😀

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T00:44:49+00:00Added an answer on May 28, 2026 at 12:44 am

    Make a copy of the entire default Style Template, then I would recommend putting it in a separate resource dictionary but either way you will give the style template a unique x:Key name so like;

    <Style x:Key="NonDefaultTabControlStyle" Target="{x:Type TabControl}">
    

    Then in your tab control itself call your specific Style template like;

    <TabControl Style="{StaticResource NonDefaultTabControlStyle}" ....>
    

    When you specify the uniquely named Style template it will use it, when you don’t it will use the default. Hope this helps and best of luck!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Just learning about mercurial's --style and --template options that can be used on hg
I´m currently learning WPF and the use of MultiTrigger and Conditions to set some
Still fooling around with WPF and learning as I go. Trying now to build
I'm still learning the WPF ropes, so if the following question is trivial or
I'm learning how to use Draggable Views for Drupal 6 for the first time,
I'm learning to use GWT 2.0 and I'm trying to convert the StockWatcher demo
I'm learning how to use jquery with SharePoint. My example draws a red box
I am learning to use the CodeIgniter framework. I am coming form a world
I am learning how to use AJAX and PHP json_encode() . I am returning
I am learning how to use divs for a layout I made and I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.