DoubleAnimation

22/06/2008 - 03:30 von Alex | Report spam
<Window x:Class="Window1"
xmlns="http://schemas.microsoft.com/winfx/...tion"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="Window1" Height="300" Width="300">


<Grid>
<ProgressBar Height="36" Margin="54,0,106,85" Name="pgTest"
VerticalAlignment="Bottom">
<ProgressBar.Triggers>
<!-- Animates the rectangle's opacity. -->
<EventTrigger RoutedEvent="Rectangle.Loaded">
<BeginStoryboard>
<Storyboard>
<DoubleAnimation
Storyboard.TargetName="pgTest"
Storyboard.TargetProperty="Value"
From="0.0" To="100.0" Duration="0:0:3"
AutoReverse="True" RepeatBehavior="Forever" />
</Storyboard>
</BeginStoryboard>
</EventTrigger>
</ProgressBar.Triggers>

</ProgressBar>


</Grid>
</Window>
 

Lesen sie die antworten

#1 Alex
22/06/2008 - 03:46 | Warnen spam
Sorry, bin grad begeistert vom Visual Studio!

Wusstet ihr, dass man in den Text "DoubleAnimation" klicken kann, und
dann recht sim Eigenschaftsfenster sogar die Eigenschaften der
Animation bearbeiten kann?

<Window x:Class="Window1"
xmlns="http://schemas.microsoft.com/winfx/...tion"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="Window1" Height="300" Width="300">


<Grid>
<ProgressBar Margin="50,119,35,121" Name="pgTest">
<ProgressBar.Triggers>
<!-- Animates the rectangle's opacity. -->
<EventTrigger RoutedEvent="Rectangle.Loaded">
<BeginStoryboard>
<Storyboard>
<DoubleAnimation
Storyboard.TargetName="pgTest"
Storyboard.TargetProperty="Value"
From="0.0" To="100.0" Duration="00:00:20"
AutoReverse="True" RepeatBehavior="3x"
BeginTime="00:00:10" />


<DoubleAnimation
Storyboard.TargetName="pgTest"

Storyboard.TargetProperty="Opacity"
From="0.01" To="1"
Duration="00:00:10" BeginTime="00:00:05"></DoubleAnimation>
</Storyboard>

</BeginStoryboard>
</EventTrigger>
</ProgressBar.Triggers>

</ProgressBar>


</Grid>
</Window>

Ähnliche fragen