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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T02:15:23+00:00 2026-06-10T02:15:23+00:00

Trigger on an Inner property <Button BorderBrush=Black BorderThickness=2 x:Name=TimeButton ClickMode=Press Click=SetTime_Click Height=26 HorizontalAlignment=Left Margin=15,

  • 0

Trigger on an Inner property

<Button BorderBrush="Black" BorderThickness="2" x:Name="TimeButton" ClickMode="Press" Click="SetTime_Click" Height="26" HorizontalAlignment="Left" Margin="15, 0, 0, 0" Style="{StaticResource ImageButtonStyle}" ToolTip="Set Time" Width="26">
    <Button.Background>
        <ImageBrush x:Name="TimeImageBrush" ImageSource="/YCS;component/Images/Clock.png" Stretch="Uniform" TileMode="None" />                                        
    </Button.Background>  
</Button>

I need to make a trigger to set the ImageBrush in the Button.Background property to something different according to a boolean named HasHours which I can bind easily from my itemssource, any one knows how I can achieve this, I could not find any examples linking to this property….

I tried something like this

<Button.Triggers>
    <DataTrigger Binding="{Binding HasHours}" Value="false">
        <Setter TargetName="TimeImageBrush" Property="ImageSource" Value="/YCS;component/Images/ClockRed.png"/>
    </DataTrigger>
</Button.Triggers>

but it gives me this error:

Cannot find the static member ‘ImageSourceProperty’ on the type ‘ContentPresenter’.

Any help is much appreciated

  • 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-06-10T02:15:25+00:00Added an answer on June 10, 2026 at 2:15 am

    This is perhaps not exactly an answer to your question.

    First, i guess you won’t be able to add a DataTrigger to the Triggers collection, since that only supports EventTriggers.

    But, you could define the DataTrigger in the Button’s Style. Here, instead of setting the ImageBrush’s ImageSource property, simply set a new ImageBrush as Background.

    <Button ...>
        <Button.Style>
            <Style TargetType="Button">
                <Style.Triggers>
                    <DataTrigger Binding="{Binding HasHours}" Value="False">
                        <Setter Property="Background">
                            <Setter.Value>
                                <ImageBrush ImageSource="/YCS;component/Images/ClockRed.png"/>
                            </Setter.Value>
                        </Setter>
                    </DataTrigger>
                </Style.Triggers>                    
            </Style>
        </Button.Style>
    </Button>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

didSelectRowAtIndex doesn't trigger when I press on cell's UITextLabel even though it triggers if
I want to trigger an event with a button that changes the visibility of
How to move the content of the inner div up, without click any buttons,
My trigger takes an input. (NEW:input_id) With this input, it will generate new ID's
The trigger below is delaying my insert response. How can I prevent this? create
CREATE TRIGGER google_inventory BEFORE UPDATE ON `cataloginventory_stock_item` FOR EACH ROW BEGIN update `catalog_product_entity_int` set
I have a trigger that looks something like this: create or replace TRIGGER cluster_check
I want to trigger a long running background process (coded as a service) from
I written a trigger on smslog table ALTER TRIGGER [dbo].[mytrigger] ON [dbo].[smslog] AFTER INSERT
I am trying to trigger a call to twitter app and tweet some useful

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.