storyboard

Blend Interaction Behaviour gives "points to immutable instance" error

I have a UserControl that is a base class for other user controls, that are shown in "modal view". I want to have all user controls fading in, when shown and fading out when closed. I also want a behavior, so that the user can move the controls around.My contructor looks like this: var tg = new TransformGroup(); tg.Children.Add(new Scal...

How to edit a StoryBoard to put it in a Button Style ?

Hello, I've created a storyboard for a button in blend that I want it to apply everytime the button is pressed, So I tried to create a style,I've been stucked for a long time now. here is the code of my Storyboard: <Storyboard> <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.S...

WPF Storyboard delay in playing wma files

I'm a complete beginner in WPF and have an app that uses StoryBoard to play a sound. public void PlaySound() { MediaElement m = (MediaElement)audio.FindName("MySound.wma"); m.IsMuted = false; FrameworkElement audioKey = (FrameworkElement)keys.FindName("MySound"); Storyboard s = (Storyboard)audioKey.FindResource("MySound.wma"); s.Be...

How to properly create features, tests, stories and break them down.

I am trying to grasp the entire TDD methodology and as such, I don’t really know how to present this as a nice concise question so here is the long drawn out version. I seem to be experiencing a gap between the bowling (Martin), money (Feathers), and other similar game/simple examples and a fully functioning Enterprise app. I am trying ...

What is the point of using Storyboard as timer?

I've seen some examples of code where StoryBoard is used as Timer, such as: void Update() { if (_sb == null) { _sb = new Storyboard(); _sb.Completed += _sb_Completed; _sb.Duration = new Duration(TimeSpan.FromSeconds(1)); } if (_sb_completed) { _s...

XAML StoryBoard StackPanel

Hi, I am trying to add a storyBoard to my stack panel and bind the trigger to a code behind property, but the stackpanel is not responding to the property changes. here is the code: <Window x:Class="DirectAccess.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microso...

Setting a timeline's target in a storyboard

I have a class that contains a Camera property of type ProjectionCamera. I wish to animate the Camera.Position. I don't understand why the following does not work: void StartMove(Vector3D direction) { //Create animation var animation = new Point3DAnimation(); animation.From = new Point3D(); animation.To = animation.From ...

Shrink Panel in Silverlight Storyboard

I would like to have an item's width shrink on a click of a button. Right now I have two objects basically, when you click the button on objectA, a storyboard starts that rotates it around the x-axis and collapses it. Then it shows objectB by setting it's visibility to visible and rotates it around into view. All I want to add is setti...

Why Storyboard value wouldn't get from a resource or binding?

I have construction below and it works: <Storyboard x:Key="GrowOnStart"> <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(Canvas.Left)" Storyboard.TargetName="window"> <EasingDoubleKeyFrame KeyTime="0" Value="1024"/> Why it doesn't work if I try something like this: <EasingDoubleKeyFrame KeyTime="0" Value=...

SkipToFill for non-running storyboards

Hello, I have a storyboard with e.g. 2 animations. Now I want the user give the possibility to skip a complete storyboard, yet the animated properties shall be set to the final value of the animations. When the storyboard is already running, SkipToFill does a perfect job for this. But I also need something like SkipToFill for a storyboa...

Storyboard - No completed event

Hey. This is probably a simple question, but how do I know when a Storyboard animation has completed? I'm using .Net 3.0 so maybe that's why, but in my other projects (.net 4), there was a simple Completed event I could handle. What's the way to do it in WPF with .net 3.0? Thanks edit in response to comments: I guess the error lies e...

Silverlight scrolling animation utilizes large amounts of CPU time

In our app, we have some scrolling credits in a ChildWindow. When showing this window, our CPU utilization is very high. The text is using a BitmapCache and hardware acceleration is enabled. Even after removing the clipping rectangle and the drop shadow from the child window, the CPU usage climbs to 80-90%. When I enable redraw regio...

Using storyboard animations for mouseover and selection in WPF ListBoxItems

I've got a WPF app that has a listbox which I'm trying to apply some mouseover effects to. It all works fine when I use simple Setters to change the background color on mouseover/selection, but I figured it would look nicer if it animated between states, so I switched the Setters for enter/exit Storyboards. It all works nicely initially ...

Is it possible to update a DoubleAnimation.FromProperty without restarting the entire animation?

I'm not hugely familiar with a lot of WPF yet, so if this query betrays some clear misunderstandings I'd appreciate them being pointed out. What I'm trying to do (for good or ill) is synchronise a DoubleAnimation.FromProperty with the actual width of a StackPanel containing/running the animation. I originally tried doing this with data...

WPF: Storyboard set property overrides code behind?

Hi, I'm working on a wpf c# app and I have a question. I have a storyboard which at the end sets the property of a grid to Visibility.Visible. Now on my code behind when I try to set the visibility to hidden again after the storyboard has run, the visibility won't change! Is the storyboard still running somehow or is a storyboard set p...

WPF storyboard not running animations in parallel

Hi guys, I am trying to animate the main window, changing the width and the height. I use a DataTrigger in the main window style to change it but when I run it first triggers the width change and then the height change, I want both of them changing at the same time. <Storyboard x:Key="TransitToExecution"> <!-- This animation hides ...

How to wait for all storyboards on a control to finish?

I have created a custom control which has a style defined for it in themes/generic.xaml. The control defines some additional RoutedEvents. For these events the style, or any style that overrides it, could define EventTriggers that start a storyboard. When i raise a RoutedEvent from my control, how can i wait for all of these storyboards...

Silverlight: Delay in Storyboard's Completed event handler

The storyBoard_Completed event is invoked in a delay of about half a second after the visual animation had finished. Would be glad for some more eyes to check out my Storyboard XAML: <Storyboard x:Key="blaAnimation" Completed="storyBoard_Completed"> <DoubleAnimationUsingKeyFrames Storyboard.TargetName="bla1" Storyboard.Targ...

Is it possible to animate a LinearGradientBrush in WPF?

Is it possible to animate the StartPoint or EndPoint of a LinearGradientBrush? If so, what is the type of the Storyboard object used to animate the Points, as when I try the following I get "0,1" is not a valid value for Double, and I do realize I shouldn't be using the DoubleAnimationUsingKeyFrames type. Current Code: <UserControl.Tri...

Silverlight/WPF parenthetical value syntax in a Storyboard animation

Somehow in my WPF studies, this detail has escaped me. I've seen syntax of this sort: <UserControl.Resources> <Storyboard x:Name="myStoryboard"> <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)" ... > ... Why is the StoryBoard.TargetProperty value surrounded by parentheses? What does that mea...