I'm wondering if anybody knows any good (free) behaviors for Blend/Silverlight 4
Specifically I'm looking for a behavior that I can drop on a TextBlock to make it scroll horizontally or a behavior that will "flash" text in a TextBlock (blinking text). But I'd love to hear about any behaviors you've been using or know about.
As an example, I've got a very basic "flashing text" behavior
public class FlashTextBehavior : Behavior<TextBlock>
{
Timer flashTimer;
public FlashTextBehavior()
{
}
protected override void OnAttached()
{
base.OnAttached();
flashTimer = new Timer(new TimerCallback((o) =>
{
Dispatcher.BeginInvoke(() =>
{
if (AssociatedObject.Visibility == Visibility.Visible)
AssociatedObject.Visibility = Visibility.Collapsed;
else
AssociatedObject.Visibility = Visibility.Visible;
});
}), null, 0, 750);
}
protected override void OnDetaching()
{
if (flashTimer != null)
flashTimer.Dispose();
base.OnDetaching();
}
}
Of course it can be improved upon, but I'm really interested in what other people have come up with.