c# - How to bind a WPF control value to a method? -


Imagine that I have a text box that this text should be equal to the number of processes running in the machine.

How to update it without using a timer? Is there any way to use dependency assets or bindings?

I'm not sure what it's binding with for a method.

You have to call the system timer, just the same.

You can set DataContext to an object which exposes a property with INotifyPropertyChanged and the data that you want (the recipient, can definitely call a method) Does.

Without a timer, you will need an event in which your data object can subscribe, and then you can increase a notification that the interest of the property has changed every time the event is on fire, and that The UI element associated with the property will be updated.


Comments

Popular posts from this blog

c# - sqlDecimal to decimal clr stored procedure Unable to cast object of type 'System.Data.SqlTypes.SqlDecimal' to type 'System.IConvertible' -

Calling GetGUIThreadInfo from Outlook VBA -

Obfuscating Python code? -