Picker

Select a typed item from a native menu and keep it synchronized with a view model.

Picker<TItem> presents a collection of typed items through a native menu. It is a good fit for compact, single-choice settings where all options can be read at once.

Use Picker<TItem> when the chosen value is application state. Use Button.Menu instead when every entry is an independent action.

The two-way SelectedItem example uses the binding form documented in MVVM and binding.

var qualityPicker = new Picker<ExportQuality>
{
    Kind = ButtonStyle.Plain,
    Size = ButtonSize.Medium,
    Padding = Thickness.Zero,
    ShowsIndicator = true,
    ItemsSource = viewModel.Qualities,
    ItemTitle = quality => quality.DisplayName,
    Placeholder = "Choose quality",
    SelectedItem = Bind(vm => vm.SelectedQuality)
        .TwoWay((vm, val) => vm.SelectedQuality = val)
};

ItemsSource is a BindableList<TItem>. Assigning an observable collection keeps the menu current as items are inserted, removed, or replaced. ItemTitle supplies the visible label; without it, the picker uses each item's ToString() result.

Appearance

Kind accepts the same ButtonStyle values as Button because a picker is presented by a native menu button. It defaults to ButtonStyle.Gray; use ButtonStyle.Plain for a transparent, settings-style value label. Glass styles use the same earlier-system fallbacks as Button.

ShowsIndicator independently controls the native popup indicator after the title and defaults to true.

Size selects the same native size classes as Button. Padding is nullable: null preserves UIKit's default content insets for that size and style, while Thickness.Zero removes the outer insets without removing the title-to-indicator spacing.

Selection

SelectedItem is bindable and supports two-way binding. You can also react directly:

qualityPicker.SelectionChanged = quality =>
{
    preview.Quality = quality;
};

Selection is matched by object reference. If a collection is reloaded with new object instances, select the corresponding new item rather than retaining an instance from the old collection.

The picker displays Placeholder whenever no selected item belongs to the current source. A useful initial-state pattern is to set the source first, then choose its default item in the view model.