I want to change a TextBlock.Text when its Opacity value is 0.0. The TextBlock being animated (Opacity fade from 1.0 to 0.0 over 3 seconds, repeating and autoreversing) by a DoubleAnimation on a Storyboard. Is this even possible using the DoubleAnimation or Storyboard Events? I've tried changing the Text Property of the TextBlock in CurrentStateInvalidated and CurrentTimeInvalidated but those only fire once.
EDIT: Here's the Trigger I have so far. This does not produce the expected result.
public MainWindow()
{
InitializeComponent();
this.Loaded += delegate
{
Style st = new Style();
st.TargetType = typeof(TextBlock);
DataTrigger t = new DataTrigger();
t.Value = (double)0.0;
t.Binding = new Binding()
{
Path = new PropertyPath("Opacity"),
RelativeSource = RelativeSource.Self
};
Setter se = new Setter();
se.Property = TextBlock.TextProperty;
se.Value = GetTickerString();
t.Setters.Add(se);
st.Triggers.Clear();
st.Triggers.Add(t);
txblkTickerText1.Style = st;
};
}