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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T07:20:16+00:00 2026-06-06T07:20:16+00:00

I have never come across this issue but most recently I noticed that a

  • 0

I have never come across this issue but most recently I noticed that a two way binding to a property doesn’t work if the property resides in a Singleton.

What I mean is that the ‘other’ CheckBox never updates its value.

Any ideas on how to make it work?
Thanks in advance!

Singleton.cs

public class Singleton : INotifyPropertyChanged
{
    private bool panelClosed;

    static Singleton()
    {
        Instance = new Singleton();
    }

    public event PropertyChangedEventHandler PropertyChanged;

    public static Singleton Instance { get; private set; }

    public bool PanelClosed
    {
        get
        {
            return this.panelClosed;
        }

        set
        {
            this.panelClosed = value;
            this.NotifyPropertyChanged("PanelClosed");
        }
    }

    private void NotifyPropertyChanged(string info)
    {
        if (this.PropertyChanged != null)
        {
            this.PropertyChanged(null, new PropertyChangedEventArgs(info));
        }
    }
}

XAML:

<CheckBox 
    Content="Check/Uncheck me" 
    Height="16" Name="checkBox1" 
    IsChecked="{Binding Source={x:Static local:Singleton.Instance}, Path=PanelClosed, 
                UpdateSourceTrigger=PropertyChanged, Mode=TwoWay}"/>

<CheckBox 
    Content="Sanity Check" 
    Height="16" Name="checkBox2" 
    IsChecked="{Binding Source={x:Static local:Singleton.Instance}, Path=PanelClosed, 
                UpdateSourceTrigger=PropertyChanged, Mode=TwoWay}" />
  • 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-06T07:20:17+00:00Added an answer on June 6, 2026 at 7:20 am

    This had me confused for a bit, but it’s a simple fix. There’s no problem using a singleton.

    Change

    this.PropertyChanged(null, new PropertyChangedEventArgs(info));
    

    to

    this.PropertyChanged(this, new PropertyChangedEventArgs(info));
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

While answering this question I noticed that I have never come across any property
Weirdly, I've never come across this issue before, but I've just started making a
I have come across this problem in the past but never solved it. I
I've never come across this before: I have a series of text boxes. The
I have seen many souce codes but I have never ever come across a
Never come across this before, just cannot understand the reasoning behind it. I have
I've been working with Java for a long time but never have come across
I have come across a very odd problem in C that I have never
I have come across this problem before and I have never understood the reasoning
I come from the iPhone development world but have never developed desktop applications. Now

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.