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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T11:27:42+00:00 2026-05-31T11:27:42+00:00

In other MVVM API’s for other frameworks, for example Caliburn Micro for WPF you

  • 0

In other MVVM API’s for other frameworks, for example Caliburn Micro for WPF you can sub class view models. As an example I have this view model

Customer
Id : int
Selected : bool
Name : string
Edit : ViewModel

Depending on different Customer types I will have different Edit ViewModels, in Caliburn micro it would have automaticly rendered the correct view depending on the type of the ViewMOdel, types are offcourse not present in JS, but can you achive this some way in Knockout?

  • 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-31T11:27:43+00:00Added an answer on May 31, 2026 at 11:27 am

    Thanks Mike, your solution is not exactly what I needed, Im doing something similar server side though, but our json-objects are read from a CQRS read model repository.

    It turns out that named templates was what I was after.. Heres a little fiddle that shows what i did (In our real scenario the properties of the submodel will be on the actual customer object)

    http://jsfiddle.net/Z7gMN/1/

    Update:
    Just saw that this answer got upvoted. There are more elegant ways of doing it, for example use my Convention over configuration library found here

    https://github.com/AndersMalmgren/Knockout.BindingConventions

    It has a convention for templates that uses the type so use a OO pattern of your liking like this one

    http://ejohn.org/blog/simple-javascript-inheritance/

    Define the different types, important is that they are postfixed with Model or ViewModel

    The templates should have the same name but postfixed View

    <script type="text/html" id="MyView">
        <input data-name="myValue" />
    </script>  
    

    http://jsfiddle.net/JKXaX/5

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

Sidebar

Related Questions

in my MVVM application (in wpf) i have two view and I want to
I have a wpf application in mvvm pattern. In main view, I have few
With MVVM, I think of a view-model as a class that provides all the
I want use MVVM design pattern in WPF and Silverlight Application. Where can i
Working with the MVVM pattern, I have a pair of view model classes that
I'm learning WPF and MVVM and trying to stress good design. I have lots
I'm using the MVVM pattern in my first WPF app and have a problem
I have a MVVM application in WPF. I have an event that gets dispatched
I have a silverlight mvvm application that loads main view with 2 user controls
I have a WPF-mvvm application. I need to read an excel file..and create a

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.