You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: doc/articles/features/using-skia-desktop.md
+22Lines changed: 22 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -133,4 +133,26 @@ To build an app with this feature enabled:
133
133
> [!NOTE]
134
134
> .NET Native AOT on Windows is not yet supported as WPF does not support it at this time.
135
135
136
+
### Automatic Binding Preservation
137
+
138
+
When building with Native AOT, Uno Platform automatically preserves public properties of types referenced by `[Bindable]` types to ensure data binding works correctly at runtime. This happens automatically when `PublishAot=true` is set.
139
+
140
+
The build system:
141
+
1. Finds all types marked with `Microsoft.UI.Xaml.Data.BindableAttribute` or `Uno.Extensions.Reactive.Bindings.BindableAttribute`
142
+
2. Discovers types referenced by public properties of those bindable types
143
+
3. Generates an ILLink descriptor file to preserve the public properties (getters/setters) of discovered types
144
+
145
+
For example, if you have:
146
+
```csharp
147
+
[Bindable]
148
+
publicclassMainViewModel
149
+
{
150
+
publicEntityMyEntity { get; set; }
151
+
}
152
+
153
+
publicrecordEntity(stringName);
154
+
```
155
+
156
+
The build system will automatically preserve the `Name` property of `Entity`, allowing `{Binding MyEntity.Name}` expressions to work correctly in Native AOT builds.
157
+
136
158
For more information, see [the runtime documentation](https://github.com/dotnet/runtime/blob/main/src/coreclr/nativeaot/docs/reflection-in-aot-mode.md) and the [.NET Native AOT documentation](https://learn.microsoft.com/dotnet/core/deploying/native-aot/).
0 commit comments