Coder Social home page Coder Social logo

rockmvvmforms's People

Contributors

mariolobar avatar ramonesteban78 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

xleon

rockmvvmforms's Issues

RockMvvmForms IoC implementation

We need to prepare a plugin or just add an IoC like Autofac.

This is because the DependencyService of Forms is not testable from a nUnit Library project as it needs to Init Forms to make use of it.

These could cause the following additional implementations:

  • We can no longer use the constructors of the ViewModels to pass parameters. We have to find another way. Maybe in the InitAsync function?.

I will prepare this feature asap.

Avoid user to use the ViewFactory in their Forms PCL project

We need an Init() function to avoid access to IViewFactory interface in the App.cs
Also the registration of Views and ViewModels should be made maybe through a RockMvvmForms.Register or something like that.

Say Rock if you would like to have this improve :)

Concrete instances and Lazy initialization

What about adding a method like this without actually creating the instance right away. It would be on hold until requested with Get<T> and it would improve performance in the case we register lot of things.
It could be something like:

Register<T>(Func<T> createAction) { }
RockServiceLocator.Current.Register<Ball>(() => new Ball());

That would also allow us to use concrete instances:

var ball = new Ball(param1, param2);
RockServiceLocator.Current.Register<Ball>(() => ball);

But that would affect how your locator works, because right now everything you register is interpreted as a Singleton. So, to handle this situation I would implement an API like the following:

Register<T, TImpl>(); // a new instance will be created with every Get<T>();
Register<T>(Func<T> instanceFunc); // instanceFunc will be invoked with every Get<T>();
RegisterSingleton<T, TImpl>(); // same as your current Register<T, Timpl>();
RegisterLazySingleton<T>(Func<T> instanceFunc); // instanceFunc will be invoked just once and the result is saved for later use

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.