C
C#2y ago
Indeed

❔ WPF slide in from right to left Storyboard

Hi! Im trying to make my object appearing be animated, however i get
Severity Code Description Project File Line Suppression State
Error XDG0010 Cannot freeze this Storyboard timeline tree for use across threads. WPFTodo C:\Users\Indeed\Desktop\Stuff\Repositories\c#\WPFTodo\Views\TodoDisplayView.xaml 133
Severity Code Description Project File Line Suppression State
Error XDG0010 Cannot freeze this Storyboard timeline tree for use across threads. WPFTodo C:\Users\Indeed\Desktop\Stuff\Repositories\c#\WPFTodo\Views\TodoDisplayView.xaml 133
<Grid
x:Name="ContentGrid"
Grid.Column="1"
RenderTransformOrigin="1,0"
Visibility="{Binding DisplayMore, Converter={StaticResource boolToVis}}">
<Grid.RenderTransform>
<TranslateTransform X="{Binding ActualWidth, ElementName=ContentGrid}" />
</Grid.RenderTransform>
<Grid.Style>
<Style>
<Style.Triggers>
<DataTrigger
Binding="{Binding IsVisible, RelativeSource={RelativeSource Self}}"
Value="True">
<DataTrigger.EnterActions>
<BeginStoryboard Storyboard="{StaticResource SlideInRightToLeftStoryboard}" />
</DataTrigger.EnterActions>
<DataTrigger.ExitActions>
<BeginStoryboard Storyboard="{StaticResource SlideOutLeftToRightStoryboard}" />
</DataTrigger.ExitActions>
</DataTrigger>
</Style.Triggers>
</Style>
</Grid.Style>
</Grid>
<Grid
x:Name="ContentGrid"
Grid.Column="1"
RenderTransformOrigin="1,0"
Visibility="{Binding DisplayMore, Converter={StaticResource boolToVis}}">
<Grid.RenderTransform>
<TranslateTransform X="{Binding ActualWidth, ElementName=ContentGrid}" />
</Grid.RenderTransform>
<Grid.Style>
<Style>
<Style.Triggers>
<DataTrigger
Binding="{Binding IsVisible, RelativeSource={RelativeSource Self}}"
Value="True">
<DataTrigger.EnterActions>
<BeginStoryboard Storyboard="{StaticResource SlideInRightToLeftStoryboard}" />
</DataTrigger.EnterActions>
<DataTrigger.ExitActions>
<BeginStoryboard Storyboard="{StaticResource SlideOutLeftToRightStoryboard}" />
</DataTrigger.ExitActions>
</DataTrigger>
</Style.Triggers>
</Style>
</Grid.Style>
</Grid>
3 Replies
lycian
lycian2y ago
Do you have a binding in your storyboard? If so, it can't be frozen and you'll get this error
Indeed
Indeed2y ago
Yes, sadly it turned out to be the problem and I've had to move off the animation for now due to struggles with making it not hard coded (to scale it) :/ I think I'll later on use some sort of dependencyproperty to better handle position changing in sliding
Accord
Accord2y ago
Was this issue resolved? If so, run /close - otherwise I will mark this as stale and this post will be archived until there is new activity.