Skip to content

Wasm - MvvmLight adaptation issues #44

Closed

Description

@zbigniew-gajewski

I am testing MvvmLight framework with Wasm project, but it seems like MvvmLight in Wasm is not yet fully supported. Issues I found:

  1. 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):

mvvmlightstd10

After preparing .Net Standard 2.0 'MvvmLight' package, using GalaSoft.MvvmLight can be used:

mvvmlightstd20

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?

  1. 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:

commonservicelocatorerror

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
  1. 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

  1. jeromelaban commented on Jun 16, 2018

    @jeromelaban
    Member

    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.

  2. zbigniew-gajewski commented on Jun 16, 2018

    @zbigniew-gajewski
    Author

    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.

  3. jeromelaban commented on Jun 16, 2018

    @jeromelaban
    Member

    Excellent! We're in contact with @lbugnion to avoid this alternative nuget, and eventually get this included in the main nuget.

  4. added a commit that references this issue on Nov 14, 2021
  5. added a commit that references this issue on Jan 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions