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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T17:22:55+00:00 2026-05-23T17:22:55+00:00

Hello Stackoverflowians, I have a questions in regards to what is the best way

  • 0

Hello Stackoverflowians,

I have a questions in regards to what is the best way of making sure your Silverlight or WPF views are kicking off NotifyPropertyChanged events correctly.

I have a case in a Silverlight Application where I set my DataContext like this;

 public SubTopic SubTopicItem
        {
            get { return (SubTopic)GetValue(SubTopicItemProperty); }
            set { SetValue(SubTopicItemProperty, value); }
        }

        // Using a DependencyProperty as the backing store for SubTopicItem.  This enables animation, styling, binding, etc...
        public static readonly DependencyProperty SubTopicItemProperty =
            DependencyProperty.Register("SubTopicItem", typeof(SubTopic), typeof(AddModifySubTopic), new PropertyMetadata(null));


        public AddModifySubTopic()
        {
            InitializeComponent();
            this.DataContext = this;       
        }

And i am having problems with some Data Grids that the pull data out of Some EntityPropertys that are on this object.

My main questions is, would it make any real difference if instead of using

    public AddModifySubTopic()
    {
        InitializeComponent();
        this.DataContext = this;       
    }

i use:

        public AddModifySubTopic()
        {
            InitializeComponent();
            this.DataContext = SubTopicItem;       
        }

Would the Silverlight or WPF Framework treat the DataContext more directly, and Notify if any property or Entity Sets change through out the life time of the Object?

At the moment i am needing to update my DataGrids with a

DataGridName.SetValue(DataGrid.ItemsSourceProperty, SubTopicItem);

Thanks Everyone.

Cheers
Robbie

  • 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-23T17:22:56+00:00Added an answer on May 23, 2026 at 5:22 pm

    It sounds like you are having problems with databinding. I think much of the code you posted isn’t going to shed much light on the problem.

    If binding isn’t working, it is almost always a problem with:

    1. The XAML binding syntax.
    2. The source object and how INotifyPropertyChanged is implemented.

    I would recommend distilling down the non-working code to make as simple a case as possible, and then post your XAML and your source object.

    Edit

    From your comment:

    The problem occurs when a new item gets added to a List<TYPE> and the
    question is more asking about what is the best approach?
    this.DataContext = DEPENDENCYOBJECT or this.DataContext =
    CHILDWINDOW/PAGE etc.

    How you set the DataContext should not affect how the binding operates (all other things being equal).

    If you are really using a List<Type>, that is likely your problem, as collection change notifications work differently than property change notifications. You will want to bind to an ObservableCollection<Type>. I’m not sure if that’s an option if your entity class is generated, but it might be (I’m not an Entity Framework expert).

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

Sidebar

Related Questions

Hello guys I am working on silverlight and I have issue regarding on database
Hello I have like this 2 tables class User public int UserId{get;set;} { ....
hello all i am working on a project in which i have a webpage
Hello i'm doing a application in php, and i have a list of items
Hello i have a TextField on my scene. It haves only digits, user input
Hello I have this problem with PyQt4-dev-tools that include: * a user interface compiler
Hello i have this code var queue = new BlockingCollection<int>(); queue.Add(0); var producers =
Hello fellow developers... just to make sure, I want to ask this question: How
Hello i have Mschart on a winform y axis is value 1,2 ... and
Hello i have a list of apartments and i need to filter them by

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.