You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am testing MvvmLight framework with Wasm project, but it seems like MvvmLight in Wasm is not yet fully supported. Issues I found:
MvvmLight package has .Net Standard 1.0 version. After adding MvvmLight package to Wasm project, the reference shows no warning, but using GalaSoft.MvvmLight in c# code doesn't work (the project doesn't compile):
After preparing .Net Standard 2.0 'MvvmLight' package, using GalaSoft.MvvmLight can be used:
Is that mean, that Wasm project (which is targeted to .Net Standard 2.0) can work only with packages targeted to .Net Standard 2.0? Or maybe there is any configuration which would allow to add .Net Standard 1.0 package to Wasm .Net Standard 2.0 project?
In order to implement ViewModelLocator, CommonServiceLocator 2.0.3 package has to be added to Wasm project. After adding it and rebuilding the Wasm project, compilation shows error:
Alternative working solution is not to install CommonServiceLocator in Wasm project and in Shared project use code like this:
#if __WASM__
using Microsoft.Practices.ServiceLocation;
#else
using CommonServiceLocator;
#endif
In .Net Standard version of MvvmLight, NavigationService and DialogService are not implemented, so they can't be used is Wasm project. This is because in MvvmLight (UWP) both classes uses three platform-specific UI elements such as: MessageDialog, Frame, Window. Which controls from Uno/Wasm library should be used to correctly replace MessageDialog, Frame, Window and correctly implement NavigationService and DialogService targeting Uno/Wasm platform?
Activity
jeromelaban commentedon Jun 16, 2018
Thanks for filing this issue!
Have you tried using
The Uno.GalaSoft.MvvmLight.Platform and
Uno.GalaSoft.MvvmLight ? Those two packages are compatible with Uno, and their platform specific services are implemented.
zbigniew-gajewski commentedon Jun 16, 2018
Perfect! It works!
I wasn't aware, that Uno adapter for MvvmLight exists. Thank you!
So it seems like this issue is solved and can be closed.
jeromelaban commentedon Jun 16, 2018
Excellent! We're in contact with @lbugnion to avoid this alternative nuget, and eventually get this included in the main nuget.
Merge pull request unoplatform#44 from unoplatform/dev/jela/hotreload-2
Merge pull request unoplatform#44 from unoplatform/pj/rename-package
chore: MOAR LOGGING
chore: MOAR LOGGING