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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T02:53:35+00:00 2026-05-14T02:53:35+00:00

I have a simple Button control that contains an Image object as its content.

  • 0

I have a simple Button control that contains an Image object as its content. I want so set the Image opacity to 0.5 when the Button is disabled to provide an additional visual cue as to the Button status.

What is the simplest way to accomplish that result in XAML? Thanks for your help.

  • 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-14T02:53:35+00:00Added an answer on May 14, 2026 at 2:53 am

    Use a trigger in the Image style. (It would be more natural to put it in the Button style, but the Button style can’t easily affect the Image for annoying technical reasons. It could be done in the Button’s ControlTemplate but that’s overkill for what you want here.)

    <Button>
      <Image Source="something.png">
        <Image.Style>
          <Style TargetType="Image">
            <Style.Triggers>
              <Trigger Property="IsEnabled" Value="False">
                <Setter Property="Opacity" Value="0.5" />
              </Trigger>
            </Style.Triggers>
          </Style>
        </Image.Style>
      </Image>
    </Button>
    

    Note we are taking advantage here of the fact that the Image will be disabled when the Button is disabled, so we can trigger directly on the Image’s own IsEnabled property. In other cases, the Button property we want to trigger on might not be inherited by the Image; in that case, we’d need to use a DataTrigger with the FindAncestor RelativeSource to bind to the containing button.

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

Sidebar

Related Questions

I have a simple user control that contains some buttons that fire events which
I have a simple Jquery dialog box, that dialog contains a button which sends
I have the following simple button with an image as the template. The problem
This is probably a basic html/css question... I have a simple one-button form that
I have a site that has a simple HTML button in a form. All
I currently have a simple form that when you click the save button will
I'm now testing GKPeerPickerController. I have a simple app that just have a button
I have a Control I want to create. Here's a simple example of what
I have a web page that contains two textboxes and a button. I can't
I have a pretty simple window that contains an NSTextView. I'm calling readRTFDFromFile: 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.