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

  • Home
  • SEARCH
  • 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 855385
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T08:04:00+00:00 2026-05-15T08:04:00+00:00

Simplified example: I have an object that models a user. Users have a first

  • 0

Simplified example:

I have an object that models a user. Users have a first name and a last name. The UserViewModel has a dependency property for my Models.User object. In the declaration of the UserView‘s xaml, I want to bind a couple of TextBlocks to the first and last name properties.

What is the correct way to do this? Should I have readonly DependencyProperties for the name fields, and when the dependency property User is set, update them? Can the name fields be regular C# properties instead? Or, should I bind like this:

<TextBlock Text="{Binding User.FirstName}" />
  • 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-15T08:04:01+00:00Added an answer on May 15, 2026 at 8:04 am

    You typically will never use Dependency Properties in your ViewModel or Model classes. You’ll want to have your ViewModel implement INotifyPropertyChanged instead.

    If you do that, you can bind using the syntax above. (Though, if you want two-way binding to work appropriately, your “User” object will also need to implement INotifyPropertyChanged – otherwise, changes made in code to the user will not automatically reflect in the UI.)

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

Sidebar

Related Questions

I have models (simplified example): class Group(models.Model): name = models.CharField(max_length = 32) class Person(models.Model):
Here's a simplified example of an object I have. What I would like to
Let's consider following, simplified example: We have 2 tabs withing <rich:tabPanel switchType=ajax> , each
In the simplified example below I have a DataContext and Repository which I think
As a simplified example, I have the following data classes: public class Employee {
I've simplified this example as much as I can. I have a remote function:
I have troubles with the following database design (simplified for the example). It allows
I have a form with 3 fields (simplyfied example). The first one is a
A simplified example: // Let's create a new object function MyObject() { // }
I have a class (simplified example) like : public class SomeCollection : ICloneable {

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.