When the SelectedIndex property is read during animation the CLR wrapper will throw InvalidCastException because of invalid cast to int. The object returned from GetValue is DeferredReference object.
Hi, After further investigation it appears this is a framework issue appearing whenever the SelectedIndex is being changed using StoryBoard anitmation. It can be easily reproduced using WPF TabControl and animation that changes the SelectedIndex to 1 (after the index is changed try to select the first tab again): <Grid> <Grid.RowDefinitions> <RowDefinition Height="30"/> <RowDefinition Height="*"/> </Grid.RowDefinitions> <Button Content="Change tab" Width="75"> <Button.Triggers> <EventTrigger RoutedEvent="ButtonBase.Click"> <BeginStoryboard> <Storyboard> <Int32AnimationUsingKeyFrames Storyboard.TargetProperty="(TabControl.SelectedIndex)" Storyboard.TargetName="tabControl"> <EasingInt32KeyFrame KeyTime="0" Value="1" /> </Int32AnimationUsingKeyFrames> </Storyboard> </BeginStoryboard> </EventTrigger> </Button.Triggers> </Button> <TabControl x:Name="tabControl" Grid.Row="1"> <TabItem Header="TabItem1" /> <TabItem Header="TabItem2" /> </TabControl> </Grid> Regards, Kalin