DevicePickerViewModel
Class in Oadm.Sdk.Client.Controls · Oadm.Sdk.Client.dll
The shared device picker (DevicePickerWindow): every managed device in address order, a search over address, model, MAC address, host name and tags, Select all / Select none for the devices the search shows, and the count. With DevicePickerOptions it also offers “All devices”, the tags (a tag stands for every device with it; its devices show checked with the tag’s name) and the device of the event; the result is DevicePickerViewModel.Choice. Built for thousands of devices: the list is replaced in one step, the count is kept per change, select all, none and a tag change are one pass.
public sealed class DevicePickerViewModel : ObservableObjectInherits ObservableObject
Constructors
Section titled “Constructors”DevicePickerViewModel
Section titled “DevicePickerViewModel”DevicePickerViewModel(IEnumerable<IDeviceInfo> devices, IEnumerable<Guid>? selected = null, Func<IDeviceInfo, string?>? unavailableReason = null)Parameters
devices: Every device that can be shown.selected: The devices chosen when the picker opens.unavailableReason: Why a device cannot be chosen (null = it can); such devices are greyed.
DevicePickerViewModel
Section titled “DevicePickerViewModel”DevicePickerViewModel(IEnumerable<IDeviceInfo> devices, DeviceChoice initial, DevicePickerOptions options, Func<IDeviceInfo, string?>? unavailableReason = null)Parameters
devices: Every device that can be shown.initial: The choice when the picker opens.options: All devices, tags, the device of the event.unavailableReason: Why a device cannot be chosen (null = it can); such devices are greyed.
Properties
Section titled “Properties”Choice
Section titled “Choice”DeviceChoice Choice { get; }The result: all devices, the device of the event, or the devices and tags chosen.
ChosenCount
Section titled “ChosenCount”int ChosenCount { get; }How many devices are chosen.
EmptyText
Section titled “EmptyText”string EmptyText { get; }What the empty list says.
HasChoices
Section titled “HasChoices”bool HasChoices { get; }Whether the left column (event device, all devices, tags) is shown.
HasTags
Section titled “HasTags”bool HasTags { get; }There are tags to choose.
bool IsAll { get; set; }Radio “All devices”.
IsChosen
Section titled “IsChosen”bool IsChosen { get; set; }Radio “Chosen devices and tags”: the tags and the device list can be used.
IsEmpty
Section titled “IsEmpty”bool IsEmpty { get; }The list shows nothing.
IsEventDevice
Section titled “IsEventDevice”bool IsEventDevice { get; set; }Radio “The device of the event”.
DeviceChoiceKind Kind { get; set; }The radio choice of the left column.
Options
Section titled “Options”DevicePickerOptions Options { get; }What the picker offers.
SearchText
Section titled “SearchText”string SearchText { get; set; }The search over address, model, MAC address, host name and tags.
SelectAllCommand
Section titled “SelectAllCommand”IRelayCommand SelectAllCommand { get; }Gets an IRelayCommand instance wrapping DevicePickerViewModel.SelectAll.
SelectNoneCommand
Section titled “SelectNoneCommand”IRelayCommand SelectNoneCommand { get; }Gets an IRelayCommand instance wrapping DevicePickerViewModel.SelectNone.
SelectedIds
Section titled “SelectedIds”IReadOnlyList<Guid> SelectedIds { get; }The devices chosen one by one, in list order (not those of a chosen tag).
ShowNoTags
Section titled “ShowNoTags”bool ShowNoTags { get; }Tags are allowed but no device has one.
Summary
Section titled “Summary”string Summary { get; private set; }“12 of 4,812 devices chosen”.
IReadOnlyList<TagPickItem> Tags { get; }The tags to choose.
Visible
Section titled “Visible”RangeObservableCollection<DevicePickItem> Visible { get; }The devices the search shows.