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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T05:13:25+00:00 2026-05-20T05:13:25+00:00

I have a multi-part question: (1) Is there a good reason why Silverlight doesn’t

  • 0

I have a multi-part question:

(1) Is there a good reason why Silverlight doesn’t expose a DataContextChanged event? It seems like a whole lot of hassle could be avoided if someone at Microsoft just changed internal to public in the FrameworkElement class (like WPF does).

(2) I’ve found one or two different methods for hacking your way into a DataContextChanged event by using DependencyProperties in one configuration or another. But I can’t get them to work reliably. My testing so far seems to show that they fire the hacked DataContextChanged event just fine for the first class to which I hook them up, but don’t fire for any other classes. Has anybody else run into that problem? Or better yet, have they worked their way around it?

(3) The reason I’ve been giving myself for wanting to know when my DataContext has changed is that there are some UI operations that are complicated to get right in XAML, but are trivial in code-behind; and for many of those things, I need to handle events raised by my ViewModel; and hence I need to know when my ViewModel has changed, so I can wire up the event handlers. Is this an accurate view of the world? Or is the fact that I’m wanting to deal with this sort of thing in code-behind a pretty good indication that my thinking has gone off the rails some ways back? I’m no MVVM purist: I just want to get from here to good code quickly, and I don’t particularly care how I get there. Code-behind has served me reasonably well for over a decade now, and I’m loth to abandon it entirely. But is my pragmatism making it harder on myself at this point?

  • 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-20T05:13:26+00:00Added an answer on May 20, 2026 at 5:13 am

    “But is my pragmatism making it harder
    on myself at this point?”

    I wouldn’t call it pragmatism. I’d call it fear of change; staying in your comfort zone. Life is actually far easier if you abandon your old way of thinking and embrace the new (and I know exactly what you mean – I was in the same boat as you with code-behind).

    Now, off my soap box and to a more practical answer:

    When you want to detect changes in your model, then hook into the events that allow you to detect changes in your model. The DataContext is not really the model… All of your model objects are going to have an implementation of INotifyPropertyChanged. You should either be hooking into that for a given model, or hooking into something similar for an ObservableCollection.

    Silverlight/WPF make all of this sort of stuff WAY easier now that databinding actually works.

    Don’t fight the framework. Don’t bring old ASP.Net practices with you to this game… It will not help you. You’ll lose the best parts of the framework’s power that way.

    Cheers.

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

Sidebar

Related Questions

Modern browsers have multi-tab interface, but JavaScript function window.showModalDialog() creates a modal dialog that
I have a multi-line string that I want to do an operation on each
I have a multi-table query, similar to this (simplified version) SELECT columns, count(table2.rev_id) As
I have a multi-user ASP.NET app running against SQL Server and want to have
I have a multi-threaded C++ app which does 3D rendering with the OpenSceneGraph library.
I have a multi-timezone web application that stores all of the datetime values in
I have a multi-threaded Windows application that occasionally deadlocks. Inevitably this happens on a
I have a multi-user eclipse (3.4) installation with a shared master configuration area. Users
I have a multi-module maven project with an installer sub-project. The installer will be
I have a multipart form that takes basic user information at the beginning with

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.