Questions tagged [mvvm-light]

The MVVM Light Toolkit is a set of components helping people to get started with the Model - View - ViewModel pattern in Silverlight, WPF, Xamarin, .NET Core and Windows Phone. It is a light and pragmatic framework that contains only the essential components needed.

The MVVM Light Toolkit is a set of components helping people to get started with the Model - View - ViewModel pattern in Silverlight, WPF, Xamarin, .NET Core and Windows Phone. It is a light and pragmatic framework that contains only the essential components needed.

The main purpose of the toolkit is to accelerate the creation and development of MVVM applications in WPF, Xamarin, .NET Core, Silverlight and Windows Phone.

Like other MVVM implementations, the toolkit helps users to separate the View from the Model which creates applications that are cleaner and easier to maintain and to extend. It also creates testable applications and allows to have a much thinner user interface layer (which is more difficult to test automatically).

More information about the MVVM Light Toolkit can be found on http://www.galasoft.ch/mvvm .

Currently there are versions for .Net 4.5, 4 & 3.5 and a portable version as well.

2856 questions
15
votes
1 answer

InvalidCastException with share target on Windows 8

I'm experimenting with Windows 8 "Metro Styled Apps", MVVM Light and want to create a share target - so far so good. But if I'm in the OnShareTargetActivated method and want to add an item to an ObservableCollection I catch an InvalidCastException…
Philipp
  • 15,377
  • 4
  • 35
  • 52
14
votes
2 answers

Where does the navigation logic belong, View, ViewModel, or elsewhere?

I a button in a view, bound to an ICommand property of the ViewModel (actually it's RelayCommand from mvvv-light) If the user clicks on the button I want to navigate to a new view. Of course the NavigationService is part of the View not the…
Ralph Shillington
  • 20,718
  • 23
  • 91
  • 154
14
votes
2 answers

Mvvm-Light Silverlight, using EventToCommand with a Combobox

I've hooked up a ComboBox's SelectedItemChangeEvent to a ICommand in my view model. Everything seems to be working fine however I do not know how to get the SelectedItem of the ComboxBox. I think I need to use the CommandParameter of the…
handles
  • 7,639
  • 17
  • 63
  • 85
14
votes
2 answers

MVVM- How can I select text in a textbox?

Is there a MVVM way to select text in a textbox? The MVVM framework that I am using is Laurent Bugnion's MVVM Light Toolkit.
Justin
  • 2,399
  • 4
  • 31
  • 50
13
votes
1 answer

'GalaSoft' MvvmLight could not be found in Portable project

I have cloned a solution, it contains multiple projects based on GalaSoft MvvmLight library, also it has two Portable Projects. I have installed all required nuget packages and references but I am not able to build these portable projects and its…
TaLha Khan
  • 2,413
  • 2
  • 25
  • 39
13
votes
4 answers

MVVM Light toolkit - maintained? Here today - gone tomorrow?

I have been taking a look at mvvm light toolkit, i must admit i haven't got a lot of experience with it but i live what i see.. I did use the mvvm toolkit (microsoft) but currently use vs 2010 and no templates are available as yet. I was looking for…
mark smith
  • 20,637
  • 47
  • 135
  • 187
13
votes
2 answers

MVVM Light "Type Not Found in cache"

I'm trying to convert my Windows Phone 8 Silverlight application to an 8.1 Phone app as part of a universal app. I don't know if thats relevant because this is the first time I've tried to implement view models correctly. I'd like to share data…
Real World
  • 1,593
  • 1
  • 21
  • 46
13
votes
1 answer

UserControl InputBindings Only working after pressing a button first

Buttons working fine as expected by clicking them. Issue: When the UserControl is loaded for the first time and i didn't press any button in it, the Keybinds are not working. After clicking a button manually the keybinds do work as intended. So…
Jim
  • 2,974
  • 2
  • 19
  • 29
12
votes
1 answer

What is the purpose of DataService and IDataService in MVVM Light

I'm starting to use MVVM Light version 4,and i can't understand: Why should i use DataService and IDataService? Should i create a dataservice for any class in model?
mahboub_mo
  • 2,908
  • 6
  • 32
  • 72
12
votes
1 answer

How to focus textbox in WP7 using MVVM?

The question has been asked a couple of times, unfortunately the answers only apply to WPF. Anyone know how to accomplish this in silverlight? Basically I need to focus on a certain textbox from code.
Edward
  • 7,346
  • 8
  • 62
  • 123
12
votes
4 answers

Looking for simple MVVM Light example

I'm trying to learn MVVM Light and am looking for a good basic example that shows a model and how to load different views. The template I see after downloading MVVM Light has no models and only one view. …
BillyPilgrim
  • 541
  • 3
  • 13
  • 25
12
votes
1 answer

Need comparison of MVVM / WPF / Silverlight Toolkits

I'm looking for a good article that compares MVVM Light, Caliburn Micro, Prism, and any other Silverlight / WPF / WP7 frameworks out there. I've seen some good articles on them individually, but nothing that really pits them against one another. Any…
Travis P
  • 644
  • 6
  • 19
12
votes
3 answers

How to have multiple pairs "View-ViewModel"?

I am building an application that is based on MVVM-Light. I am in the need of creating multiple instances of the same View, and each one should bind to its own ViewModel. The default ViewModelLocator implements ViewModels as singletons, therefore…
Anthares
  • 1,041
  • 1
  • 13
  • 30
12
votes
2 answers

ServiceLocationProvider must be set

I am using MVVM Light. When I add more value converters in my resources my app crashes with exception: An exception of type 'System.InvalidOperationException' occurred in Microsoft.Practices.ServiceLocation.DLL but was not handled in user…
v.g.
  • 1,076
  • 5
  • 19
  • 38
12
votes
2 answers

RelayCommand stops working after a while

I am facing some problems using GalaSoft's RelayCommand. I have a NextCommand property that works, but only several times. Afterwards, it stops working completely. You can try this out with the sample…
jayars
  • 1,347
  • 3
  • 13
  • 25