How to bind caliburn.micro view model to WP8 LongListSelector control?

情到浓时终转凉″ 提交于 2019-12-08 08:36:28

If i understand your question correctly, then you want normal Caliburn.Micro conventions to be applied to the LongListSelector control.

I don't work with Windows Phone development but i think it can be done by calling the following line of code in the Configure() method of the bootstrapper.

ConventionManager.AddElementConvention<LongListSelector>(LongListSelector.ItemsSourceProperty, "SelectedItem", "SelectionChanged");

This code tells Caliburn.Micro to use the ItemsSource property whenever it a finds a named (e.g. x:Name="myList") LongListSelector and to use the SelectedItem whenever a LongListSelector element is passed in the parameter list of an action message, and finally it uses the SelectionChanged event to fire action messages by default.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!