I'm using <VisualStateManager> in my xaml and it returns "VisualStateManger is not supported in a WPF project". I wonder that is it I need to install WPF Toolkit to enable it? Or I need to put a specific xlmns for xaml? By the way, I'm using visual studio 2013 and .NET Framework 4.5.
You can refer to the below link:
http://www.interact-sw.co.uk/iangblog/2008/06/10/visual-state
According to the link, VisualStateManager class isn’t in the Silverlight Xaml namespace, so we’ve had to qualify it with a namespace prefix:
xmlns:vsm="clr-namespace:System.Windows;assembly=System.Windows"
Related
It seems that a relatively new class: SvgImageSource can only be used in UWP. Is there any way to use it in a WPF project and how?
Please take a look at this framework:
SharpVectors
The other way is to convert your SVG files to XAML path geometry and using them easily.
It will be possible to use any UWP XAML UI in WPF using XAML Islands. This is currently available as a preview using the WindowsXamlHost control which is part of the Windows Community Toolkit. Also note, that when using UWP controls in WPF apps, the app will then work only on Windows 10 client PCs.
This is really a wanted feature, AutoCompleteBox (not AutoCompleteComboBox apparently).
However, visual studio 2012 cannot find the AutoCompleteBox control. But I have not tried in earlier version of vs, so it may not be a version matter.
I installed wpf toolkit, added those extensions to my WPF project:
WPF Toolkit
WPF Toolkit Design
WPF Toolkit Input Design
WPF Toolkit Input Visual Studio Design
WPF Toolkit Layout
WPF Toolkit Layout Visual Studio Design
WPF Toolkit Visual Studio Design.
Looks almost like virii to me. Every permutation of words are used...
Well well in my WPF project, I added
xmlns:toolkit="http://schemas.microsoft.com/wpf/2008/toolkit"
to a window and tried to also add a auto complete box like this:
<toolkit:AutoCompleteBox />
but AutoCompleteBox does not seem to exist, the first component that is listed when I have typed
<toolkit:
is ButtonBaseBehavior.
Not all the toolkit controls are included in the "main" namepace.
Let me explain it how are the toolkit dlls are built up:
You can also install the WPF toolkit through NuGet:
PM> Install-Package WPFToolkit
It will add three dlls to your project:
WPFToolkit.dll this contains the core/stable controls of toolkit which can be found in the xmlns:toolkit="http://schemas.microsoft.com/wpf/2008/toolkit"
System.Windows.Controls.Input.Toolkit.dll this dll contains the preview controls like AutoCompleteBox and Rating
System.Windows.Controls.Layout.Toolkit.dll this dll contains the preview layout controls like the Accordion
The preview controlls are not included in the main xmls namespace so you need to use a the namespace form the corresponding preview dll:
xmlns:controls="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Input.Toolkit"
<controls:AutoCompleteBox />
Add a reference to (Included in WPFToolkit):
System.Windows.Controls.Input.Toolkit.dll
and then in your xaml at the top:
xmlns:System_Windows_Controls="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Input.Toolkit"
and for using it anywhere in your code just like this:
<System_Windows_Controls:AutoCompleteBox />
Because the Ribbon control is now included in VS 2011 now, I think I don't need to install that seperately, just need to add a reference to that DLL.
However, there is no WPF Ribbon Application Template for Visual Studio 2011, therefore Net 4.5 Framework.
What should I do to get it? Install the Microsoft Ribbon for WPF October 2010 seperately?
Use the normal WPF application template. In the MainWindows.aspx replace the root <Window> with <RibbonWindow> and add, as the first child (or first child of the root layout control) a <Ribbon>.
(You could then use the project to create a user template in the normal manner.)
The ribbon control is now integrated into the .net 4.5 framework, see reference on msdn and here
I have to use VisualStateManager class in my WPF window, but as I have referenced the assemblies of both WPF Toolkit and PresentationFramework.dll in my project, C# is not able to resolve the VisualStateManager class and gives the compile error like -
"The type exists in both 'PresentationFramework.dll' and 'WPFToolkit.dll'" and I am not able to proceed.
How to tell C# compiler to use VisualStateManager class from either of the assemblies and get the project to compile successfully?
Since the .NET4.0, the WPF Toolkit has been included in the framework. You should be able to remove WPF Toolkit, update some namespaces and the application still compile.
This is an approach we have taken in a project where we recently upgraded from .NET3.5 to .NET 4.0
Best regards,
I had a similar problem, not to do with the VisualStateManager but with the TemplateVisualStateAttribute I was using for one of my custom classes.
Changing the WPFToolkit project reference alias fixed this for me, as per this question
I ran into the same problem, I can not remove the ToolKit because I need the AutoCompleteBox control, and I don not want to include and modify the toolkit source code; so the solution I used was using an extern alias for the toolkit reference.
To do this in Visual Studio right click on the WPFToolkit reference and select properties >> then change the "alias" field to WpfToolKit or any alias of your choice.
I installed the wpftoolkit.msi and added a reference to it, but it doesn't get dipslayed in the toolbox, is there anything else that needs to be done? I followed the instructions from the code plex site, I can access some of the controls from code, only a few, I added WPFToolkit as a reference, does any other reference need to be added for the chart controls and so that they can be accessed from the toolbox?
EDIT: I added all dlls in the folder and still cannot access the chart control.
Answer: I provided an answer bellow you neeed to include a different namespace for the charts the default one from the codeplex site doesn't include all controls.
I believe this is the answer if you want to add the charting controls to your toolbox.
If you just add a reference to what the codeplex site says you won't get all controls.
using Microsoft.Windows.Controls doesn't work you need to include the reference name, if you click on properties for the reference name you can copy name, for charting it is: System.Windows.Controls.DataVisualization.Toolkit
For the toolbox:
Go to your toolbox, right click create a new tab. In the new tab right click choose items add all the controls from the System.Windows.Controls.DataVisualization.Toolkit namespace. You should have all of them in the toolbox.
Here it is http://wpf.codeplex.com/releases/view/40535
Installation and Usage Instructions
Please note: The WPF Toolkit is dependent on .NET Framework 3.5 SP1. You must install .NET Framework 3.5 SP1 in order to use any features in the Toolkit.
Instructions for using the WPF Toolkit binaries:
Install .NET Framework 3.5 SP1
If you have a previous version of WPF Toolkit installed, uninstall it through the Remove Programs dialog on the Control Panel (look for "WPF Toolkit October 2008" or "WPF Toolkit January 2009" or "WPF Toolkit March 2009" or "WPF Toolkit June 2009")
Download the WPFToolkit_Binaries or WPFToolkit_BinariesAndSource
Run the WPFToolkit.msi to install the WPFToolkit.dll and WPF Toolkit design time binaries to your Program Files folder
Reference the binaries in your project:
Reference WPFToolkit.dll in your project
Add a using statement ("using Microsoft.Windows.Controls;") to the top of .cs files
Add a new xmlns (for example, xmlns:toolkit="http://schemas.microsoft.com/wpf/2008/toolkit") to the top of XAML files
Remember to use the namespace prefix (in the above example, ) in the body of your XAML