mvvm-light

UWP ResourceDictionary is not being loaded when I add a second object to it

百般思念 提交于 2019-12-24 00:34:33
问题 I have a UWP application for Windows 10 with MVVM Light plugged in. I store a ViewModelLocator in the App.Resources. When I have just a ViewModelLocator in my App.Resources, everything works fine. <Application.Resources> <viewModel:ViewModelLocator x:Key="Locator" /> </Application.Resources> As soon as I add a String, Converter or something similar, application doesn't crash but the ViewModelLocator constructor is not being called anymore. No errors or exceptions being thrown, just

MvvmLight message not firing when using local/anonymous action

感情迁移 提交于 2019-12-23 21:43:53
问题 MvvmLight messenger sometimes doesn't work when I use an anonymous action. If I pass a member variable or method as the action it works fine, but using an anonymous lambda or local variable doesn't work. private SongCollection songCollection; Action<bool> c; public MyService(SongCollection songCollection) { this.songCollection = songCollection; Action<bool> a = (bool isLoading) => { ChangeSong(songCollection.GetFirstSong()); }; Action<bool> b = OnLoadingComplete; //Using this instead of 'a'

Problem with MVVM implementation: Changes to selected item propogate to list, do not want that

你离开我真会死。 提交于 2019-12-23 13:22:13
问题 So I'm having this problem that hopefully you can help with. I'm writing a WPF application using MVVM Light as a framework. In this situation, I have a list of items, and the SelectedItem is bound to a details view where the user can edit the item. There is a Save button in this case for explicit saving of data. My problem is that when the user edits the data, the changes immediately shows up in the list. If the user cancels, it resets the selected item, but it's still changed. How do I

Silverlight Navigation using Mvvm-light(oobe)+MEF?

北城余情 提交于 2019-12-23 12:20:15
问题 What is the best approach for navigating between UserControls/Pages(out of browser experience)? I'm fairly new to Silverlight and even newer to the mvvm pattern. How well does the Navigation Framework Integrate with the MVVM Light Toolkit? A snippet for general application flow control with the two would be great. The plan was to use the Navigation Framework for general flow or using Jeremy Likeness's approach to region management(http://csharperimage.jeremylikness.com/search/label/regions)

Async command execution in MVVM light

杀马特。学长 韩版系。学妹 提交于 2019-12-23 09:37:27
问题 I am wondering why is MVVM light missing command with async execution? I believe there are many cases where this could be useful, so let me name one. Lets say that our UI contains one container that contains multiple screens. User can close a particular screen, or a container with multiple screens. Lets say that a user has issued a close command on the container. Container in return invokes close command on each screen, and it needs to wait for screen to be closed. This in practice can means

<Interface> is already registered error in blend using MVVMLightV4

亡梦爱人 提交于 2019-12-23 09:31:38
问题 I've been using MVVMLight for some time now and started using V4 since it was first made available. However one issue has always persisted with me which I've been unable to solve. If I create a project using the MVVM 4 project template the solution builds fine, runs fine and works ok in blend. However If I start my own project and install MVVMLight V4 using Nuget, as soon as I add even a basic DataService and enable the commented out code in the ViewModelLocator template and open up the

How to implement custom navigation service in mvvmlight

断了今生、忘了曾经 提交于 2019-12-23 08:23:41
问题 I am not quite comfortable with the existing MVVMlight navigation interface methods and that is very minimal and I want to implement my very own navigational interface in which I can expose sophisticated methods that manipulates the navigational stack and integrate it with the MVVM light. Any guidance on achieving this is very much appreciated Update: I would like to implement other transitions for movement between pages like page curl,flip,rotate etc 回答1: Here's a full implementation example

WPF How to add blend interaction trigger to style resource

ぃ、小莉子 提交于 2019-12-23 03:15:47
问题 I am using VS 2012, with WPF 4.5 I want to be able to add a blend interaction trigger to a style resource so that I can have that defined in one place (resource dictionary) and use in many places throughout my app. Specifically, I want to use the EventToCommand that comes with the MVVM-Light framework and have it inserted into a textbox style and attached to the LostFocus event of the textbox. I am planning on using this to mark certain textboxes with a ValidationStyle that triggers a bound

WPF MVVM Light - Cancel property change in viewmodel - RaisePropertyChanged even if value is same as before

别来无恙 提交于 2019-12-23 03:15:17
问题 I have a property(in viewmodel) bound to a combobox. When the viewmodel property changes, it uses the Messenger to tell another viewmodel about this. This other viewmodel then decides if this is ok, if not i want to cancel and send the old value back up to the view. I guess i can do this by setting the value to the new one first, then set it back. But is there a more elegant soulution? Failing code public DeckType SelectedDeckType { get { return _selectedDeckType; } set { DeckTypeMessage

WPF MVVM Light - Cancel property change in viewmodel - RaisePropertyChanged even if value is same as before

血红的双手。 提交于 2019-12-23 03:14:49
问题 I have a property(in viewmodel) bound to a combobox. When the viewmodel property changes, it uses the Messenger to tell another viewmodel about this. This other viewmodel then decides if this is ok, if not i want to cancel and send the old value back up to the view. I guess i can do this by setting the value to the new one first, then set it back. But is there a more elegant soulution? Failing code public DeckType SelectedDeckType { get { return _selectedDeckType; } set { DeckTypeMessage