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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T04:50:55+00:00 2026-05-18T04:50:55+00:00

My button is supposed to change colour after certain amount of mouse overs, however

  • 0

My button is supposed to change colour after certain amount of mouse overs, however Multibinding doesn’t work properly.

Buttons in my application has the following style:

    <Style TargetType="Button">
        <EventSetter Event="MouseEnter" Handler="OnMouseEnterButton"/>
        <Style.Triggers>
            <MultiTrigger>
                <MultiTrigger.Conditions>
                    <Condition Property="Content" Value="0"/>
                    <Condition Property="IsMouseOver" Value="False"/>
                </MultiTrigger.Conditions>

                <MultiTrigger.Setters>
                    <Setter Property="Background" Value="Green"/>
                </MultiTrigger.Setters>
            </MultiTrigger>
        </Style.Triggers>
   </Style>

My Button looks like this:

<Button Name="button1">1</Button>

With the following event handler:

private void OnMouseEnterButton(object sender, RoutedEventArgs e)
{
    ((Button)sender).Content = (int.Parse(((Button)sender).Content.ToString())) + 1;
}

However if the value of the Button.Content condition is different from initial value. For example: <Condition Property="Content" Value="10"/> Triggers stop working.

  • 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-18T04:50:56+00:00Added an answer on May 18, 2026 at 4:50 am

    The problem is you are comparing a System.Int32 value (set in code) with a System.String value (defined in condition).

    There are two ways to fix this:

    1) Change style condition to:

        <Condition Property="Content">
            <Condition.Value>
                <sys:Int32>10</sys:Int32>
            </Condition.Value>
        </Condition>
    

    where you have to add a namespace xmlns:sys="clr-namespace:System;assembly=mscorlib"

    or change you code to :

    ((Button)sender).Content = ((int.Parse(((Button)sender).Content.ToString())) + 1).ToString();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

My script is supposed to dynamically change the background-position when clicking on a button
I have a button that is supposed to close a modal panel and render
PHere is what is supposed to happen: on button click, the submit of the
Here is what is supposed to happen: on button click, the submit of the
I have a button on an aspx page that is supposed to send an
Every row in my gridview is supposed to have a button/hyperlink that navigates to
Say I have 2 buttons witch supposed to perform the same operation but on
Suppose I have 3 radio buttons with different values for each radio button and
I have a frame with several radio buttons where the user is supposed to
When the user clicks a certain button at the bottom of the site 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.