vovgou / loxodon-framework

An MVVM & Databinding framework that can use C# and Lua to develop games
MIT License
1.86k stars 363 forks source link

Binding enum failed #6

Closed yanjingzhaisun closed 3 years ago

yanjingzhaisun commented 4 years ago

Issue

BindingSet.Bind().For(v=>v.enumType).To(vm=>vm.enumType) got error.

How to reproduce

Step 1: Declare a public enum type, and a public enum property, for both view and view model class. Property in view model needs to follow the Set<> function inherited from ViewModelBase class. Step 2: In View class, create a bindingSet, and bind the view's enum property onto viewModel's enum property. Step 3: In controller class, set data context. Step 4: Run the game

Reasons

In Binding.cs, the enum type was cast as Int32.

vovgou commented 4 years ago

Thank you for the report, it has been fixed!