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 3441646
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T08:34:41+00:00 2026-05-18T08:34:41+00:00

I am working with Wpf. I am using TabControl, In some specific condition TabItem’s

  • 0

I am working with Wpf. I am using TabControl, In some specific condition TabItem’s Header contains ‘*’ symbol. I need to write a trigger so that whenever there is any such content in the Header, TabItem’s Background changes. I am not able to find a way to do this in xaml. Any help plz.

  • 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-18T08:34:42+00:00Added an answer on May 18, 2026 at 8:34 am

    If I understand your question correctly, I think you’re having the same fundamental problem as the person who asked this question: WPF Trigger when property value is greater than a certain amount which unfortunately just links to another forum post: http://social.msdn.microsoft.com/Forums/en-US/wpf/thread/a8ad8c14-95aa-4ed4-b806-d0ae874a8d26/ but I will summarize it here:

    If you use a DataTrigger, instead of a regular trigger, and bind to the Header Text you can run the value through an IValueConverter, which will let you convert your string into a boolean True/False value based on whether it has an asterisk or not.

    <TabItem Header="TabItem">
        <TabItem.Style>
            <Style TargetType="TabItem">
                <Style.Triggers>
                    <DataTrigger Binding="{Binding Path=Header, RelativeSource={RelativeSource Self}, Converter={StaticResource HasAsteriskConverter}}" Value="True">
                        <Setter Property="Foreground" Value="Blue" />
                    </DataTrigger>
                </Style.Triggers>
            </Style>
        </TabItem.Style>
    <Grid />
    </TabItem>
    

    Note that my example sets the foreground, because the tab item style seems to override the background value and this still answers the original question.

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

Sidebar

Related Questions

OK, working on WPF(using MVVM) and came across a question, want some input. I
I'm working on a WPF application and is using the Model-View-ViewModel pattern. The application
I'm working in WPF using the MVVM pattern, and generally things seem to be
I'm working on creating a date/time user control in WPF using C# 2008. My
Background: I'm using WPF and C# (3.5) and am working on an app that
I'm working on an WPF application using the mvvm-light framework. I'm new to both
I am working on an outlook addin where we are using WPF user control
I'm working on a word processor-type app using the WPF RichTextBox. I'm using the
I'm working on my first WPF app. In this case, using VS 2010. My
I'm working on a WPF application that sometimes exhibits odd problems and appears to

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.