Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NamedScope was not found when using Inject() or Get<IService>() after initial injecting #17

Open
alanu86 opened this issue Oct 13, 2017 · 0 comments

Comments

@alanu86
Copy link

alanu86 commented Oct 13, 2017

Ninject.Bind().To().DefinesNamedScope("#window");
Ninject.Bind().To().InNamedScope("#window");
Ninject.Bind().To().InNamedScope("#window");

then whenever i call:

var window = Ninject.Get();

and each created window object has its own instance of IToast and ITaskManager. its Ok.

later in program in instance of ITaskManager user exectutes newTask() method and within

new Task will be created of type:

`public class Task
{
[Inject]
public IToast Toast {get;set;}

[Inject]
public ITaskManager {get;set;}
}`

using normal Contructor (var task = new Task() ):
and then:

Ninject.Inject(task) excepts :

says named scope "#window" is not found.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant