XAML: Attachable VisualStateGroups property not found in VisualStateManager type

I am using VS2008 EE SP1 + WPF + XAML. In the beginning I added a link to it:

xmlns:vsm="clr-namespace:System.Windows;assembly=System.Windows"

I get this error at compile time:

<vsm:VisualStateManager.VisualStateGroups>  
   <vsm:VisualStateGroup x:Name="CommonStates">
                        <vsm:VisualStateGroup.Transitions>
                            <vsm:VisualTransition To="MouseOver" Duration="0:0:0.1"/>
                            <vsm:VisualTransition To="Pressed" Duration="0:0:0.1"/>
                        </vsm:VisualStateGroup.Transitions>
                        <vsm:VisualState x:Name="Normal"/>
                        <vsm:VisualState x:Name="MouseOver">
                            <Storyboard>
                                <DoubleAnimation Duration="0:0:0.1" Storyboard.TargetName="Highlight" Storyboard.TargetProperty="Opacity" To="1"/>
                            </Storyboard>

Does anyone know the reason and possible workaround?

+3
source share
1 answer

This will not work in WPF.NET 3.5sp1 application.

VisualStateManager , and related classes were introduced as part of Silverlight 3. It is not part of WPF in 3.5sp1, but added to WPF in version 4.

+6
source

Source: https://habr.com/ru/post/1724528/


All Articles