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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T07:25:23+00:00 2026-06-09T07:25:23+00:00

I have three classes, first: public class Setting which has properties: string ID, string

  • 0

I have three classes,
first:

public class Setting

which has properties:

string ID, string Value; (implements INotifyPropertyChanged on Value)

Second:

public class SettingCollection

which is a:

ObservableCollection<Setting>

Third:

public class SimObject

which has properties:

string ID, SettingsCollection Settings;

I have a View:
SettingsDisplay.xaml
which has dependency property:

SettingsCollection SimObjSettings;

and displays the setting’s ID and with its Value in a TextBox inside an ItemsContainer.

My MainWindow ViewModel has a SimObject Jeff; and in the View I have

<local:SettingsDisplay SimObjSettings="{Binding Jeff.Settings}"/>

This all works fine.

I need to know when a Setting Value changes and when that happens I need to know the SimObject ID the Setting belongs to so that I can call a method that sends an event with the Setting ID, Value and the SimObject ID. (e.g. SendEvent(settingID, settingValue, targetObject))

Obviously Setting‘s and SettingCollection‘s have no knowledge of what SimObject they belong to.

The way I’ve tried to do this is in the Setting class call SendEvent in the Value property’s Setter.

I’m struggling to find a suitable way to pass the SimObject‘s ID down the chain to the Setting‘s class, I also don’t think this is a good solution.

What is the best way to acheive what I’m trying to do?

  • 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-06-09T07:25:26+00:00Added an answer on June 9, 2026 at 7:25 am

    I ended up solving this by giving all Setting‘s a SimObject property, which was the setting’s SimObject owner, and creating an event handler delegate void SettingHandler(string settingID, string settingValue, string targetObj);
    in SimObject : public event SettingHandler SettingChanged;

    public void RaiseSettingChangedEvent(string settingId, string settingValue, string targetObj)
    {
        if (SettingChanged != null)
        {
            SettingChanged(settingId, settingValue, targetObj);
        }
    }
    

    In Setting on the string Value Setter:

    set
    {
       _value = value;
       RaisePropertyChanged("Value");
       SimObject.RaiseSettingChangedEvent(ID, Value, SimObject.Settings["UID"].Value);
    }
    

    Then in SettingsDisplay I created a SelectedPropertyChangedCallback which adds the ParameterChanged event to the SimObject and also contains the SettingChanged method:

    public void SettingChanged(string settingID, string settingValue, string targetObj)
    {
        Framework.GetBusinessDelegate().SendEvent(settingID, settingValue, targetObj);
    }
    

    Don’t know how to add syntax highlighting to make this answer clearer.

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

Sidebar

Related Questions

I have three classes: Generic, CFG, and Evaluator. Here's Generic: class Generic: public virtual
I have an interface (say Employee) which has 2 classes that implements it (say
I have the following Classes and am using EF 4.2 Code First public class
I have three class in my app. First extends Activity public class TestProjActivity extends
I have three classes: PurchaseOrder, PurchaseOrderLine, Item PurchaseOrder children are PurchaseOrderLine which is related
I have three classes; Classes A and B both reference class C . How
I have three classes: ClassA , ClassB , ClassC . ClassC extends ClassB which
If I have three classes class A class B extends A class C extends
I have the following Post entity: public class Post { public string Id {get;set;}
Let's say I have these classes: public class BaseMapClass<T1, T2> { protected T1 Thing1;

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.