mvvm-light

EventToCommand don't exist in Mvvmlight toolkit WPF4.5

二次信任 提交于 2019-12-03 07:15:00
I'm using the latest MVVMLight Tookit at version 4.1.26.24928, and I'm writing a program using WPF 4.5. Now I can't use the EventToCommand in VS2012 XAML file, it says "EventToCommand" does not exist in the namespace "clr-namespace:GalaSoft.MvvmLight.Command;assembly=GalaSoft.MvvmLight.WPF45" . My dll references are: System.Windows.Interactivity (v4.5.0.0) Galasoft.MvvmLight.WPF45 (v4.1.26.24928) Galasoft.MvvmLight.Extras.WPF45 (v4.1.26.24928) This is my code: namespaces: xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity" xmlns:cmd="clr-namespace:GalaSoft.MvvmLight.Command

WinRT MVVM Light Sample Project

心不动则不痛 提交于 2019-12-03 06:54:37
If anyone starts developing Windows 8 metro applications using MVVM Light please help me to create a Windows 8 (WinRT) project template. I get bored by using Microsoft ‘s Layoutaware page(Base class). I just need to structure the class with the help of MVVM Light. If any one did this please help me or provide some links to start developing Windows 8 Metro application using MVVM Light. The major areas where i am facing issues are: Navigation (Forward and Backward) State Handling (Tombstoning in windows 8) Navigation after the app launches form termination state etc. Handling WebService [ Post

prism vs mvvm light for wpf

旧城冷巷雨未停 提交于 2019-12-03 05:36:37
问题 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 w.r.t. both the frameworks?: Performance: Will either one framework perform better than the other for any reason? Communication within the app (viewmodel to viewmodel or between modules etc): I have read that MVVM Light has Messenging Service which

MVVM-Light, firing events from a button inside a data grid column template

百般思念 提交于 2019-12-03 03:03:27
MVVM light has been a pleasure to learn, but here I am stuck. The problem is event firing. In the code below, one button the works and fires events. The other button doesnt. No binding errors are reported in the output. Is there anything obvious I am missing? <Grid x:Name="LayoutRoot">... <StackPanel> <Button Content="THIS BUTTON WORKS"> <i:Interaction.Triggers> <i:EventTrigger EventName="Click"> <Command:EventToCommand Command="{Binding DataContext.HandleAddQuestionActionCommand, ElementName=LayoutRoot, Mode=OneWay}" PassEventArgsToCommand="True"/> </i:EventTrigger> </i:Interaction.Triggers>

MVVM conform localization in WPF Applications

霸气de小男生 提交于 2019-12-03 02:39:48
How can I localize an WPF Application using the MVVM Pattern? I really want to do it the "right" way. My current approach is that I use .resx Resource files to localize my application. I included them in my xaml code xmlns:localization="clr-namespace:ClientLibTestTool.ViewLanguages" and access them like this: <Button x:Name="BtnGenerate" Content="{x:Static localization:localization.ButtonGenerate}"/> My Questions: Is there a better way to do it? How can i test the different languages (load application with different language settings)? Is it possible to change the language at runtime? Answers:

ICommand CanExecute not triggering after PropertyChanged?

≡放荡痞女 提交于 2019-12-03 02:03:01
I got a WPF application that shows a button bound to a command like that: <Button Command="{Binding Path=TestrunStartCommand}" Content="GO!"> The command is defined like that: public ICommand TestrunStartCommand { get { return new RelayCommand(TestrunStartExecute, () => !IsTestrunInProgress); } } public bool IsTestrunInProgress { get{ return _isTestrunInProgress; } set{ _isTestrunInProgress = value; RaisePropertyChanged(IsTestrunInProgressPropertyName); } } The problem is, the button won't be enabled immediately after I set IsTestrunInProgress to false, but only after I click inside the

MVVM-light + RIA Services best practices [closed]

落花浮王杯 提交于 2019-12-03 01:45:12
问题 As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance. Closed 7 years ago . I would like to start a collection of MVVM-light (w/ RIA Services) Best Practices. There are a number of items I have found to be

MVVM Light: how to unregister Messenger

假装没事ソ 提交于 2019-12-03 01:30:45
问题 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 practice to explicitly unregister the recipients anyways rather than relying on the Messenger's use of weak references. The problem is that is easier said than done. ViewModels are easy: you usually have full control over their lifecycle and can just

Where are the MVVM Light snippets?

泪湿孤枕 提交于 2019-12-03 01:24:02
It seems that snippets of MVVM Light are not installed when we use Nuget to install MVVM Light Toolkit. Where can I find them ? JYL Snippets are available on GitHub . Download the code (upper right Clone or download button) and extract it. Use the Visual Studio Code Snippet manager (from the "Tools" menu) to import the snippets located in the Installer/InstallItems/Snippets/CSharp folder of the extracted code. dotNET For anyone else who didn't find C# snippets in the download specified in the accepted answer, you can download MVVM Light extension for VS2015 (as well as for VS2013 and VS2012)

How to receive DialogResult using mvvm-light Messenger

£可爱£侵袭症+ 提交于 2019-12-03 00:20:51
I'm trying to use the mvvm-light messenger capability to open a custom confirm password dialog in my view, triggered by a command in my viewmodel. I think I understand the usage of Messenger.Default.Register and Messenger.Default.Send . But how do I get the dialog results back in my viewmodel? To me the sending seems to be a one way street... Could someone help a beginner with a small C#/WPF code sample? Thanks for any help IMHO it is better to use the NotificationMessageAction<T> as it is cut out for this task. On the sender side: var msg = new NotificationMessageAction<MessageBoxResult>(this