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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T14:19:18+00:00 2026-06-04T14:19:18+00:00

I have customized the button in this way: <Button BorderBrush=Transparent Name=DialButton Click=DialButton_Click > <StackPanel

  • 0

I have customized the button in this way:

<Button BorderBrush="Transparent" Name="DialButton" Click="DialButton_Click" >
            <StackPanel Orientation="Horizontal">
                <TextBlock FontSize="43" Name="lblNumber" Margin="0,-5,0,0" />
                <TextBlock FontSize="12" Margin="5,20,0,0" Name="lblCharacter" />
            </StackPanel>
</Button>

Now, when a user presses the button I want the OnPress state to change the color of the labels. I can do this if it’s a simple button by changing the Pressed state. But my label is placed inside a stack panel. How can I change the color in this case? Or in which event can I change the colors of the labels from C#.

  • 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-04T14:19:19+00:00Added an answer on June 4, 2026 at 2:19 pm

    You can use the PropertyChangeAction in cases like this. You can find this in the behaviors category on the Assets tab in Expression Blend.

    Apply this action on the labels. Change the trigger property to the DataTrigger instead of the default EventTrigger. Bind the trigger to the IsPressed property of the DialButton. Add two PropertyChangeActions per TextBlock and set the Value for one of the to true and the other one to false.

    Here’s an example for one of them. The other is exactly the same.

    <TextBlock FontSize="43" x:Name="lblNumber" Margin="0,-5,0,0" Text="25">
      <i:Interaction.Triggers>
        <ec:DataTrigger Binding="{Binding IsPressed, ElementName=DialButton}" Value="true">
          <ec:ChangePropertyAction PropertyName="Foreground">
            <ec:ChangePropertyAction.Value>
              <SolidColorBrush Color="Red"/>
            </ec:ChangePropertyAction.Value>
          </ec:ChangePropertyAction>
        </ec:DataTrigger>
        <ec:DataTrigger Binding="{Binding IsPressed, ElementName=DialButton}" Value="false">
          <ec:ChangePropertyAction PropertyName="Foreground">
            <ec:ChangePropertyAction.Value>
              <SolidColorBrush Color="{StaticResource PhoneForegroundColor}"/>
            </ec:ChangePropertyAction.Value>
          </ec:ChangePropertyAction>
        </ec:DataTrigger>
      </i:Interaction.Triggers>
    </TextBlock> 
    

    If the i: or ec: isn’t working, make sure you’ve got these lines at the top of your xaml file.

    xmlns:i="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity" 
    xmlns:ec="clr-namespace:Microsoft.Expression.Interactivity.Core;assembly=Microsoft.Expression.Interactions"
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to have my interface dynamically generate a customized button when I
I have this code to control two check boxes (buttons customized): - (IBAction) setCheckBox:
I have a button that I've customized and I want to use it on
I have an application that has a list of buttons and has customized tooltips.
I have customized the UIAlertView class. It's working perfectly. I don't want the bounce
In my magento project the search result not displays. I have customized my magento.
I have a customized version of SDL 1.2 and pygame 1.9.1 that implement SDL2's
Currently I have a customized people picker in sharepoint 2010, it searches the search
I've been looking at a lot of iOS user interfaces that have been customized.
I have UITableView and cell's are customized and have a UIImage with UIbutton, UIlabel

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.