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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T06:24:17+00:00 2026-05-13T06:24:17+00:00

I’ve got a RIA silverlight 4 app with a complex data type as a

  • 0

I’ve got a RIA silverlight 4 app with a complex data type as a model. As a familiar example let’s call it aspnet_User which has a member object called aspnet_Membership; aspnet_User has a member called “UserName” and aspnet_Membership has a member called “Email”. Now using the aspnet_User as a datacontext I want to bind to any changes in aspnet_User or an attached aspnet_Membership – i.e. I want to show if an aspnet_User is ‘dirty’. The dirty flag should show if I change either aspnet_User.UserName or aspnet_Membership.Email. Now previously I have implemented a Converter and bound to the EntityState on an object, and this is fine for showing whether simple properties are dirty but EntityState is not altered when aspects of aspnet_Membership member are edited.

I have tried to implement a property called BubbledEntityState which reflects a modified EntityState on either aspnet_User or aspnet_membership. It is defined in a partial class in the Silverlight project. This needs to react to EntityState PropertyChanged events on aspnet_User or it’s member aspnet_Membership. So I’ve tried to handle these events in the partial OnCreated method. Strangely however this isn’t getting called at all. Here is the method:
public partial class aspnet_User
{

    partial void OnCreated()
    {
        this.aspnet_Membership.PropertyChanged += new System.ComponentModel.PropertyChangedEventHandler(aspnet_Membership_PropertyChanged);
        this.PropertyChanged += new System.ComponentModel.PropertyChangedEventHandler(aspnet_User_PropertyChanged);
    }

…
}

I’m presuming aspnet_User objects are constructed on the server and are not ‘reconstructed’ when they are reconstituted on the client after RIA has done it’s WCF call. This strikes me as peculiar. Am I doing something cranky? Anyone got a better way of dealing with 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-13T06:24:17+00:00Added an answer on May 13, 2026 at 6:24 am

    OK I’ve got this working. It still seems a bit convoluted, but rather than using the OnCreated partial method I’ve overloaded the OnLoaded method:

    protected override void OnLoaded(bool isInitialLoad)
            {
                base.OnLoaded(isInitialLoad);
                this.PropertyChanged += new System.ComponentModel.PropertyChangedEventHandler(aspnet_User_PropertyChanged);
            }
    
        partial void OnCreated()
        {
    
        }
    
        void aspnet_User_PropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e)
        {
            if (e.PropertyName == "aspnet_Membership")
            {
                if (this.aspnet_Membership != null)
                {
                    this.aspnet_Membership.PropertyChanged+=new System.ComponentModel.PropertyChangedEventHandler(aspnet_Membership_PropertyChanged);
                }
            }
            if (e.PropertyName == "EntityState")
                this.OnPropertyChanged(new System.ComponentModel.PropertyChangedEventArgs("BubbledEntityState"));
        }
    
        void aspnet_Membership_PropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e)
        {
            if (e.PropertyName == "EntityState")
                this.OnPropertyChanged(new System.ComponentModel.PropertyChangedEventArgs("BubbledEntityState"));
        }
    
        public EntityState BubbledEntityState
        {
            get
            {
                if (this.EntityState== System.Windows.Ria.EntityState.Unmodified)
                {
                    if (this.aspnet_Membership==null)
                        return System.Windows.Ria.EntityState.Unmodified;
                    if (this.aspnet_Membership.EntityState== System.Windows.Ria.EntityState.Modified)
                        return System.Windows.Ria.EntityState.Modified;
                    return System.Windows.Ria.EntityState.Unmodified;
                }
                return this.EntityState;
            }
        }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 404k
  • Answers 404k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Your pattern is right, works for me, including start of… May 15, 2026 at 5:21 am
  • Editorial Team
    Editorial Team added an answer The simplest way to do it is to override the… May 15, 2026 at 5:21 am
  • Editorial Team
    Editorial Team added an answer To refine lindes' answer, I'd implement it this way: (require… May 15, 2026 at 5:21 am

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.