VisualStateManager is present both in WPF Toolkit and in PresentationFramework - how to enable

I need to use the VisualStateManager class in my WPF window, but since I referenced assemblies and the WPF Toolkit and PresentationFramework.dll in my project, C # cannot resolve VisualStateManager and gives a compilation error, for example - "The type exists as in" PresentationFramework. dll "and" WPFToolkit.dll " , and I can not continue.

How to tell the C # compiler to use the VisualStateManager class from any of the collectors and successfully compile the project?

+4
source share
3 answers

Starting with .NET4.0, the WPF Toolkit has been incorporated into the framework. You must be able to uninstall the WPF Toolkit, update some namespaces, and compile the application.

This is the approach we used in a project in which we recently upgraded from .NET3.5 to .NET 4.0

Yours faithfully,

+2
source

I had a similar problem, not with VisualStateManager, but with TemplateVisualStateAttribute, which I used for one of my custom classes.

WPFToolkit project reference alias change fixed for me like this question

0
source

I encountered the same problem, I canโ€™t remove the ToolKit because I need an AutoCompleteBox control, and I donโ€™t want to enable and modify the source code of the toolkit; therefore, the solution I used used the alias extern to refer to the toolkit.

To do this in Visual Studio, right-click on the WPFToolkit link and select properties โ†’ then change the โ€œaliasโ€ field to WpfToolKit or any alias of your choice.

0
source

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


All Articles