Quantcast
Channel: Caliburn.Micro: Xaml Made Easy
Viewing all articles
Browse latest Browse all 1760

Closed Unassigned: Singularize collection names does not work with "es" endings [334]

$
0
0
When binding a view model to a datagrid, property singularizing is not working properly for collection properties that end in "es".

I had a property called "Batches" to which the grid was bound. The grid correctly displayed the items in this _BindableCollection_.

However, the VM property __SelectedBatch__ was not bound to the grids selected item.

I changed the collection name to __Items__ and the selected item property to __SelectedItem__ and everything worked.

Caliburn Micro 1.5.2
WPF 4.5

Here is the offending code in ConventionManager:
>
public static Func<string, string> Singularize = original => {
return original.EndsWith("ies")
? original.TrimEnd('s').TrimEnd('e').TrimEnd('i') + "y"
: original.TrimEnd('s');
};

Viewing all articles
Browse latest Browse all 1760

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>