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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T06:55:01+00:00 2026-05-29T06:55:01+00:00

When the value is Above24, the trigger doesn’t work.I have a textbox to test

  • 0

When the value is Above24, the trigger doesn’t work.I have a textbox to test the Convertter, it works. But this the trigger for this label doesn’t work.
The Converter is below the XAML Code

<Label x:Name="label" Content="{Binding Text, ElementName=textBox2}"HorizontalAlignment="Left" Margin="69,110,0,0" Width="122.63" VerticalAlignment="Top"Background="White"FontSize="26.667">

           <Style TargetType="Label">
                <Style.Triggers>
                    <DataTrigger Binding="{Binding Label.Content, Converter={StaticResource dc}}"   Value="Above24">
                        <Setter  Property="Foreground">
                            <Setter.Value>
                                <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                                    <GradientStop Color="Black" Offset="1"/>
                                    <GradientStop Color="#FFCE0A0A"/>
                                    <GradientStop Color="#FF2A0202" Offset="0.75"/>
                                    <GradientStop Color="#FF5B0404" Offset="0.5"/>
                                    <GradientStop Color="#FF9C0707" Offset="0.25"/>
                                </LinearGradientBrush>
                            </Setter.Value>
                        </Setter>
                    </DataTrigger>
                </Style.Triggers>
            </Style>
        </Label.Style>
    </Label>
class 
DataConverter
:
IValueConverter
{
        object IValueConverter.Convert
(object value, 
Type targetType,
 object parameter, 
System.Globalization.CultureInfo culture)
{
            if (value == null) return false;
            if (string.IsNullOrEmpty(value.ToString())) return false;
            if (Convert.ToInt32(value) < 18) return "Below18";
            if (Convert.ToInt32(value) > 24) return "Above24";
            return Convert.ToInt32(value) < 100;
        }
    object IValueConverter.ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
    {
        return null;
    }
}
  • 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-29T06:55:02+00:00Added an answer on May 29, 2026 at 6:55 am

    try, note the use of RelativeSource.

    <Style TargetType="Label"> 
                <Style.Triggers> 
                    <DataTrigger Binding="{Binding Content, RelativeSource={RelativeSource Self},Converter={StaticResource dc}}"   Value="Above24"> 
                        <Setter  Property="Foreground"> 
                            <Setter.Value> 
                                <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0"> 
                                    <GradientStop Color="Black" Offset="1"/> 
                                    <GradientStop Color="#FFCE0A0A"/> 
                                    <GradientStop Color="#FF2A0202" Offset="0.75"/> 
                                    <GradientStop Color="#FF5B0404" Offset="0.5"/> 
                                    <GradientStop Color="#FF9C0707" Offset="0.25"/> 
                                </LinearGradientBrush> 
                            </Setter.Value> 
                        </Setter> 
                    </DataTrigger> 
                </Style.Triggers> 
            </Style> 
        </Label.Style> 
    </Label> 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

@Value(#{myProperties.prop_part1_part2}) works but @Value(#{myProperties.prop.part1.part2}) Doesn't. How do I address a property with . in
The value of ig is being transfered fine, but I need to put this
using value.length != 0 ..doesn't work for the blank space situation
=VLOOKUP(VALUE($B$100);INDIRECT(2011.xls!&D$101;0);3;0) I have a sheet to send other people but i cannot send 2011.xls
This gets the value of whatever is selected in my dropdown menu. document.getElementById('newSkill').value I
SELECT value FROM table WHERE id IN (1,2,3, ... 500000) Have a query that
My value is stored within a string inside (). I need to return this
int value = 5; // this type of assignment is called an explicit assignment
Value Loss in my HTML editor and fileupload ctrl This is my sample code
//Value being parsed at this point is 150.00 var productValue = parseFloat($(#product-cost-value-value).text().replace(',', '.')); console.log(productValue);

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.