How to install MVVM Light Toolkit via NuGet
published on: 8/31/2011 | Views: N/A | Tags: MVVM
by WindowsPhoneGeek
In this quick tip I am going to talk about how to install MVVM Light Toolkit via NuGet.
To begin with let me first say in a few words what is "NuGet". Basically, NuGet is a Visual Studio extension that makes it easy to install and manage libraries and tools in Visual Studio projects. When you use NuGet to install a package, it copies the library files to your solution and automatically updates your project (add references, change config files, etc). If you remove a package, NuGet reverses whatever changes it made so that no clutter is left. Here is the official MVVM Light Toolkit NuGet page.
How To Install MVVM Light Toolkit via NuGet?
Here is how you can install MVVM Light Toolkit via NuGet in an easy way using only Visual Studio.
Step1. Create a new Widows Phone Application Project
Step2. If you have not used NuGet before then go to VisualStudio Tools-> ExtentionManager as demonstrated below:
Step3.Go to "Online Gallery" tab and type "nuget" in the search box. Next install "NuGet Package Manager" as demonstrated below:
Step4. After you have installed the NuGet Package Manager just right-click the References folder in your project and from the context menu select the "Manage NuGet Packages.." option:
Step5-a. A new window will appear where you can search for a particular package. So just start typing "mvvm light" in the search box and you should see the "MVVM Light" package on top. Next press install.
Step5-b: Alternatively you can Installing he "MVVM Light" package using the command line:
Just go to View ->Other Windows -> Package Manager Console:
Next type the following code in the console:
PM> Install-Package MvvmLight
Step6. After the installation has finished you should see the following:
Step7. That was all. You will notice that your project now references the MVVM Light assemblies and a new View Model folder has been automatically added to your project. Your project is now set up and you are ready to start using the MVVM Light in your application. A ViewModelLocator is also added to your project and included it in App.xaml.
Step8. Later if you would like to update to the latest version of MVVM Light, you can use the following NuGet command:
PM> Update-Package MvvmLight
That was all about how to install "MVVM Light Toolkit" via NuGet. I hope that the tip was helpful.
You can also follow us on Twitter @winphonegeek
Comments
posted by: Laurent Bugnion on 8/31/2011 1:35:00 PM
Note that there are 4 packages currently available:
- V3
- V3 (libraries only) which installs only the DLLs, no ViewModelLocator and ViewModel.
- V4 (preview)
- V4 (preview, libraries only).
V4 is a preview of the next version, which is already available for tests.
These packages can be found by looking for "mvvmlight" in the NuGet explorer.
Cheers, Laurent
Windows Phone Toolkit NuGet?
posted by: Rahmed Kumar on 8/31/2011 2:14:16 PM
Just wondered how to do this about the Windows Phone Toolkit. Can you please help me?
RE:Windows Phone Toolkit NuGet
posted by: winphonegeek on 8/31/2011 2:49:25 PM
Yes, Windows Phone Toolkit is also available via NuGet. We just posted a new article: "How to install Windows Phone Toolkit Aug 2011 via NuGet"
WP toolkit
posted by: Rahmed Kumar on 8/31/2011 3:04:17 PM
Thanks for the quick reply.
Our Top Articles & Free books
- Our FREE e-book: "Windows Phone Toolkit In Depth" 2nd edition
- 400+ Windows Phone Development articles in our Article Index
- 21 WP7 Toolkit in Depth articles covering all controls
- 12 WP7 Coding4Fun Toolkit in Depth articles covering all controls
- Performance Tips when creating WP7 apps
- Creating a WP7 Custom Control in 7 Steps
- WP7 working with VisualStates: How to make a ToggleSwitch from CheckBox
- What makes a WP7 App successful
- Creating theme friendly UI in WP7 using OpacityMask
- Implementing Windows Phone 7 DataTemplateSelector and CustomDataTemplateSelector
- All about Splash Screens in WP7 – Creating animated Splash Screen
- Getting Started with Unit Testing in Silverlight for WP7
- WP7 WatermarkedTextBox custom control
Our Top Tips & Samples
- All about WP7 Isolated Storage series
- WP7 Dynamically Generating DataTemplate in code
- 5 tips for a successful WP7 Marketplace submission
- WP7: Navigating to a page in different assembly
- WP7 ContextMenu: answers to popular questions
- WP7 ListBox: answers to popular questions
- WP7 working with Images: Content vs Resource build action
- WP7 Element Binding samples
- WP7 working with XML: reading, filtering and databinding
- Drawing in WP7: #2 Drawing shapes with finger
- WP7 TextBox Light theme problems - the solution
- Changing the WP7 Panorama Background Image dynamically with Animation
