Giter Club home page Giter Club logo

Comments (6)

jeromelaban avatar jeromelaban commented on August 16, 2024

This is a known issue for WASM, this works for iOS and Android.

The best workaround for now is to declare it in a merged resource dictionary.

from uno.

carldebilly avatar carldebilly commented on August 16, 2024

I reproduced the problem and I found the cause... it's very far from the reported bug.

The actual cause

The Wasm version of MvvmLight will use the netstandard1.0 version of the package and the IoC in this version won't implement the IServiceLocator.

See those lines: https://github.com/nventive/uno.mvvmlight/blob/3408287579ace291c9519edefc8017df6a151aac/GalaSoft.MvvmLight/GalaSoft.MvvmLight.Extras%20(PCL)/Ioc/ISimpleIoc.cs#L38-L40

Since the project Uno.Core is compiled in netstandard2.0, it will include his own version of CommonServiceLocator (v1.3) as defined in this bug I just opened: unoplatform/Uno.Core#53

What is happening in the app

  1. The initial navigation to MainPage.xaml will be initiated

  2. In the MainPage.xaml InitializeComponent(), Uno will successfully resolve the Locator resource

  3. Uno will call the MainPageViewModelInstance property of ViewModelLocator

  4. This one will cast SimpleIoc.Default as IServiceLocator, which is not implemented this way

    Code here: https://github.com/zbigniew-gajewski/uno-wasm-aspnet-core/blob/78e9491427166d4a4242ddbec85e7080c38f51e9/UnoTest/UnoTest.Shared/ViewModels/ViewModelLocator.cs#L24

  5. A null-reference exception will terminate the initial navigation, leading to the false interpretation there's a problem with resources.

I will close this bug as not related to Uno directly (the real issue has been created in Uno.Core project). Feel free to reopen it or ask more details.

from uno.

carldebilly avatar carldebilly commented on August 16, 2024

Ooohhh... by the way, to find this problem I found those 2 assemblies must be removed from linker in the LinkerConfig.xml:

<assembly fullname="UnoTest.Wasm" />
<assembly fullname="GalaSoft.MvvmLight.Platform" />

from uno.

zbigniew-gajewski avatar zbigniew-gajewski commented on August 16, 2024
  1. Thanks for diagnosing the bug.
  2. Unfortunately without <assembly fullname="UnoTest.Wasm" /> accessing data with BreezeSharp doesn't work, I mean, the list with received data is not displayed.

from uno.

carldebilly avatar carldebilly commented on August 16, 2024

When I said removed from linker, it means those lines must be added to the config file ;-)

Sorry for the confusion.

from uno.

zbigniew-gajewski avatar zbigniew-gajewski commented on August 16, 2024

Aaa, OK :) Thanks.

from uno.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.