MVVM Light templates not showing in "Add Item" menu (VS 2017)? - wpf

I've installed MVVM Light Toolkit through NuGet in VS 2017. The problem is that when I click "Add New Item" on any project, I don't see any MVVM templates that appear in MVVM Light tutorials.
They must look like this (but I don't see them in my project):
http://prntscr.com/n9bs1q
I found similar questions about VS 2012. The answers advise to search for C:\Program Files (x86)\Laurent Bugnion (GalaSoft)\Mvvm Light Toolkit\Vsix
But I have no such folder not in Program Files (x86), neither in Program Files.
Help me please, what should I do for the templates to appear?

MVVM Light NuGet can only add related resources (assemblies/.cs files) into the project. It wont add Templates into Visual Studio. To get templates in Visual Studio, you have to install MVVM Light Visual Studio Extension by following the below steps.
Open Visual Studio and go to Tools->Extensions and Updates.
In the Extensions and Updates window lick Online in the left pane.
In the search bar, type MVVM Light.
In the search results find MVVM Light for VS2017. Click Download and accept license.
Extension will be installed once Visual Studio gets restarted. Then you can get the templates.
UPDATE:
They have stopped support of Item Templates for MVVM Light in Visual Studio 2017. Its been there up to VS 2015. So you can only get Project Templates (File->New Project) in VS 2017 extension. You can see similar queries here.

Related

Unable to add WPF controls to the toolbox in Visual Studio 2013

First of all, I am completely new to Visual Studio, so please don't be too judgmental. I have a project I need to do in C# for my studies and my team uses a GitHub repository. I am in charge of creating the GUI and I am stuck at the very beggining.
I want to create the main application window using WPF, but when I use toolbox > choose items, I can not see the WPF tab. Also, when I am trying to enable the designer view, nothing happens.
Is it perhaps the software version being Visual Studio Community 2013 causing the issue? Do I need to have the Visual Studio Professional version in order to use WPF toolbox?
I'm attaching a link to the screen of the situation below.
As I presumed, all I needed was the professional version of Visual Studio. After obtaining and installing it everything works fine.

How do you edit styles in WPF 4.5 under Windows 7?

I just realised that Blend for Visual Studio 2012 does not support WPF apps under W7.
Once I opened a window I can only see raw XAML.
I need to edit a style for a chart dataseries System.Windows.Controls.DataVisualization.Charting. I normally use Blend for these kind of tasks - because it pulls default styles from somewhere and gives it to you in a blink of an eye.
now I am stuck.. what would you guys do?
P.S. here is nice summary for future references: http://blendinsider.com/technical/available-now-blend-for-visual-studio-2012-2012-08-15/
(scroll down to see the table what version supports what)
You need to use the Blend Preview that supports WPF apps.
http://expression.microsoft.com/en-us/jj154135
How can I design an animation with a WPF project in Visual Studio 2012?
Visual Studio 2012 Update 2 will have a released version of Blend which supports WPF...in the meantime use the preview one.
http://www.microsoft.com/expression/

WPFToolkit does not show up in Visual Studio 2010

I'm new to WPF and its toolkit and interested in using it and have found following URLs:
How do I reference the WPF Toolkit in Visual Studio 2010?
WPF Toolkit - Verify upgrade?
However, I'm not sure about the solution. I tried to add its DLL from Solution Explorer by adding its DLL under References. Yes, I do not see any WPFToolkit on Toolbox. I'm not sure why they mean by adding those lines to GAC. Any idea?
It has been installed and it is the latest version. Can somebody give me a direction?
Thanks.

Issues with WPF controls and Visual Studio Toolbox

Installing WPF Controls onto a machine is a messy task.
I tested installation in various systems including VMs. Following are the issues I have seen.
Controls not installed in the VS Toolbox.
Controls are isntalled but, cannot be dragged-n-dropped onto the WPF Window
Duplicate entries in the Toolbox sometimes!
I do not know what is wrong with the ToolboxControlsInstaller package. It messes up the Toolbox all the time, well most of the times.
Any guidelines what is the best practices to install WPF controls?
Our customers are very annoyed with these Toolbox behaviors.
Any help is welcome!
Regars,
-Datte
Our customers were annoyed too.
So I wrote this tutorial article covering toolbox installation once and for all:
Visual Studio Toolbox Control Integration
The most convenient approach seems to be using the Toolbox Controls Installer (TCI) package already pre-installed in VS2010 and newer. This includes just adding a key in registry, i.e.
HKLM\SOFTWARE\Microsoft\VisualStudio\10.0\ToolboxControlsInstaller\SampleControl, Version=3.7.0.0, Culture=neutral, PublicKeyToken=3cc4c7b61201d46c
You can also specify a custom tab name.
If you don't have a custom installer for your components, wrapping the DLLs in a VSI or VSIX package may be convenient. The VSIX is more powerful, support quiet install, custom tab name and uninstallation, but only VS2010 or newer.
Be careful with registry + VS2012. I discussed how the registry should be updated for VS2012, or simply call:
devenv.exe /ResetSkipPkgs
and then
devenv.exe /Setup
To clear things up.
Sometimes one also have to clear the Toolbox cache (TBD files), which seems to be a quite evil thing!
How do you install WPF controls into toolbox? However, these are all common issues with Visual Studio toolbox if you(or someone while installing other components) have done some mistakes in configuring. Refer the below links which has suggestions to avoid these issues.
Installing controls to VS 2010 procedure : How to add my custom WPF control to the ToolBox by using the WPF ToolBox Control template
Icons messed up issue : Visual studio 2005 toolbox icons messed up (though this is not reported with VS 2010, this solution would work for VS 2010 also).

WPF Application template is missing

My VS2010 install has WPF Browser application project template, and WPF User Control lib template, but no WPF Application template. Any suggestions would be appreciated.
For me I was missing ProjectTypeGuids in the .csproj file (a new project worked for me so just compared the project files), so if you add this to the .csproj file under PropertyGroup I then had all the WPF types available for adding:
<ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
This is kind of an old question, but I just hit the same issue and found the answer after the above didn't help, so....the solution for me was that I had to select a higher framework version (4.0) before the WPF Application template I was looking for became visible. If you find that you don't have the WPF or other project templates you expect available, you may want to check that you've selected the approriate framework version from the drop-down list immediately to the right of the "Recent Templates" label in the Add New Project dialog (it's near the top-left of the dialog in question).
This issue is a lot older than Visual Studio 2010. It goes back to 2005 at least. Lucky you, I was missing the New Class template once.
According to a bunch of sources, this trick works:
If you are missing a template that comes with your installation, run devenv.exe with the /installvstemplates switch.
You'll need to exit out of all Visual Studio instances for this to work.
The trick is mentioned in the MSDN documentation:
http://msdn.microsoft.com/en-us/library/0fyc0azh.aspx
Thread on the issue in a previous version of Visual Studio: http://social.msdn.microsoft.com/forums/en-US/vssetup/thread/8a5ae9e3-be7b-493d-831c-1e49e8103f26/
I wound up uninstalling and reinstalling my Visual Studio entirely but this trick probably would have fixed my problem.
Just had this in VS2017 Community Edition. This discreet message to add missing templates helped me:
In VS 2017
Make sure that you have .Net Desktop Tools checked in you VS
https://developercommunity.visualstudio.com/content/problem/44429/missing-wpf.html
For .NET 5 (or newer) is needed to have in .csproj in xml path Project/PropertyGroup:
<UseWPF>true</UseWPF>

Resources