Udostępnij za pośrednictwem


XAML Storyboards

<TextBlock>The the TextBlock below validates its input using the KeyDown event</TextBlock>

<StackPanel Orientation="Horizontal">

<TextBox Width="100" HorizontalAlignment="Left" KeyDown="TextBox_OnKeyDown"></TextBox>

<TextBlock x:Name="msgTextBlock" Text="Invalid Character-numbers only" Opacity="0" Foreground="#FFF51616">

<TextBlock.Resources>

<Storyboard x:Key="errorMessageAnimation">

<DoubleAnimation Storyboard.TargetName="msgTextBlock" Storyboard.TargetProperty="Opacity"

From="0" To="1.0" Duration="00:00:03" AutoReverse="True" >

</DoubleAnimation>

</Storyboard>

</TextBlock.Resources>

</TextBlock>

</StackPanel>