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

  • Home
  • SEARCH
  • 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 8822547
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T06:08:01+00:00 2026-06-14T06:08:01+00:00

I have a Windows Store project as follows: class MyModel { private int _testVar;

  • 0

I have a Windows Store project as follows:

class MyModel
{
    private int _testVar;
    public int TestVariable
    {
        get { return _testVar; }
        set
        {
            _testVar = value;
            NotifyPropertyChanged("TestVariable");
        }
    }

    public event PropertyChangedEventHandler PropertyChanged;

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


}

My binding is as follows:

<Grid Background="{StaticResource ApplicationPageBackgroundThemeBrush}">
    <TextBlock Text="{Binding Path=TestVariable}" />
    <Button Click="Button_Click_1"></Button>
</Grid>

And the code behind:

    MyModel thisModel = new MyModel();

    public MainPage()
    {
        this.InitializeComponent();

        thisModel.TestVariable = 0;
        DataContext = thisModel;
    }

As this point, the binding appears to work as I get the textblock showing a 0. However, when I handle the button click event as follows:

    private void Button_Click_1(object sender, RoutedEventArgs e)
    {
        thisModel.TestVariable++;
    }

I don’t see the number increasing. What am I missing here?

  • 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-14T06:08:02+00:00Added an answer on June 14, 2026 at 6:08 am

    It seems that your class doesn’t implement INotifyPropertyChanged.
    I mean I expected to see class MyModel : INotifyPropertyChanged

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

Sidebar

Related Questions

I have a Windows project in Visual Studio 2010 in which I store all
Set up and Explanation : I'm working on a project for school, and have
I have this Metro App project that I just tried building for the Windows
I have a Windows, C++ software project (built with Visual Studio 2005, SP1) that
I have the following projects: MVC Console application Class library Windows forms application COM
linux: $HOME/.config windows: %APPDATA% mac os: $HOME/.config It can be set using http://qt-project.org/doc/qt-4.8/qsettings.html#setPath ,
I'm doing a small project to store movies. I'm using three windows form, a
I have a Windows.Forms based .NET desktop application that stores privileged information in a
I have a SQL dump file consisting of incorrectly stored Cyrillic Russian ( WINDOWS-1251
Can I host an application in Windows Azure and have the database stored on

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.