autofac / autofac.extras.mvvmcross Goto Github PK
View Code? Open in Web Editor NEWMvvmCross integration for Autofac IoC
License: MIT License
MvvmCross integration for Autofac IoC
License: MIT License
I think the code can be the same, but you need a new NugetPackage because the old one requires < 4.0.0 for MvvmCross and won't work.
Per autofac/Autofac#811 the ContainerBuilder.Update()
method is obsolete and refactoring needs to be done to remove usage where possible, treating the container as immutable.
AutofacMvxIocProvider
has several usages of that method as it tries to resolve things on the fly.
The provider needs to be refactored to remove those usages, perhaps opting for AnyConcreteTypeNotAlreadyRegisteredSource
instead.
With the release of MvvmCross 6.0, the current version of Autofac.Extras.MvvmCross is broken unfortunately for that version. The updated IMvxIoCProvider
now has support for child containers.
The latest nuget package still depends on MvvmCross v4 and using any MvvmCross v5 project will produce this warning. I wanted to take it up to do the upgrade and submit a pull request but I'm having some trouble upgrading any of the packages due to other lower versions being used in the code.
Nuget package Version: 4.0.2
Reproduction steps: Install latest Nuget package into a Mvvmcross project that is using v5 and the warning will appear when building.
You could give me some pointers on upgrading the project if you don't have time and I'll do it for you and submit a pull request.
The implementation of public virtual object IoCConstruct(Type type)
in "AutofacMvxIocProvider.cs" seems to be not in accordance with the intended behavior of MvvmCross.
The current implementation in the AutofacMvxIocProvider
class just delegates the method call to the Resolve
method, making it the same as calling the Resolve
method in the first place.
If you take a look at the implementation of the IoCConstruct
method in the MvxSimpleIoCContainer
class, you can see that it is intended and implemented as a generalized mechanism to directly create a class instance of any class (without looking up any registration first), but then resolving any constructor parameters and properties in a usual IOC manner.
A side effect of the current implementation is that any view model cannot just be created automatically by MvvmCross but has to be explicitly registered with Autofac first before usage.
Hi,
Is compatibility with latest stable Autofac 5.2.0 planned?
regards
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.