c# - When do we need to create our own custom dependency property? -
I am quite new to the Silverlight and therefore, after going through more than a dozen articles on dependency properties, I still A little confused, when do we need to explicitly make our custom dependency properties? Those technical terms on those articles have made me very confused. Can anyone tell me the scenario when we need to use a text box when we need to make a DP? If this is only for binding, then we can easily do something else in the videollege to bind the text, but why do we need to make the DP our own? I'm a bit confused please help me with an example As a rule of thumb: you never need to make any any in your ViewModels> DependencyProperties
. Explanation: You are using control
to write from your view, those controllers need to be dependent because their values are databinding
(When the concerned property is not a DP then a data-binding will not work) but the source of that value is not required to be a DP (even if it is double bond). So your ViewModel can have simple properties.
So, when you are at a point where you create your custom control, you will need to define dependencies properties in these controls, otherwise you can not use databasing.
Comments
Post a Comment