Primary WinUI APIs:
Primary Avalonia APIs:
| WinUI idiom | Avalonia idiom |
|---|---|
| WinUI control and state pipeline | Avalonia control themes, selectors, and transitions |
| WinUI command/input surfaces | Avalonia commands + KeyBinding/routed input |
| WinUI resource/theme flow | Avalonia resource dictionaries + ThemeVariant |
WinUI XAML:
<muxc:ItemsRepeater ItemsSource="{x:Bind ViewModel.Items}"><muxc:ItemsRepeater.Layout><muxc:StackLayout Spacing="8" /></muxc:ItemsRepeater.Layout></muxc:ItemsRepeater>
WinUI C#:
var repeater = new ItemsRepeater(); repeater.ItemsSource = ViewModel.Items;
Avalonia XAML:
<ListBox ItemsSource="{Binding Items}">
<ListBox.ItemsPanel>
<ItemsPanelTemplate>
<VirtualizingStackPanel />
</ItemsPanelTemplate>
</ListBox.ItemsPanel>
</ListBox>
Avalonia C#:
var list = new ListBox { ItemsSource = viewModel.Items };