dotnet / android

.NET for Android provides open-source bindings of the Android SDK for use with .NET managed languages such as C#
MIT License
1.94k stars 533 forks source link

Documentation Layout Binding #9440

Closed christophechateau closed 1 month ago

christophechateau commented 1 month ago

Android framework version

net8.0-android

Affected platform version

NET 8.0

Description

Hi,

First thanks for the work around the android dotnet runtime !

Until the end of Xamarin support (may 2024), there is some confusion in naming and technology choice with :

Now, i'm looking for a documentation, snippet or any example on how to do layout binding with dotnet android.

Thanks for you light

Steps to Reproduce

-

Did you find any workaround?

No response

Relevant log output

No response

jpobst commented 1 month ago

If you are referring to Layout Binding, here is the documentation for that: https://learn.microsoft.com/en-us/dotnet/android/features/layout-code-behind/

If you are referring to DataBinding, there is no built-in solution: https://github.com/dotnet/android/issues/7714.

The Java DataBinding libraries will not work, so you'll need a framework that runs on top of .NET for Android that provides that capability like MAUI or MvvmCross.

Additionally, here's the documentation for Xamarin.Android. Unfortunately it was delisted from search engines, but 99% of it is still applicable to .NET for Android: https://learn.microsoft.com/en-us/previous-versions/xamarin/android

christophechateau commented 1 month ago

thanks for your help.

I already saw the layout-code-behind. It's more a microsoft designation for object mapping : the mapping between XML components and C# object.

I get a pointer to the AndroidX.DataBinding from the discord channel. It seems closest to what i need, i will look into it.