I'm trying to access System.Windows.VisualStateManager by bringing in a DLL from the Silverlight platform into WPF. It's System.Windows.dll and it conflicts with another dll (WindowsBase.dll I believe) so I gave the assembly an alias to sort out complications there. In my code behind I can access all the classes/enums/what-not that I need but I need to add VisualStateGroups to the XAML of my page. So I added this:
xmlns:vsm="clr-namespace:System.Windows;assembly=PresentationFramework"
I need that for these elements:
<vsm:VisualStateManager.VisualStateGroups>
<vsm:VisualStateGroup x:Name="DragCue">
<vsm:VisualState x:Name="NoDrop">
The problem is that vsm seems to alias the namespace in WindowsBase.dll. What ever it really is doing, it's not letti开发者_开发知识库ng me access VisualStateManager, which I can successfully reference in code behind, and have successfully accessed in a test project to make sure it worked. It should have been as easy as just copying things over... Is there a way to explicitly say I only want xmlns:vsm to point to a namespace out of a particular aliased class?
I realize this topic is old, and you may have found a fix, but out of curiosity, why do you need to bring in a different Visual State Manager? WPF provides one that I thought was almost the same as Silverlight, and the Silverlight one just had some web related stuff going on.
精彩评论