Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6895493
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T06:54:55+00:00 2026-05-27T06:54:55+00:00

I am using Ninject with Windows Phone application. My logic includes IBarViewModel interface which

  • 0

I am using Ninject with Windows Phone application.

My logic includes IBarViewModel interface which is:

public interface IBarViewModel
    {
        double Width { get; set; }
        bool IsAchieved { get; set; }
        CornerRadius Corner { get; set; }
    }

Currently, there is only one implementatation of IBarViewModel – GenericBarViewModel.

All the IViewModel implementators will have to have these three main properties set at creation time.

I want to create an instances of these IBarViewModels at runtime from my code. How can I do it.

When I was programming against an implementation (the class was called simply Bar), I was just calling an object initializer like this:

_bars.Add(new Bar
                {
                    Width = _totalWidth,
                    IsAchieved = false,
                    Corner = new CornerRadius(5, 5, 5, 5)
                });

As per the answer to this question: Inject value into injected dependency I can pass a parameter to ninject module.

The only question remains: will I have to carry my ninject kernel deep into the logic to do such parametrized dependency resolution?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T06:54:56+00:00Added an answer on May 27, 2026 at 6:54 am

    I don’t think you should be using IoC at all for this. It doesn’t make any sense whatsoever.

    Why not simply let the GenericBarViewModel set the default values for the 3 properties, make it abstract, and let any other “Bar” ViewModel implementations inherit from the GenericBarViewModel ?

    What exactly are you trying to do?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using Ninject DI container. And I've got the two public interface IRepository<T> where
Using Ninject 2.2, I have the following failing test (simplified): public interface IGenericView<T> {
I am currently creating an MVC3 application using Ninject. I have two controllers which
Has anyone managed to get Ninject working in Metro Style app using the Windows
I have set up a NInject (using version 1.5) binding like this: Bind<ISessionFactory>().ToMethod<ISessionFactory>(ctx =>
We are using ASP.net MVC. Which of these is the best DI framework Ninject
I am using Ninject in MVC3 application. One of my resolvable dependencies makes use
I am new to ninject using ninject 2.0. My application is hosted in asp.net
I am using Ninject for implementing IoC/DI in my application. It has been working
We are implementing IoC/DI in our application using NInject framework. We are having internal

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.