开发者

Silverlight: Not naming controls in XAML when using MVVM (Silverlight)?

Can anyone confirm if I am using MVVM (2 way binding) then I don't need to name my controls in XAML as I won't be accessing them via code behind but will be updating them by Binding?

This was the case with WPF but un开发者_StackOverflow社区sure whether Silverlight allows a control without x:Name?


You don't have to name your controls to use binding. But you still can name them to aid in some UI scenarios (animations, drag&drop, etc).


You don't need them for View-ViewModel connection. However, names are needed i.e. when binding to other XAML elements (using Binding ElementName=nameOfControl, Path=propertyOfControl).

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜