mvvm-light

mvvmlight messenger strange behaviour

寵の児 提交于 2019-12-23 01:26:22
问题 I have a strange behavior in my project. I use MvvmLight messenger to notify different parts of my UI to update. public EntryViewModel(MenuViewModel menuVM, Entry item) { this._menuVM = menuVM; OpenDetailsCommand = new RelayCommand(OpenDetailsInMainWindow); BackCommand = new RelayCommand(Back); this._entry = item; Refresh(); Messenger.Default.Register<CardUpdateMessage>(this, this._entry.Id, msg => Refresh(); ); } and send with Messenger.Default.Send(new CardUpdateMessage(id), id); when I see

Proper way in MVVM to drive visual states

冷暖自知 提交于 2019-12-22 18:50:10
问题 Given a content presenter that can display one of 4 different application pages, and I want to fade/otherwise animate a transition between pages based on view model state. Ideally I'd like to have these all defined within a DataTemplate, and then trigger transitions based on an enum from the view model, so that when some enum representing state changes, the transitions trigger to the appropriate page. Is there a known best practice to handle things like this? Immediately coming to mind is the

Should I choose MvvmLight or MvvmCross on a new project of simple to medium complexity? [closed]

若如初见. 提交于 2019-12-22 15:26:27
问题 Closed . This question is opinion-based. It is not currently accepting answers. Want to improve this question? Update the question so it can be answered with facts and citations by editing this post. Closed 5 years ago . I am trying to find the main difference between MVVMlight and MVVMCrossthose frameworks. I am planning to develop for Android and Windows Phone. I will use the Xamarin framework. (and Xamarin.Forms) The project should be a vehicle tracking application that talks to Azure-run

Should I choose MvvmLight or MvvmCross on a new project of simple to medium complexity? [closed]

大憨熊 提交于 2019-12-22 15:24:12
问题 Closed . This question is opinion-based. It is not currently accepting answers. Want to improve this question? Update the question so it can be answered with facts and citations by editing this post. Closed 5 years ago . I am trying to find the main difference between MVVMlight and MVVMCrossthose frameworks. I am planning to develop for Android and Windows Phone. I will use the Xamarin framework. (and Xamarin.Forms) The project should be a vehicle tracking application that talks to Azure-run

Navigate through UserControl with MVVM LIGHT (WPF)

雨燕双飞 提交于 2019-12-22 14:18:27
问题 First of all I apologize for my poor english which is not my first language. I'm new in MVVM so my question is probably a very newbie one ;) I'm encountering some issue with switching View in a C# Application using WPF and MVVM LIGHT. I've read a lot of articles but i still can't figured out how to do it in a clean way. So here is my question: What is the best way to achieve the navigation between UserControl contained in a MainWindows, assuming that: I've a ViewModel for each UserControl and

state handling in windows 8 using mvvmlight

点点圈 提交于 2019-12-22 12:38:09
问题 Implementation of state handling in windows 8 using mvvmlight Is there any method avilable in mvvmligt to manage states in WinRT? How I can duplicate the functionality of default Suspensionmanager by using WinRT? And the second one is about managing navigation cycle ie if I navigated from page A - > B. and the go for suspend and shutdown state. When I re start the application in need to open page B. and while presses back key I need to load A. How I can effectively implement this using MVVM

SimpleIoC - Type not found in cache: Windows.UI.Xaml.Controls.Frame

安稳与你 提交于 2019-12-22 12:17:10
问题 I am running into the below error the first time my ViewModel is being instantiated by the SimpleIoC. I believe I have setup the container as it should be, but for some reason, I am still getting the below error. Any ideas or assistance would be very much appreciated. Microsoft.Practices.ServiceLocation.ActivationException was unhandled by user code HResult=-2146233088 Message=Type not found in cache: Windows.UI.Xaml.Controls.Frame. Source=GalaSoft.MvvmLight.Extras StackTrace: at GalaSoft

Unable to cast object of type Page to type 'Windows.UI.Xaml.Controls.Frame' when using mvvm-light navigation service in a win 10 universal app

∥☆過路亽.° 提交于 2019-12-22 07:04:44
问题 I m hitting the following error on my new windows 10 universal app C#/XAML: An exception of type 'System.InvalidCastException' occurred in GalaSoft.MvvmLight.Platform.dll but was not handled in user code Additional information: Unable to cast object of type '' to type 'Windows.UI.Xaml.Controls.Frame'. on the following navigating command in one of my page's view model: _navigationService.NavigateTo(ViewModelLocator.MedicineBoxPageKey); I am trying to have a hamburger menu style navigation (see

MvvmLight EventToCommand and WPFToolkit DataGrid double-click

拜拜、爱过 提交于 2019-12-22 06:58:31
问题 Trying to figure out how to use EventToCommand to set a datagrid double click handler for rows. The command lives in the viewmodel for each row. Just that much out of my experience, since I haven't used interactions yet. Thanks. I would have used mvvmlight tag, but I don't have high enough rep yet to make new tags. 回答1: This would be the solution if the Command lives on the "GridVieModel" and not on the "RowViewModel". <Window... ...xmlns:dg="clr-namespace:Microsoft.Windows.Controls;assembly

Global static resources in a WPF class library?

空扰寡人 提交于 2019-12-22 05:39:10
问题 In a WPF application, you can put your global static resources in app.xaml .. like <Application.Resources> <!--Global View Model Locator--> <vm:ViewModelLocator x:Key="Locator" d:IsDataSource="True" /> </Application.Resources> That was from MVVM Light ;). Now, if your project is a wpf class library, what is a proper way to initialize such global static resources? 回答1: You can create a ResourceDictionary with your resources and merge the dictionaries using your code as below.