Skip to content
David Desmaisons edited this page Mar 28, 2017 · 10 revisions

Basic features

  • All CLR types are supported by Neutronium: String, Int, Double, Decimal are transformed in their javascript equivalent.

  • C# DateTime type is mapped to javascript dateTime.

  • Enum is transfomed to custom javascript object containing two properties: intValue and displayName. intValue is the numeric value of the enum, displayName is the value of the Description attribute if any or the object.ToString() value.

  • Complex object are mapped to javascript using reflection on public attributes.

Binding support

  • Tracking of property changes is done via INotifyPropertyChanges interface. This way changes in the ViewModel are reflected in the HTML View.

  • Tracking of collection changes is supported listening INotifyCollectionChanges interface. This way, any collection implementing this interface will be updated in the view when changing. This provides native integration with ObservableCollection.

  • Changes in HTML View are propagated to ViewModel using knockoutjs subscription or Vuejs watch (both property and collection). This allows you for example to have a collection binding to the selected items in the HTML view that will bind to your ViewModel collection.

  • ICommand are converted to javascript function so you can execute them using knockout or Vue.

Complex viewmodel supported

-Nested ViewModel fully supported

-One to one object mapping (that is if you have a same object referenced n times in your C# ViewModel, it will be mapped only one time and reference n times in the javascript session).

Import

Only public property are mapped during binding. So it may be a good idea to use internal for property that have no effect on the view, as it may improve binding performance.

Full working examples are provided in the Neutronium examples folder. See projects:

Clone this wiki locally