mvvm-light

MVVM Light IsInDesignMode property not working

微笑、不失礼 提交于 2019-12-10 15:18:00
问题 I'm having an issue where the property IsInDesignMode is not returning the expected value of true when running the solution in VS or Blend. My environment consists of Win Server 2008 R2, VS2010 Pro, Blend 4 and MVVM Light V3. I run my Silverlight 4 solution in Debug mode from VS and Blend, and IsInDesignMode is always false. Am I missing a setting? Is there a reason why it may not be picking up the environment? Thanks in advance. -Greg 回答1: It should work properly. The only place where I know

Where do I find Galasoft.MvvmLight.WPF45 assembly?

对着背影说爱祢 提交于 2019-12-10 13:43:17
问题 I'm using VS2013 Express. I'm quite new in WPF and MVVM. I've downloaded mvvmlight using NuGet to my project. I'm tryinng to use GalaSoft_MvvmLight_Command:EventToCommand . As far as I know, I have to add reference in xaml by adding namespace: xmlns:GalaSoft_MvvmLight_Command="clr-namespace:GalaSoft.MvvmLight.Command;assembly=GalaSoft.MvvmLight" But, unfortunatelly I get error, that says: The tag 'EventToCommand' does not exist in XML namespace 'clr-namespace:GalaSoft.MvvmLight;assembly

MVVM-Light: Load UserControl into Window

心已入冬 提交于 2019-12-10 12:19:34
问题 What is the best practice to load an UserControl into an Window with MVVM-Light? Where create the UserControl instance, in the ViewModel from Window or direct in the window? 回答1: Your VM should not contain any UI specific code like controls if you are worried about best practice. For example, if you have a property in the VM that controls the visibility of a control in your view, that property should be of type bool and not Visibility. The view will use the bool property to hide or show the

MVVM Light WPF open new window

有些话、适合烂在心里 提交于 2019-12-10 10:23:42
问题 I am new to MVVM and learning it with MVVM Light. I have an application in wpf with a login window. When the user enters correct credentials the login window should close and a new MainWindow should open. The part of the login is already working but how can I open a new window and close the current (login.xaml)? Also some parameters must be given to this new MainWindow. Can anyone put me in the correct direction or provide me some info? 回答1: since you are using MvvmLight you could use the

Register viewmodel in different project from main project viewmodellocatoe in mvvmlight

混江龙づ霸主 提交于 2019-12-10 10:21:34
问题 How do I register a viewmodel in a different referenced project in the ViewModelLocator class of MVVMLight. I keep getting an error when ever I try to use the SimpleIoc to register the viewmodel class because it's in a different project, and I'd Like to keep different projects for different parts of my application. 来源: https://stackoverflow.com/questions/14898301/register-viewmodel-in-different-project-from-main-project-viewmodellocatoe-in-mv

Send a message from View to ViewModel : what is an appropriate token?

ⅰ亾dé卋堺 提交于 2019-12-10 10:08:44
问题 Lets define : a viewModel : the TabViewModel class a view : the TabView class I have n instances of the TabView class, and so n instances of TabViewModel . When one instance of the TabView class send a message, I want it to be received by its own viewmodel, and only this one . As I understand the Messenger of the mvvm light toolkit, I whould use something like : // in the view Messenger.Default.Send(new RefreshMessage(/*...*/), oneToken); and // in the viewmodel Messenger.Default.Register

VS 2010: Can’t insert mvvm-light snippet using shortcut - incompatibility with resharper 5?

廉价感情. 提交于 2019-12-10 09:57:07
问题 i recently installed some snippets that come with the mvvm-light framework i am using. And sure enought i checked via Tools > Code Snippet Manager and they are installed under "My Code Snippets". If i do insert Snipper (right click in code window) or CTRL K + CTRL X then i can search within all available snippets.... But i do believe its possible to just type the shortcut key (in this case it is mvvmlocatorproperty) and pressing tab inserts the snippet BUT when i type the shortcut key it is

Commands stop being executed

一笑奈何 提交于 2019-12-10 09:41:30
问题 update changing to my own relay command helped. though rooting the Funcs didn't Hi guys I was making a small MVVM application. It is supposed to take a class full of Func<string> and display a list of buttons each executing a command containing a Func<string> and displaying their return values in another list. The program works fine at first but after a random amount of button presses it simply stops executing commands. The UI is still responsive. It is as if the binding broke. There are a

MVVM Light in Visual Studio 2012 shows no project templates

折月煮酒 提交于 2019-12-10 09:36:37
问题 I have followed guide on http://www.galasoft.ch/mvvm/installing/ to install MVVM light on VS 2012. I've downloaded MVVM Light Toolkit V4.1 for Visual Studio 2012 from http://mvvmlight.codeplex.com/releases and after installation I cannot see any MVVM light projects when I click FILE->NEW PROJECT in VS 2012. I choose to install binaries, templates and snippets everything by default. I have no idea what's happening. What do I wrong? There are no errors. My aim is to create MVVM light project

Problems adding Blend behavior to DatePicker

穿精又带淫゛_ 提交于 2019-12-10 04:22:56
问题 I'm trying to add a Blend behavior to a DatePicker control to bind an MVVM-Light RelayCommand to the DateChanged event like so: <DatePicker Date="{Binding SelectedDate, Mode=TwoWay}"> <Interactivity:Interaction.Behaviors> <Core:EventTriggerBehavior EventName="DateChanged"> <Core:InvokeCommandAction Command="{Binding DateChangedCommand, Mode=OneWay}"/> </Core:EventTriggerBehavior> </Interactivity:Interaction.Behaviors> </DatePicker> I'm using the following definitions: xmlns:Interactivity=