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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T14:27:18+00:00 2026-05-12T14:27:18+00:00

We are using MVVM and want nothing in the View’s C# file. We have

  • 0

We are using MVVM and want nothing in the View’s C# file. We have a designer on staff, and don’t want to teach them how to write C#.

We have a Textbox that has text inside of it. It seems necessary to have the OnTextChangedEvent be inside of our VM. (We are binding the text to a string in the VM but it isn’t doing everything that we need it to do).

Basically we’d like to take this code and get rid of the codebehind by binding to the OnTextChangedCommand (or something) in our VM:

This is what we have:

    <TextBox 
    x:Name="MyTextBox"
    Text="{Binding Path=SomeVariable, Mode=TwoWay}"/>

And in the c# code-behind

MyTextBox.TextChanged += vm.OnTextChanged;

This is what we want:

    <TextBox 
    x:Name="MyTextBox"
    Text="{Binding Path=SomeVariable, Mode=TwoWay}"
    TextChanged="{Binding OnTextChanged}"/>

and nothing in the c# code-behind

  • 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-12T14:27:18+00:00Added an answer on May 12, 2026 at 2:27 pm

    You would need UpdateSourceTrigger capability (which is not available in Silverlight 2).

    Check out this article about the work around if you are using SL 2.

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

Sidebar

Related Questions

I'm writing a Silverlight app using the MVVM pattern. I have a main view
I'm trying to implement a WPF application using MVVM (Model-View-ViewModel) pattern and I'd like
Using TortoiseSVN against VisualSVN I delete a source file that I should not have
I'm developing a WPF app using MVVM. Most of my views have only xaml
I want to swap images on the button dynamically using mvvm light. When the
I'm using MVVM in my WPF project. Now I want to display a subwindow
For my WPF application I'm using MVVM, and now I want to show a
OK, working on WPF(using MVVM) and came across a question, want some input. I
Using MVVM style I have successfully bound an ObservableCollection<string> to a ListBox , showing
I have been using ItemsControl for quiet sometime in WPF. I am using MVVM

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.