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
157
votes
14 answers

Handling the window closing event with WPF / MVVM Light Toolkit

I'd like to handle the Closing event (when a user clicks the upper right 'X' button) of my window in order to eventually display a confirm message or/and cancel the closing. I know how to do this in the code-behind: subscribe to the Closing event of…
Olivier Payen
  • 15,198
  • 7
  • 41
  • 70
132
votes
4 answers

What is the template binding vs binding?

I could not understand BorderThickness="{TemplateBinding BorderThickness}. Here the code:
prjndhi
  • 1,915
  • 4
  • 17
  • 26
119
votes
3 answers

What is a ViewModelLocator and what are its pros/cons compared to DataTemplates?

Can someone give me a quick summary of what a ViewModelLocator is, how it works, and what the pros/cons are for using it compared to DataTemplates? I have tried finding info on Google but there seems to be many different implementations of it and no…
Rachel
  • 130,264
  • 66
  • 304
  • 490
60
votes
1 answer

how to use MVVMLight SimpleIoc?

I'm revamping my software which has messy Messenger.Default(...) bits. Is there any cheat sheet to know MVVMLight SimpleIoc usage (not general IoC description)?
Youngjae
  • 24,352
  • 18
  • 113
  • 198
59
votes
7 answers

MVVM Light Toolkit samples

Does anyone know opensource WPF applications created using MVVM Light Toolkit? Or any samples?
Neir0
  • 12,849
  • 28
  • 83
  • 139
53
votes
7 answers

ICommand CanExecute not triggering after PropertyChanged?

I got a WPF application that shows a button bound to a command like that:
nabulke
  • 11,025
  • 13
  • 65
  • 114
48
votes
6 answers

How to open a new window using MVVM Light Toolkit

I am using MVVM Light toolkit in my WPF application. I would like to know what is the best approach for opening a new window from an existing window. I have got this MainViewModel, which is responsible for MainWindow of my application. Now in the…
nabeelfarid
  • 4,156
  • 5
  • 42
  • 60
45
votes
3 answers

MVVM Light RelayCommand Parameters

I'm having an issue with passing a parameter to a relaycommand using the GalaSoft MVVM Light framework. I know that mvvm light's implementation of relaycommand doesn't use lambda parameters, so I did some research and found a way that people worked…
Saggio
  • 2,212
  • 6
  • 33
  • 50
43
votes
3 answers

MVVM Light: how to unregister Messenger

I love the MVVM Light's Messenger and its flexibility, however I'm experiencing memory leaks when I forget to explicitly unregister the recipients (in Silverlight 4). The cause is explained here, but I'm fine with it as I believe it's a good…
Francesco De Vittori
  • 9,100
  • 6
  • 33
  • 43
39
votes
1 answer

MVVM Light + Unity or Prism?

I am a little out-of-date in WPF right now and would be interested to hear peoples opinions on the latest version of Prism (which I used a couple of versions ago) vs an MVVM Light + Unity approach (which I have never done - decent examples URLs…
David
  • 682
  • 2
  • 9
  • 15
37
votes
3 answers

MVVM Light: Adding EventToCommand in XAML without Blend, easier way or snippet?

Can anyone tell me what the actual syntax is for EventToCommand class. From what I believe is that EventToCommand class works with Silverlight / WPF and WP7, hence I think its a better choice to go down. From what I believe, I can add any click…
Martin
  • 23,844
  • 55
  • 201
  • 327
35
votes
4 answers

MVVM, Unity, Prism, MEF, Caliburn - What should I use?

Please help - I'm getting lost! I'm writing a small desktop application which has some controls and some screen. This should later be integrated with a small web site, also having some screens. The idea is to let the user edit videos and select…
Avi
  • 15,696
  • 9
  • 39
  • 54
34
votes
2 answers

ViewModels in ViewModelLocator MVVM Light

Is it correct to store all my ViewModels in SimpleIoc? For instance I am having three pages MainPage, Photos, Directories (therefore three ViewModels -> MainVM, PhotosVM, DirectoriesVM). Should I set DataContext in each page to View Model Property…
fex
  • 3,488
  • 5
  • 30
  • 46
33
votes
8 answers

Implementing CollectionChanged

I have added CollectionChanged eventhandler(onCollectionChanged) to one of the ObservableCollection property. I have found out that onCollectionChanged method gets invoked only in case of add items or remove items to the collection, but not in the…
ns12345
  • 3,079
  • 5
  • 41
  • 62
33
votes
3 answers

prism vs mvvm light for wpf

We are starting a WPF with MVVM project and have to decide on PRISM or MVVM Light (I am new to both these frameworks). I have read through a few posts but still have a few questions. Can someone please throw some light on the following aspects…
Padmaja
  • 447
  • 2
  • 5
  • 11
1
2 3
99 100