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 5928895
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T14:20:56+00:00 2026-05-22T14:20:56+00:00

I am trying to add a viewmodel to IoC but not much documentation is

  • 0

I am trying to add a viewmodel to IoC but not much documentation is given on that subject by the project developers. I have added the following code to the app.xaml:

viewModelFactory.Register("ProfileCreateViewModel", () => new ProfileCreateView(), () => new ProfileCreateViewModel());
viewModelFactory.Register("ProfileEditViewModel", () => new ProfileEditView(), () => new ProfileEditViewModel(new Profile()));
viewModelFactory.Register("ProfileDeleteViewModel", () => new ProfileDeleteView(), () => new ProfileDeleteViewModel(new Profile()));

How do I resolve these viewmodels in controllers?

Please provide guidance, or any links or articles.

Thank you in advance.

  • 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-22T14:20:56+00:00Added an answer on May 22, 2026 at 2:20 pm

    I’ve found some information about mvvm and IoC in this question: MVVM: Tutorial from start to finish?
    There is a link to a great video tutorial covering important things, that can help you greatfully when developing a WPF application. Here is the link: http://www.codeplex.com/CompositeWPF/Release/ProjectReleases.aspx?ReleaseId=19170 (direct download)
    This presentation covers the basics of IoC (Unity), MVVM and data binding. Hope that will be helpful.
    If you want more concrete answer then if you are using Unity, you can just apply a Dependency attribute to a property and Unity will automaticly perform the injection.

    private ProfileCreateViewModel  _model;
    
    [Dependency]
    public ProfileCreateViewModel Model {
            set
            {
                _model = value;
                this.DataContext = _model;
            }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying add a tab to my web page that looks like this: Using
trying to add an ExpiresDefault ExpiresByType to content on my website so that way
Trying to add a class object into a List using reflection, but when invoking
I am trying to add a RegularExpression attribute to a property in a ViewModel
Trying to develop using MVVM: I have this Csla.PropertyStatus control that is created in
I have a ViewModel that encapsulates some properties that are being edited in an
The situation is as follows: I have a ViewModel that has a property that's
I am trying to create a viewmodel and add a SelectListItem to allow me
I'm trying to have a View where the user can add items in a
I have a textbox that is bound to a property on my ViewModel called

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.