Windows 8 C # Metro App GUI Update

I created the base Metro application for Win 8 using Visual Studio 11 Ultimate in C #.

The problem is that I want to display text that changes dynamically with certain events. An example is an application in which the number is displayed on the screen and increases by 1 with each mouse click.

I use XAML binding to the created data structure, which gets the values ​​that I need to display, but the problem is that when these values ​​change, the numbers displayed in the GUI do not change.

How to link your XAML with dynamically changing data so that the XAML changes in the GUI also change?

Thanks for the help!

- change -

I implemented the INotifyPropertyChanged interface, but now I get an exception from this line of code:

PropertyChanged (this is the new PropertyChangedEventArgs (propertyName));

Here is the exception information:

An application is called an interface that has been configured for another thread. (Exception from HRESULT: 0x8001010E (RPC_E_WRONG_THREAD))

+5
source share
1 answer

Make sure your data structure you are binding (correctly) implements INotifyPropertyChanged and raises the PropertyChanged event if you want to notify the user interface of the change.

This is an interface that allows the xaml level to know when values ​​change in related data and update accordingly.


Change in response to new information:

An application is called an interface that has been configured for another thread. (Exception from HRESULT: 0x8001010E (RPC_E_WRONG_THREAD))

, , , . , , CoreDispatcher.RunAsync. . .

+7

All Articles