Register("FPSProperty", typeof(int), typeof(Global Settings), new Property Metadata(Main State.g Settings.fps, FPSChanged, FPSCoerce), FPSValidate); public int FPS private static bool FPSValidate(object value) private static object FPSCoerce(Dependency Object obj, object o) private static void FPSChanged(Dependency Object obj, Dependency Property Changed Event Args e) #endregion Recommend：c# - WPF MVVM text Box Text Bindingied writing a very simple test to see if I could remember everything, and for the life of me I can't see why its not working.
In my view I have a text Box where its text property is bound to a value in the View Model.
For example, the user can control the value using a slider.
Result property - the same property you're trying to bind.
If this binding were two-way, it would write its new value to its source property - the same property as the target property - leading to an infinite loop (actually, stack overflow). We are routing this bug to the product unit who works on that specific feature area.
This means when anyone else writes a value directly to the User Control1. This happen when you type into either the "Direct Binding" textbox or into the "Result" textbox (within the user control); both of these are bound to the User Control1.
Result property and hence both will write a value that replaces the binding.
When declaring a dependency property, you can specify a callback to be called when the property changes.