Skip to content

DevicePickerWindow

Class in Oadm.Sdk.Client.Controls · Oadm.Sdk.Client.dll

The shared device picker of every dialog that needs a set of devices (host and plugins, one window, never a copy): title bar, one card with the count and a search, Select all / Select none for the devices the search shows, and a virtualized list with a check box per device (address, model; a device that cannot be chosen is greyed with the reason), then Cancel / OK. With DevicePickerOptions a column on the left offers the device of the event, All devices, or Chosen devices and tags with the tag list (devices of a chosen tag show checked with the tag). Open it with DevicePickerWindow.ShowAsync; the view model is DevicePickerViewModel.

public sealed class DevicePickerWindow : Window

Inherits Window

Guide: UI kit

DevicePickerWindow(DevicePickerViewModel viewModel)

The window for viewModel; usually opened through the static ShowAsync methods.

string? Heading { get; set; }

The window title (title bar and task switcher).

DevicePickerViewModel ViewModel { get; }

Its view model.

static Task<IReadOnlyList<Guid>?> ShowAsync(Window owner, IEnumerable<IDeviceInfo> devices, IEnumerable<Guid>? selected = null, Func<IDeviceInfo, string?>? unavailableReason = null, string heading = "Choose devices")

Shows the picker over owner; returns the chosen devices (in list order), or null when cancelled.

static Task<DeviceChoice?> ShowChoiceAsync(Window owner, IEnumerable<IDeviceInfo> devices, DeviceChoice initial, DevicePickerOptions options, string heading = "Choose devices")

Shows the picker with all devices, tags and (with DevicePickerOptions.EventDeviceText) the device of the event; returns the choice, or null when cancelled.

static Task<Guid?> ShowOneAsync(Window owner, IEnumerable<IDeviceInfo> devices, Guid? selected = null, Func<IDeviceInfo, string?>? unavailableReason = null, string heading = "Choose a device")

Shows the picker for exactly one device (DevicePickerOptions.SingleDevice) over owner; returns its id, or null when cancelled or none was chosen.