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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T16:13:49+00:00 2026-06-01T16:13:49+00:00

I don’t know if this is possible or not, but here is the code

  • 0

I don’t know if this is possible or not, but here is the code to explain the question in the title:

public class LogicClass : INotifyPropertyChanged
{
    private String _myText;
    public String MyText
    {
        get{return _myText;}
        set
        {
            _myText = value; 
            PropertyChanged(this, new PropertyChangedEventArgs("MyText"));
        }
    }
    ...
}

public partial class Window1: Window, INotifyPropertyChanged
{
    private LogicClass _logic;
    public String LogicText
    {
        get{return _logic.MyText;}
    }
    ...
}

<ContentControl Name="contentControl1" >
    <Binding ElementName="MainWindow" Path="LogicText"/>
</ContentControl>

Is there any way to make this work, without having to expose my LogicClass variable and make use of its implementation of INotifyPropertyChanged. I guess I want to know if this can bubble up, or anything other than having to have a redundant set in my UI code-behind (which is how I am doing this now)

  • 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-01T16:13:51+00:00Added an answer on June 1, 2026 at 4:13 pm

    Yes, you need to either handle the PropertyChanged event from _logic and then raise an equivalent PropertyChanged notification on LogicText, or you need to add a standard event on MyText, so you would have a MyTextChanged event, handle this and then raise the PropertyChanged for LogicText.

    So if LogicClass if never bound to directly in the Xaml, you wouldn’t need to implement INotifyPropertyChanged on LogicClass and you would do (something like) this:

    public class LogicClass
    {
        private String _myText;
    
        public event EventHandler MyTextChanged;
    
        public String MyText
        {
            get{return _myText;}
            set
            {
                _myText = value; 
                var handler = MyTextChanged;
                if(handler != null){ MyTextChanged(this, EventArgs.Empty); }
            }
        }
        ...
    }
    
    public partial class Window1: Window, INotifyPropertyChanged
    {
        private LogicClass _logic;
    
        public Window1()
        {
           _logic = ... initialised;
           _logic.MyTextChanged += (s,e) => RaisePropertyChanged("LogicText");
        }
    
    
        public String LogicText
        {
            get{return _logic.MyText;}
        }
        ...
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I don't know if this question is trivial or not. But after a couple
I don't know whether this is really possible, but I'm trying my best. If
Don't dismiss this as a newbie question! It's not, I'm not, I've tried everything,
Don't really know how to formulate the title, but it should be pretty obvious
Don't know why but font is not displaying.Please help. CSS(in css folder): style.css: @font-face
Don't know if I worded the question right, but basically what I want to
(Don't know if this is strictly on-topic, but I don't see any better Stack
Don't know if this has been asked before, so point me to another question
Don't know how to explain it better but i'm trying to get a response
Don't know if anyone can help me with this or if it's even possible.

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.