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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T19:09:52+00:00 2026-05-22T19:09:52+00:00

My issue seems to be scope, though I’m not certain that’s the right terminology.

  • 0

My issue seems to be “scope”, though I’m not certain that’s the right terminology. I want to notify a read-only list to re-evaluate itself when a property within a custom object is set. I believe it is simply not aware of it’s existence. Maybe there is an easy way around this I cannot think of, but I’m drawing a blank.

I find this hard to put into words, so here’s simplified code with my comments on what I expect to happen.

Properties within object in which I am databinding to:

private CvarAspectRatios _aspectRatio = new CvarAspectRatios("none", GetRatio());
public CvarAspectRatios AspectRatio
{
    get { return _aspectRatio; }
    set
    {                                                 // This setter never gets hit since I bind to this 
        if (value != null)                            // object's 'Value' property now.
        {
            _aspectRatio = value;
            NotifyPropertyChanged("AspectRatio");
            NotifyPropertyChanged("ResolutionList");  // I want to inform ResolutionList
        }                                             // that it needs to repopulate based
    }                                                 // on this property: AspectRatio
}

private ResolutionCollection _resolutionList = ResolutionCollection.GetResolutionCollection();
public ResolutionCollection ResolutionList
{
   get 
   {
       ResolutionCollection list = new ResolutionCollection();
       if (AspectRatio != null && AspectRatio.Value != null)
       {
           foreach (Resolutions res in _resolutionList.Where(i => i.Compatibility == AspectRatio.Value.Compatibility))
           {
               list.Add(res);
           }
           return list;
       }
       return _resolutionList;
   }
}

CvarAspectRatios Class:

public class CVarAspectRatios : INotifyPropertyChanged
{
    private string _defaultValue;
    public string DefaultValue
    {
        get { return _defaultValue; }
        set { _defaultValue = value; NotifyPropertyChanged("DefaultValue"); }
    }

    private AspectRatios _value;
    public AspectRatios Value
    {
        get { return _value; }
        set 
        { 
            _value = value; 
            NotifyPropertyChanged("Value"); 
            NotifyPropertyChanged("ResolutionList");  // This value gets set, and I'd like for ResolutionList to update
        }                                             // but it cannot find ResolutionList. No errors or anything. Just
    }                                                 // no update.

    public AspectRatios() { }

    public AspectRatios(string defaultValue, AspectRatios val)
    {
        DefaultValue = defaultValue;
        Value = val;
    }

    // Implementation of INotifyPropertyChanged snipped out here
}

What do you folks think? If you’d like a sample application I can whip one up.

  • 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-22T19:09:53+00:00Added an answer on May 22, 2026 at 7:09 pm

    Since CVarAspectRatios implements INotifyPropertyChanged, you can have the viewmodel class subscribe to the PropertyChanged event for the AspectRatio.

    public class YourViewModel 
    {
        public YourViewModel()
        {
            AspectRatio.PropertyChanged += AspectRatio_PropertyChanged;
        }
    
        void AspectRatio_PropertyChanged(object sender, PropertyChangedEventArgs e)
        {
            if (e.PropertyName == "Value")
                NotifyPropertyChanged("ResolutionList");
        }        
    }
    

    Just bear in mind that if you discard that AspectRatio object (if the object reference changes and not just the value property of that object), you should unsubscribe from the event on the discarded one.

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

Sidebar

Related Questions

I've been investigating this issue that only seems to get worse the more I
I have an issue that seems like very flaky behavour, is this a problem
I've got a weird issue that almost seems like a Visual Studio 2008 issue.
It seems to be a known issue that the built-in version of vim in
My issue is that the trigger detailed below seems to execute correctly except for
I'm running into some type of a scope issue that's preventing instance variables from
I'm having an issue with a Coldfusion component that I'm building. Well, I'm not
My issue seems to be related to: https://issues.jboss.org/browse/NETTY-433 I'm trying to stop my Netty
This seems like such a simple issue but I cannot find an elegant solution.
This seems like an easy enough issue but I can't seem to find the

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.