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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T00:51:33+00:00 2026-05-24T00:51:33+00:00

Current I have some Views linked to ViewModels using code similar to the following:

  • 0

Current I have some Views linked to ViewModels using code similar to the following:

<Application.Resources>
        <DataTemplate DataType="{ x:Type vm:AgeIndicatorViewModel}">
        <v:AgeIndicatorView />
    </DataTemplate>
</Application.Resources>

I have two questions regarding this:

  • Does this method allow me to only link one View to each View Model (I think it does improse this limitation on me, but want to be sure)

  • When using this method, where should I put all of my DataTemplate declarations? At the moment there are only a few, and they are all in App.Xaml – Is there a better location for these, or is App.Xaml fine / Best location?

The most important question is the second really, as at the moment I want to link my ViewModel to my View in this way, as it requires no external libraries etc.

The way my ViewModels are setup, with their Properties and Commands etc is all working already.

  • 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-24T00:51:34+00:00Added an answer on May 24, 2026 at 12:51 am

    Does this method allow me to only link one View to each View Model (I think it does improse this limitation on me, but want to be sure)

    Yes. If you’re trying to link multiple ViewModels to multiple Views, you need to encapsulate them within a separate VM, and add a new DataTemplate.

    When using this method, where should I put all of my DataTemplate declarations? At the moment there are only a few, and they are all in App.Xaml – Is there a better location for these, or is App.Xaml fine / Best location?

    App.Xaml is fine, or really any place in the visual hierarchy above where the DataTemplate will be used.

    That being said, if the project gets to be a very large scale project, it’s often nicer to start using Merged Resource Dictionaries – this allows you to setup resource dictionaries “near” where you define the View/ViewModel pairs, but then use them at a higher level (ie: merge them into App.Xaml).

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

Sidebar

Related Questions

I have a pretty standard table set-up in a current application using the .NET
We have a current application where user login credentials are stored in a SQL
I have a current system which is build as a Windows Application, and does
In my current application I have a form that requires the user to enter
I have an application that launches a webpage in the current browser when the
In my current project, I am using four grid views in different tabs. As
Building my first SL MVVM application (Silverlight4 RC) and have some issues i don't
I am using devise in my rails application and I have two different resource
I have some data in ViewData.Model , and in my views I want to
I have a UINavigation bar in a few of my views without using 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.