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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T04:59:25+00:00 2026-05-11T04:59:25+00:00

I’ve created a button control template where I want to change the glow color

  • 0

I’ve created a button control template where I want to change the glow color of the button on the xaml level. Here is what I mean.

<Button x:Name='btnClose' Template='{DynamicResource GlassButton}' Width='32' Height='32' GlowStartColor='Red' GlowEndColor='DarkRed'>Button1</Button> 

The GlowStartColor and GlowEndColor are the properties I want to change on the control template.

Here’s my control template

    <ControlTemplate x:Key='DefaultGlassButton' TargetType='{x:Type Button}'>     <!-- Internal Resources -->     <ControlTemplate.Resources>         <Storyboard x:Key='Storyboard1' RepeatBehavior='Forever' AutoReverse='True'>             <DoubleAnimationUsingKeyFrames BeginTime='00:00:00' Storyboard.TargetName='Glow' Storyboard.TargetProperty='(UIElement.Opacity)'>                 <SplineDoubleKeyFrame KeyTime='00:00:00.3000000' Value='1'/>                 <SplineDoubleKeyFrame KeyTime='00:00:00.7000000' Value='1'/>             </DoubleAnimationUsingKeyFrames>             <ColorAnimationUsingKeyFrames BeginTime='00:00:00' Storyboard.TargetName='Glow' Storyboard.TargetProperty='(Panel.Background).(GradientBrush.GradientStops)[1].(GradientStop.Color)'>                 <SplineColorKeyFrame KeyTime='00:00:00.3000000' Value='#00C080FF'/>                 <SplineColorKeyFrame KeyTime='00:00:00.7000000' Value='#00C080FF'/>             </ColorAnimationUsingKeyFrames>         </Storyboard>         <Storyboard x:Key='Storyboard2'>             <DoubleAnimationUsingKeyFrames BeginTime='00:00:00' Storyboard.TargetName='Glow' Storyboard.TargetProperty='(UIElement.Opacity)'>                 <SplineDoubleKeyFrame KeyTime='00:00:00.3000000' Value='0.745'/>             </DoubleAnimationUsingKeyFrames>         </Storyboard>     </ControlTemplate.Resources>      <!-- Actual Control Template-->     <Border x:Name='OuterBorder' BorderBrush='#FFFFFFFF' BorderThickness='1,1,1,1' CornerRadius='4,4,4,4'>         <Border x:Name='InnerBorder' Background='#7F000000' BorderBrush='#FF000000' BorderThickness='1,1,1,1' CornerRadius='4,4,4,4'>             <Grid x:Name='MainGrid'>                 <Grid.RowDefinitions>                     <RowDefinition Height='0.5*'/>                     <RowDefinition Height='0.5*'/>                 </Grid.RowDefinitions>                 <Border x:Name='Glow' HorizontalAlignment='Stretch' Width='Auto' Opacity='0' Grid.RowSpan='2' CornerRadius='4,4,4,4'>                     <Border.Background>                         <RadialGradientBrush>                             <RadialGradientBrush.RelativeTransform>                                 <TransformGroup>                                     <ScaleTransform CenterX='0.5' CenterY='0.5' ScaleX='1.852' ScaleY='2.281'/>                                     <SkewTransform AngleX='0' AngleY='0' CenterX='0.5' CenterY='0.5'/>                                     <RotateTransform Angle='0' CenterX='0.5' CenterY='0.5'/>                                     <TranslateTransform X='0.014' Y='0.458'/>                                 </TransformGroup>                             </RadialGradientBrush.RelativeTransform>                             <GradientStop x:Name='GlowStartColor' Color='#B1FF80FF' Offset='0'/>                             <GradientStop x:Name='GlowEndColor' Color='#00C080FF' Offset='1'/>                         </RadialGradientBrush>                     </Border.Background>                 </Border>                 <ContentPresenter HorizontalAlignment='Center' VerticalAlignment='Center' Width='Auto' Grid.RowSpan='2'/>                 <Border x:Name='Shine' HorizontalAlignment='Stretch' Margin='0,0,0,0' CornerRadius='4,4,0,0'>                     <Border.Background>                         <LinearGradientBrush EndPoint='0.5,1' StartPoint='0.5,0'>                             <GradientStop x:Name='ShineStartColor' Color='#99FFFFFF' Offset='0'/>                             <GradientStop x:Name='ShineEndColor' Color='#26FFFFFF' Offset='1'/>                         </LinearGradientBrush>                     </Border.Background>                 </Border>             </Grid>         </Border>     </Border>      <!-- Triggers -->     <ControlTemplate.Triggers>         <Trigger Property='IsMouseOver' Value='True'>         </Trigger>         <Trigger Property='IsMouseOver' Value='True'>             <Trigger.EnterActions>                 <BeginStoryboard Storyboard='{StaticResource Storyboard1}'/>             </Trigger.EnterActions>             <Trigger.ExitActions>                 <BeginStoryboard x:Name='Storyboard2_BeginStoryboard' Storyboard='{StaticResource Storyboard2}'/>             </Trigger.ExitActions>         </Trigger>         <Trigger Property='IsPressed' Value='True'>             <Setter Property='Opacity' TargetName='Shine' Value='0.4'/>             <Setter Property='Background' TargetName='InnerBorder' Value='#CC000000'/>         </Trigger>     </ControlTemplate.Triggers> </ControlTemplate> 

Is this the proper way to do this, or is there a better way? Still fairly new to WPF and XAML so still have alot of learning to do.

  • 1 1 Answer
  • 1 View
  • 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. 2026-05-11T04:59:25+00:00Added an answer on May 11, 2026 at 4:59 am

    You need to either subclass Button and add those two properties or add those two properties as attached properties (by creating a new class with two attached dependency properties).

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

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
I want to count how many characters a certain string has in PHP, but
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I have a French site that I want to parse, but am running into
I want use html5's new tag to play a wav file (currently only supported
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
i want to parse a xhtml file and display in UITableView. what is the
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
I want to construct a data frame in an Rcpp function, but when I
Basically, what I'm trying to create is a page of div tags, each has

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.