enisn / UraniumUI

Uranium is a Free & Open-Source UI Kit for MAUI.
Apache License 2.0
1.06k stars 121 forks source link

[`AutoFormView`] a method to provide properties instead of reflection #682

Open jcyuan opened 3 weeks ago

jcyuan commented 3 weeks ago

otherwise AOT can't get compiled.

btw i don't know why, my App got stuck when booting up if i use AutoFormView...... not sure why, still investigating.

btw, in the doc https://enisn-projects.io/docs/en/uranium/latest/infrastructure/AutoFormView,

Then you can use it like this:
<uranium:FormView Source="{Binding .}" />

i believe it's a typo? should be uranium:AutoFormView i think?

jcyuan commented 3 weeks ago

btw, a question about usage, ReactiveAttribute is required? or i can actually use ObservableProperty too? my app does not use ReactiveUI.....

jcyuan commented 3 weeks ago

otherwise AOT can't get compiled.

btw i don't know why, my App got stuck when booting up if i use AutoFormView...... not sure why, still investigating.

btw, in the doc https://enisn-projects.io/docs/en/uranium/latest/infrastructure/AutoFormView,

Then you can use it like this:
<uranium:FormView Source="{Binding .}" />

i believe it's a typo? should be uranium:AutoFormView i think?

my App got stuck, i found the reason, if StyleClass missing, it will happen.....

for example i use this: <Button input:FormView.IsSubmitButton="True" Text="Add" StyleClass="ElevatedButton" /> ElevatedButton missing caused the hanging.... the default styles provided by UraniumUI does not have this style key, i tried to search but no result.

jcyuan commented 3 weeks ago

otherwise AOT can't get compiled. btw i don't know why, my App got stuck when booting up if i use AutoFormView...... not sure why, still investigating. btw, in the doc https://enisn-projects.io/docs/en/uranium/latest/infrastructure/AutoFormView,

Then you can use it like this:
<uranium:FormView Source="{Binding .}" />

i believe it's a typo? should be uranium:AutoFormView i think?

my App got stuck, i found the reason, if StyleClass missing, it will happen.....

for example i use this: <Button input:FormView.IsSubmitButton="True" Text="Add" StyleClass="ElevatedButton" /> ElevatedButton missing caused the hanging.... the default styles provided by UraniumUI does not have this style key, i tried to search but no result.

I'm sorry, just solved. this was caused by the same reason i have found and reported to MAUI team: https://github.com/dotnet/maui/issues/23079 :(

enisn commented 2 weeks ago

Hi, sorry for the late reply, I was away for a while.

AutoFormView is an experimental component and at the beginning, its purpose was to build PoC CRUD operations faster.

But I know it should support AOT compilation and using reflection causes problems on AOT compilation. So, I agree to replace Reflection usage with Source Generator or a method provider/factory for properties

enisn commented 2 weeks ago

btw, a question about usage, ReactiveAttribute is required? or i can actually use ObservableProperty too? my app does not use ReactiveUI.....

[Reactive] is just for demonstration, It'll work plain properties or fields with ObservableProperty attribute. I should add an information about it in the documentation 👍

jcyuan commented 2 weeks ago

Hi, sorry for the late reply, I was away for a while.

AutoFormView is an experimental component and at the beginning, its purpose was to build PoC CRUD operations faster.

But I know it should support AOT compilation and using reflection causes problems on AOT compilation. So, I agree to replace Reflection usage with Source Generator or a method provider/factory for properties

I got it. thanks man! this is absolutely a super component IMO!! I love it! It makes things so simple ❤️‍🔥