I have button styles which use VisualStateManger. Currently these styles in <Grid.Resources>
and working without any error. I tried to move these styles to Resource dictionary and it gives following error. Anyone know why it is working when style is in inside user control and not working when moved to resource dictionary.
the tag 'visualstatemanager.visualstategroups' does not exist in XML namespace http://schemas.microsoft.com/winfx/2006/xaml/presentation
I'm using .Net 3.5
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:vsm="clr-namespace:System.Windows;assembly=wpftoolkit"
xmlns:system="clr-namespace:System;assembly=mscorlib"
>
<Style x:Key="Home" BasedOn="{StaticResource PagingButton}" TargetType="{x:Type Button}">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType='Button'>
<Border Name='border' Background='{StaticResource HomeButtonBackground}' CornerRadius='5,5,0,0'>
<VisualStateManager.VisualStateGroups>
<VisualStateGroup x:Name="CommonStates">
<VisualState x:Name="Normal" >
<Storyboard>
<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(Border.Background)" Storyboard.TargetName="border">
<DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource ButtonBackground}"/>
</ObjectAnimationUsingKeyFrames>
</Storyboard>
</VisualState>
<VisualState x:Name="Pressed">
<Storyboard>
<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(Border.Background)" Storyboard.TargetName="border">
<DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource ButtonBackgroundPressed}"/>
</ObjectAnimationUsingKeyFrames>
</Storyboard>
</VisualState>
</VisualStateGroup>
</VisualStateManager.VisualStateGroups>
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</ResourceDictionary>