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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T12:14:57+00:00 2026-05-16T12:14:57+00:00

Do folks have any guidance on when a simple .NET property that fires INotifyPropertyChanged.PropertyChanged

  • 0

Do folks have any guidance on when a simple .NET property that fires INotifyPropertyChanged.PropertyChanged is sufficient in a view model? Then when do you want to move up to a full blown dependency property? Or are the DPs intended primarily for views?

  • 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-16T12:14:58+00:00Added an answer on May 16, 2026 at 12:14 pm

    There are a few approaches:

    1. The dependency property

    While you using the dependency property it makes the most sense in elements-classes that have a visual appearance (UIElements).

    Pros:

    • WPF do the logic stuff for you
    • Some mechanism like animation use only dependency property
    • ‘Fits’ ViewModel style

    Cons:

    • You need to derive form DependencyObject
    • A bit awkward for simple stuff

    Sample:

    public static class StoryBoardHelper
    {
        public static DependencyObject GetTarget(Timeline timeline)
        {
            if (timeline == null)
                throw new ArgumentNullException("timeline");
    
            return timeline.GetValue(TargetProperty) as DependencyObject;
        }
    
        public static void SetTarget(Timeline timeline, DependencyObject value)
        {
            if (timeline == null)
                throw new ArgumentNullException("timeline");
    
            timeline.SetValue(TargetProperty, value);
        }
    
        public static readonly DependencyProperty TargetProperty =
                DependencyProperty.RegisterAttached(
                        "Target",
                        typeof(DependencyObject),
                        typeof(Timeline),
                        new PropertyMetadata(null, OnTargetPropertyChanged));
    
        private static void OnTargetPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            Storyboard.SetTarget(d as Timeline, e.NewValue as DependencyObject);
        }
    }
    

    2. The System.ComponentModel.INotifyPropertyChanged

    Usually, when creating a data object, you’ll use this approach. It is simple and neat solution for Data-like stuff.

    Pros and Cons – complementary to 1. You need to to implement only one event (PropertyChanged).

    Sample:

    public class Student : INotifyPropertyChanged 
    { 
       public event PropertyChangedEventHandler PropertyChanged; 
       public void OnPropertyChanged(PropertyChangedEventArgs e) 
       { 
           if (PropertyChanged != null) 
              PropertyChanged(this, e); 
       } 
    }
    
    private string name; 
    public string Name; 
    { 
        get { return name; } 
        set { 
               name = value; 
               OnPropertyChanged(new PropertyChangedEventArgs("Name")); 
            } 
    } 
    

    3.PropertyNameChanged

    Rising an event for each property with specified name(f.e. NameChanged). Event must have this name and it is up to you to handle/rise them. Similar approach as 2.

    4. Get the binding

    Using the FrameworkElement.GetBindingExpression() you can get the BindingExpression object
    and call BindingExpression.UpdateTarget() to refresh.

    First and second are the most likely depending what is your goal.

    All in all, it is Visual vs Data.

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

Sidebar

Related Questions

Folks I am surprised to see my code working, that I dont have any
Curious whether folks have setup 2 way transactional replication on the tables ASP.NET uses
folks! I have project in cc.net and this project nay start by 3 ways
I have created some JQuery that on click of specified HTML it then becomes
Folks, I have ASP.NET MVC 3 Application and I have the following JQuery script
The ruby folks have Ferret . Someone know of any similar initiative for Python?
Hey folks, I've got an ASP.NET web site project that for some reason is
I have an App that was working perfectly, then I released an update and
I have seen several places in stackoverflow where folks have elegantly and easily turned
Folks I have a sealed class as follows. I want to extend this sealed

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.