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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T11:37:36+00:00 2026-06-11T11:37:36+00:00

I have problem with binding to static property. I want to have Label with

  • 0

I have problem with binding to static property.
I want to have Label with Content true or false depending on the value of bool variable.

XAML:

<Label Content="{Binding Source={x:Static l:MainWindow.IsTrue}, Mode=OneWay}" />

Code behind:

public partial class MainWindow : Window
{
    public static bool IsTrue { get; set; }
    DispatcherTimer myTimer;

    public MainWindow()
    {
        InitializeComponent();

        myTimer = new DispatcherTimer();
        myTimer.Interval = new TimeSpan(0, 0, 2); // tick every 2 seconds
        myTimer.Tick += new EventHandler(myTimer_Tick);
        myTimer.IsEnabled = true;
    }

    void myTimer_Tick(object sender, EventArgs e)
    {
        IsTrue = !IsTrue;
    }
}

It displays False all the time.

I know that in order to implement two way binding I need to specify Path. But I need one way binding.

  • 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-11T11:37:38+00:00Added an answer on June 11, 2026 at 11:37 am

    The problem is that WPF doesn’t know when (or if) your property changes. Unlike an instance method, there is no INotifyPropertyChanged-style interface you can implement, since you can’t have a “static interface.” As such, it never sees your changed value.

    If you’re using WPF 4.5, you can use the new static property changed notification support to handle this.

    In .NET 4.0 or earlier, the easiest way to handle this is typically to wrap the property into a singleton, and use INotifyPropertyChanged on the singleton instance.

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

Sidebar

Related Questions

I have a problem in binding JSON data to KENDO Pie Chart. I have
I have a problem with my Binding to a ListBox Control. Actually i have
I have a problem with the binding of the below parameter. The connection works
We have an interesting problem with WCF binding and streaming transfer mode that we
I have a UserControl that I want to participate in data binding. I've set
I have a problem whit binding in wpf i have a textbox where i
I am having major problem in Data Binding. I have a stackpanel with an
I have trouble with binding Boolean property in association classes. Property is set to
I have a XAML view with a list box: <control:ListBoxScroll ItemSource={Binding Path=FooCollection} SelectedItem={Binding SelectedFoo,
I have a two userControls (IconUserControl & DisplayUserControl), I'm having a problem with binding

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.