storyboard

Animating modelvisual3D objects in the viewport using C#

This our method for animating a selected ModelVisual3D in the viewport. We try to animate this specific model when clicking button2, but when we do, nothing happens. Any hints or suggestions on what we should do? private void button2_Click(object sender, RoutedEventArgs e) { //Create a storyboard for the animations. Sto...

Problem with EventTrigger for MouseUp, it triggers only on right-button

Please take a look at the following snippet: <EventTrigger RoutedEvent="Image.MouseUp"> <BeginStoryboard> <Storyboard> <DoubleAnimation Storyboard.TargetName="TranslateTransform" Storyboard.TargetProperty="X" From="1" To="0" Duration="0:0:0.15" /> <DoubleAni...

How to animate Opacity of a DropShadowEffect?

I have a WPF project with a border using the following style. The plan is to get the glow effect to fade in when the mouse moves over the border, and fade out when it leaves. <Style.Resources> <Storyboard x:Key="GlowOn"> <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetProperty="(DropShadowEffect.Opaci...

Get a Framework element from a Storyboard

I have a reference to an instance of a Storyboard object, and want to get hold of the Framework element that it is attached to / animating. I haven't been able to come up with any way of doing this. For example, in the XAML below, can I go from a reference to the Storyboard to get hold of either the Label or the Grid <Grid> <Grid.R...

Bind to an attached behavior on a Storyboard

I have created an attached dependency property for Storyboards, with the intention of enabling me to call a method on my ViewModel when a Storyboard Completed event fires: public static class StoryboardExtensions { public static ICommand GetCompletedCommand(DependencyObject target) { return (ICommand)target.GetValue(Comp...

How can I assign a Storyboard for single rows in a Silverlight DataGrid?

Hi I'm trying to make some rows of a DataGrid blink from white to red depending on their status. So, I have tried this: (e.row is the current row Im trying to make blink) Storyboard PendingStory = new Storyboard(); ColorAnimation PendingColorAnim = new ColorAnimation(); System.Windows.Duration PendingDur...

With WPF, how to link an animation with a ContentControl?

I don't know how to link successfully a StoryBoard to a TranslateTransform that is part of a ContentControl. I always get the following error when I try to run my StoryBoard: 'RenderTransform' property does not point to a DependencyObject in path '(Children).[0].(Content).(0).(1)'. I guess I don't know how to define a TargetPropert...

WPF - sequential animation simple example

Hi, I'm learning about WPF animation, and am confused about how to apply animations sequentially. As a simple example, I've got four rectangles in a uniform grid, and would like to change the color of each one sequentially. Here's what I have so far: public partial class Window1 : Window { Rectangle blueRect; Rectangle redRect...

Behaviours in ContentTemplate Triggers

Hi all, I’m loving behaviours and states in Blend 3. Typically I’m using the GoToStateAction behaviour to go to a state when an action (such as a button click) occurs. I’ve hit a snag with ControlTemplate triggers though. Blend lets me define states in the ControlTemplate, but I can’t work out how to assign the behaviour to use them....

Binding to the actual of a UserControl in Silverlight?

Seen some questions on SO but none answers my question. What I want to accomplish: I have a custom control (lets call it A) which moves around the canvas using a storyboard. And I want to bind another custom control's canvas (lets call it B) position onto the first control. Using the TransformToVisual(Application.Current.RootVisual) I...

WPF Remove Margin Animation Programmatically

How do I remove the margins of two sides of a stackpanel in an animation storyboard so it looks like the stackpanel has moved from the code behind? I need to do it in the code-behind because the number of stackpanels i use this animation on differs at runtime. Thanks :o) ...

Remove storyboard but keep animated value?

How can I remove a storyboard in XAML (i.e. RemoveStoryboard action in a DataTrigger) but keep the value that was animated. Similar to the Animatable.BeginAnimation: If the animation's BeginTime is null, any current animations will be removed and the current value of the property will be held. ...

WPF Expander Border Animation affects all contained controls?

I'm using a WPF Expander to display a number of analog process variables. I want to make the expander's border 'glow' (or flash) when one of these variables enters a 'warning' or 'alarm' state. To achieve this, I'm using some data triggers bound to a couple of boolean properties in my view model ('AnalogWarningActive' and 'AnalogAl...

WPF animate linear gradient

You can animate linear gradient by: <Storyboard x:Key="Focused" > <DoubleAnimation Duration="0:0:0.3" Storyboard.TargetProperty= "BorderBrush.GradientStops[0].Offset" Storyboard.TargetName="Bd"/> </Storyboard> Fine so far. You can set a color To animate it to. How can you set the To property to point to a gradient resource you already...

silverlight textblock animation style

I want to make a Style that can be applied to a TextBlock to create a loading text control. All I want is for the text's opacity to pulse from 0 to 1 and back until I hide the control. I know how to set up the double animation on the opacity, but I don't know how to attach the storyboard to the textblock in a style. Can this be done? ...

WPF: how to fire an EventTrigger (or Animation) when binding changes?

We have a simple animation that runs when a ToggleButton is checked and unchecked (expands a ListView's height and then collapses a ListView's height). How do you fire the EventTrigger (or Animation) for the <Storyboard x:Key="CommentsCollapse"> when the DataContext Binding changes in the x:Name="DetailsGrid" Grid in the following XAML?...

How do I animate UserControl objects using Storyboard and DoubleAnimation?

In my WPF application, I have a Canvas object that contains some UserControl objects. I wish to animate the UserControl objects within the Canvas using DoubleAnimation so that they go from the right of the Canvas to the left of the Canvas. This is how I have done it so far (by passing the UserControl objects into the function): pri...

Storyboard animation based on control template's control property

This is what I have A ControlTemplate for a button in my window.resource, having an ellipse with an outerglow (named -- TasksToggleButtonOuterGlowBitmapEffect) and a text A button that is using this template This is what I need 1. A storyboard that operates on the outerglow of the above mentioned ellipse 2. I shall trigger this sto...

Change a WPF image during a stroryboard

I was looking for a way to change an Image during a storyboard, or more specifically, change the Source property of the image to point to a new image resource. There seems to be a StringAnimationUsingKeyFrames and a DiscreteStringKeyFrame but this does not work (as far as I can tell) since the Source property of the Image is of type Imag...

WPF Storyboard does not pause

Hi All, I have a very simple Storyboard with an Int32Animation that targets a custom DP on my class. I have an OnChanged callback for my DP, that does a Console.WriteLine("Current Value: " + MyDP). When I run the storyboard, I can see the Console output just fine, and when I pause the storyboard, the Console output stops, BUT, when I ...