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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T16:35:59+00:00 2026-05-24T16:35:59+00:00

I am using Silverlight & MVVM pattern. <TextBox Name=UserNameText Text={Binding Path=Username, Mode=TwoWay} HorizontalContentAlignment=Stretch/> In

  • 0

I am using Silverlight & MVVM pattern.

<TextBox Name="UserNameText" Text="{Binding Path=Username, Mode=TwoWay}" HorizontalContentAlignment="Stretch"/>

In this I had bound TextBox to a property Username and when Enter key is pressed and I am executing the LoginCommand in View Model.

private void LayoutRoot_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.Key == Key.Enter)
            {
                this._viewModel.LoginCommand.Execute(null);
            }
        }

When username is entered in TextBox and ENTER key is pressed from the UserName TextBox, the LoginCommand is called, but the value is not updated in propery Username. It still contains null.

The values are bound if only there is a focus lost. How to fix this?

  • 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-24T16:36:00+00:00Added an answer on May 24, 2026 at 4:36 pm

    Change UpdateSourceTrigger=PropertyChanged in the Binding. By default, the TextBox only updates it’s bound value on LostFocus. Setting it to PropertyChanged will make it so it updates the bound value anytime the property changes.

    <TextBox Name="UserNameText" 
             Text="{Binding Path=Username, UpdateSourceTrigger=PropertyChanged}" />
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm working on a Silverlight app using the MVVM pattern. My ViewModel currently consists
I'm writing a Silverlight app using the MVVM pattern. I have a main view
I've started using databinding with MVVM pattern in Silverlight. There's one problem for me.
Would it be possible to show an image in full screen mode using silverlight.
I am writing an app using the MVVM (Model-View-ViewModel) pattern and am leveraging the
I have recently been programming Web based applications using Silverlight & Ria Services. I
I am using SL4, MVVM Toolkit, Entity Framework 4 & WCF RIA Services. I
Using Silverlight 4 & WPF 4, I'm trying to create a button style that
I'm trying to make a stopwatch & countdown app for WindowPhone 7 using Silverlight
we have developed an intranet application with Silverlight 4 using MVVM with PRISM. Up

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.