Caliburn Micro uses naming convention to bind view-model and views together, this relieves the developers from declaring explicit binding attributes on the xaml. Caliburn uses the very same approach for automagically binding the collection controls to collection property on the view model.
Example: CM can automatically bind your collection control’s (listbox/combobox etc) ItemSource property to a bindable collection on the viewmodel provided (1) the name on the view is the same as the property name on the view-model (2) the name is plural (“Items” for example, the name should be plural for the following part to work), even better if you create another property on the VM, with the same name as the collection but singular and prefixed with “Selected” i.e. SelectedItem, then calibre comprehends it as the literal Selected object on the collection control (See last screenshot for an example where I have used MyTabs and MySelectedTab attributes). The order of preference for the literal prefix is to “Active”, “Selected” and then “Current”.
This naming convention based approach works fine as long as you stick to the core WPF UI elements, but for third party framework you need to specify your own convention, otherwise Caliburn Micro would not have any way to bind the third party control to your view model.
I was practicing/learning XamTabControl using CM and wanted to bind the tabs just how I would bind the listbox, I created the below convention that you can specify in your CM bootstrapper’s configure function. (copy the convention here)
With this you can bind your Infragistic’s XamTabControl to a collection of TabItemEx, and set Selected/Active/Current Item from the code behind or view.
View Model:
View
