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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T00:43:38+00:00 2026-06-17T00:43:38+00:00

I am using the MVVM light toolkit for a wpf application which talks to

  • 0

I am using the MVVM light toolkit for a wpf application which talks to a wcf server.

The wcf server returns a Person object (proxy object).
This person object has several fields, name, surname, etc etc.
My viewmodel calls the webservice, and then gets a return of this model.
My view is bound to viewmodel’s model, and the fields correctly bound to each ui textbox.

all cool in the shade, system functions nicely.

two fields on the model are DateOfBirth, and NationalIDNumber
(fyi: in south africa you can derive a persons date of birth from an ID number)

So after the user inputs or updtes the NationalIdNumber (if available) I would like the DOB to be determined as well.

But the DOB must still be mapped to the initial field that was returned from the WCF service, so I cant just bind it to the NationalIdNumber with a converter. It needs to stay bound to DOB field of the wcf proxy so that it can get persisted back.

how best should i implement this?

If this was a non mvvm project, i would just put a event on the IDNumber text fields so that if it looses focus, try calculate a dob from it (might not always be possible if text in it is rubbish) and then overwrite the value of the Dob textbox.

I was thinking of just tweaking the Person objects NationalIdNumber setter, but this will get removed the minute I update the webservice reference

Thanks

  • 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-06-17T00:43:39+00:00Added an answer on June 17, 2026 at 12:43 am

    You can have Person property in your view model:

    ViewModel:

    public class PersonViewModel : INotifyPropertyChanged
    {
        Person person = new Person();
        public Person Person
        {
            get
            {
                return person;
            }
            set
            {
                person = value;
                NotifyPropertyChanged("Person");
            }
        }
    
        public event PropertyChangedEventHandler PropertyChanged;
    
        private void NotifyPropertyChanged(string propertyName = "")
        {
            if (PropertyChanged != null)
            {
                PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
            }
        }
    }
    

    View:

    <TextBox Text="{Binding Person.NationalIDNumber, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" 
                     Height="23" HorizontalAlignment="Left" Margin="128,98,0,0" 
                     Name="textBox1" VerticalAlignment="Top" Width="120" />
    

    So whenever you update Person’s properties, Person’s setter will be called.

    …

    Edit:

    Using MvvmLight:

    ViewModel:

    public class PersonViewModel : ViewModelBase
    {
        Person person = new Person();
        public Person Person
        {
            get
            {
                return person;
            }
            set
            {
                person = value;
                RaisePropertyChanged("Person");
            }
        }
    }
    

    View:

    <TextBox Text="{Binding Person.NationalIDNumber, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" 
                     Height="23" HorizontalAlignment="Left" Margin="128,98,0,0" 
                     Name="textBox1" VerticalAlignment="Top" Width="120" />
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using MVVM Light toolkit in my WPF application. I would like to
I'm developing a Silverlight WP7 app using MVVM Light Toolkit which initially works properly.
I am making one application in MVVM using Galasoft MVVM Light toolkit. However i
I'm using MVVM Light toolkit (which I love). I currently have messaging in place
I'm using the mvvm-light toolkit in my windows phone 7 application. I have in
I’m currently working on a WPF MVVM application using MVVM Light as the MVVM
In my WPF application using MVVM I noticed that in some cases the CanExecute
I'm using MVVM (MVVM Light Toolkit) and have a property on the view model
I am using MVVM Light toolkit Messenger class- A Messenger class (and diverse message
I'm trying to follow this MVVM Light Toolkit V3 Alpha 2: EventToCommand behavior tutorial.

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.