Animating model properties
I have a CameraOffset value on my model. I can change it just fine using
But a storyboard defined like this would not work
Is there a way to make storyboard animations for model properties?
I tried all sorts of variations, most result in something like this
Code: Select all
<b:ChangePropertyAction TargetObject="{Binding}" PropertyName="CameraOffset" Value="300,100"/>Code: Select all
<PointAnimationUsingKeyFrames Storyboard.Target="{Binding}" Storyboard.TargetProperty="CameraOffset">I tried all sorts of variations, most result in something like this
LogNoesis: Error: Binding failed: Path=Self, Source=NoesisGUI.GameMapView(''), Target=PointAnimationUsingKeyFrames(''), TargetProperty=Storyboard.Target
-
-
sfernandez
Site Admin
- Posts: 3363
- Joined:
Re: Animating model properties
Yes, only dependency properties can be animated. So you can bind your model property to a UI element property with a TwoWay binding. Then you can animate the UI element property, and the animated value will be transferred to the model.
Could something like this work for you?
Could something like this work for you?
Code: Select all
<Decorator x:Name="test" RenderTransformOrigin="{Binding CameraOffset, Mode=TwoWay}"/>Re: Animating model properties
Thanks, I think this is a decent workaround to not have to declare a dependency property
Who is online
Users browsing this forum: No registered users and 5 guests