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

  • Home
  • SEARCH
  • 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 7431837
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T09:21:28+00:00 2026-05-29T09:21:28+00:00

I have a button that loads more data into a datagrid when clicked. To

  • 0

I have a button that loads more data into a datagrid when clicked. To indicate progress, I change the text of the button to change from “More” to “Loading…” where the periods are animated. Next, I wanted to add a “glint” effect so that the text catches your eye. If you’ve used an iPhone/iPod Touch, I’m thinking of the effect on the “Slide To Unlock” text of the lock screen.

To do so, I shift a middle, lighter gradient stop from left to right. Because the animation continuously loops, I used offsets outside of the valid range to create a delay between the times when the light gradient stop is actually visible.

I got this implemented but I can tell that for some reason, the light gradient is not starting at the left edge of the text. It starts at about the ‘a’ in the “Loading”. I accepted that and it’s been in place for a while, but I’m now coming back to it just to try to understand why. It seems like maybe it’s using the measure of the original text when calculating the animation, but I thought the animations were supposed to apply to each other when in the same storyboard. Here is my code:

<UserControl.Resources>
    <local:EmptyBatchNumConverter x:Key="emptyBatchNumConverter" />

    <BeginStoryboard x:Key="bsbLoadingMore" x:Name="bsbLoadingMore">
        <Storyboard x:Name="sbLoadingMore">
            <StringAnimationUsingKeyFrames Storyboard.TargetName="txtBtnMoreText" Storyboard.TargetProperty="Text" Duration="0:0:2" FillBehavior="Stop" RepeatBehavior="Forever">
                <DiscreteStringKeyFrame Value="Loading" KeyTime="0:0:0" />
                <DiscreteStringKeyFrame Value="Loading." KeyTime="0:0:0.5" />
                <DiscreteStringKeyFrame Value="Loading.." KeyTime="0:0:1" />
                <DiscreteStringKeyFrame Value="Loading..." KeyTime="0:0:1.5" />
            </StringAnimationUsingKeyFrames>

            <!--Animate the OffSet of the light gradient stop for a "glint" effect. Using -4.5 to 4.5 to delay the visible effect between repeats (and 
                              control the speed relative to the duration). Using an extra .4 seconds to offset the frequency from the text animation. -->
            <DoubleAnimation Storyboard.TargetName="gs2" Storyboard.TargetProperty="Offset" From="-4.5" To="4.5" Duration="0:0:2.4" RepeatBehavior="Forever" />
        </Storyboard>
    </BeginStoryboard>
</UserControl.Resources>

...

<Button Name="btnMore" Grid.Row="1" Style="{StaticResource OasisGridMoreButton}" Click="btnMore_Click" Visibility="Visible" Height="16">
            <Button.Content>
                <TextBlock Name="txtBtnMoreText" MinWidth="48" Text="More..." /> <!--MinWidth = width of "Loading..."-->
            </Button.Content>
            <Button.Foreground>
                <LinearGradientBrush StartPoint="0.2,0" EndPoint="1,1">
                    <GradientStop x:Name="gs1" Color="Black"  Offset="0"/>
                    <GradientStop x:Name="gs2" Color="Cyan" Offset="-4.5"/>
                    <GradientStop x:Name="gs3" Color="Black" Offset="1" />
                </LinearGradientBrush>
            </Button.Foreground>
        </Button>
  • 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-29T09:21:29+00:00Added an answer on May 29, 2026 at 9:21 am

    Here is the problem:

    <LinearGradientBrush StartPoint="0.2,0" EndPoint="1,1">
    

    Change it to:

    <LinearGradientBrush StartPoint="0,0" EndPoint="1,1">
    

    Here is the full test app I made (slowed down glint to see it better):

    <Window
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d"
    x:Class="WpfApplication4.MainWindow"
    x:Name="Window"
    Title="MainWindow"
    Width="640" Height="480">
    <Window.Resources>
        <Storyboard x:Key="OnLoaded1"/>
    </Window.Resources>
    <Window.Triggers>
        <EventTrigger RoutedEvent="FrameworkElement.Loaded">
            <BeginStoryboard x:Name="bsbLoadingMore">
                    <Storyboard x:Name="sbLoadingMore">
                        <StringAnimationUsingKeyFrames Storyboard.TargetName="txtBtnMoreText" Storyboard.TargetProperty="Text" Duration="0:0:2" FillBehavior="Stop" RepeatBehavior="Forever">
                            <DiscreteStringKeyFrame Value="Loading" KeyTime="0:0:0" />
                            <DiscreteStringKeyFrame Value="Loading." KeyTime="0:0:0.5" />
                            <DiscreteStringKeyFrame Value="Loading.." KeyTime="0:0:1" />
                            <DiscreteStringKeyFrame Value="Loading..." KeyTime="0:0:1.5" />
                        </StringAnimationUsingKeyFrames>
    
                        <!--Animate the OffSet of the light gradient stop for a "glint" effect. Using -4.5 to 4.5 to delay the visible effect between repeats (and 
                                          control the speed relative to the duration). Using an extra .4 seconds to offset the frequency from the text animation. -->
                        <DoubleAnimation Storyboard.TargetName="gs2" Storyboard.TargetProperty="Offset" From="-4.5" To="4.5" Duration="0:0:5.4" RepeatBehavior="Forever" />
                    </Storyboard>
                </BeginStoryboard>
        </EventTrigger>
    </Window.Triggers>
    
    <Grid x:Name="LayoutRoot">
        <Button x:Name="btnMore"  Visibility="Visible" Margin="0,213,0,182" d:LayoutOverrides="GridBox">
            <Button.Foreground>
                <LinearGradientBrush StartPoint="0,0" EndPoint="1,1">
                    <GradientStop x:Name="gs1" Color="Black"  Offset="0"/>
                    <GradientStop x:Name="gs2" Color="Cyan" Offset="0"/>
                    <GradientStop x:Name="gs3" Color="Black" Offset="1" />
                </LinearGradientBrush>
            </Button.Foreground>
                <TextBlock x:Name="txtBtnMoreText" MinWidth="48" Text="More..." />
        </Button>
    </Grid>
    

    For some reason, it is not showing the </Window> at the end…

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

Sidebar

Related Questions

I have an initialize function that loads data into my textbox NameTextBox , and
I have a button that when clicked will run a stored procedure on a
I have a button that opens a dialog when clicked. The dialog displays a
I have a button that I would like to disable when the form submits
We have a button that saves asynchronously using AjaxToolKit/C#/.NET. I'm getting this in my
I have a Button that is looking at 2 comboboxes to make sure they
I have a button that I'm creating in a UIViewController like so: TOLoginButton* button
I have a button that, when pressed, will add a new HTML row. Within
I have a button that is programatically created, it's content is a stack panel
I have a button that plays an audio file on its click listener. If

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.