Loading the WPF samples gallery…

Sixteen samples from microsoft/WPF-Samples (MIT), ported with minimal documented deviations: Getting Started, data binding (DataTriggers, collection currency, live-updating bids), resources, Visibility, and the 11-page ShapeElements viewer whose original .xaml files run as-is. Each entry is a Page navigated through a Frame, so the gallery itself is the navigation sample.

How it's built

From examples/wpf_samples_gallery.rs — the original markup stays XAML; only the code-behind becomes Rust.

1. Original .xaml files run via include_xaml!

The ShapeElements pages are the sample's own files, compile-time validated and registered as routes.

app.register_page(
    "shapes/EllipseExample.xaml",
    include_xaml!("examples/xaml/wpf_shapes/EllipseExample.xaml"),
)
2. C# classes become reflected view-models

DataTrigger's local:Places collection is a plain Rust struct behind a Bindable; the XAML bindings don't change shape.

#[derive(Reflect, Default, Clone)]
struct Place { name: String, state: String }

<ListBox ItemsSource="{Binding places}">
  ...
  <DataTrigger Binding="{Binding state}" Value="WA">
    <Setter Property="Foreground" Value="Red"/>
  </DataTrigger>
3. Timers and event handlers become systems

PropertyChangeNotification's 2-second C# timer is a Bevy system; mutating the observable re-renders every bound row.

fn raise_bids(time: Res<Time>, mut elapsed: Local<f32>, vm: Res<VmHandle>) {
    *elapsed += time.delta_secs();
    if *elapsed < 2.0 { return; }
    *elapsed = 0.0;
    vm.0.update(|m: &mut Vm| m.bids[2].bid_item_price += 10.55);
}
4. CollectionView currency becomes explicit state

CollectionBinding's IsSynchronizedWithCurrentItem maps to a current field kept in sync with the ListBox selection.

fn sync_collection_currency(lists: Query<(&PfListBox, &Children), Changed<PfListBox>>, ui: PfQuery, vm: Res<VmHandle>) {
    let Some(list) = ui.by_name("FriendsList") else { return };
    // selected entity -> index -> m.current = m.friends[index]
}