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, DeviceGroupChoice initial, DeviceGroupPickerOptions group)The device group editor (DevicePickerOptions.Group): sites and tags on the left, the devices they cover checked and locked, single devices tickable, covered devices can be excepted; the result is DevicePickerViewModel.GroupChoice. Serials of the group that no listed device has (removed devices) are kept as they are.
Parameters
devices: Every device of the server.initial: The rules of the group when the editor opens.group: The sites (“This server” first) and the defined tags.
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.
CoveredCount
Section titled “CoveredCount”int CoveredCount { get; private set; }How many devices the group has with the choice now (“412” of “412 of 4,812 devices”).
EmptyText
Section titled “EmptyText”string EmptyText { get; }What the empty list says.
ErrorText
Section titled “ErrorText”string? ErrorText { get; set; }A refusal of the whole choice (e.g. the server refused a device group’s rules), shown directly below the list.
GroupChoice
Section titled “GroupChoice”DeviceGroupChoice GroupChoice { get; }The device group editor’s result: “This server”, the chosen sites, tags (definition ids), single devices and excepted devices by serial number (also those no chosen site or tag covers now, and those of devices not listed).
HasChoices
Section titled “HasChoices”bool HasChoices { get; }Whether the left column (event device, all devices, tags; the group editor’s sites and tags) is shown.
HasError
Section titled “HasError”bool HasError { get; }DevicePickerViewModel.ErrorText is set.
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”.
IsGroup
Section titled “IsGroup”bool IsGroup { get; }The device group editor (DevicePickerOptions.Group).
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 (the group editor: no tag is defined).
IReadOnlyList<SitePickItem> Sites { get; }The device group editor’s sites, “This server” first; empty elsewhere.
Summary
Section titled “Summary”string Summary { get; private set; }“12 of 4,812 devices chosen”.
IReadOnlyList<TagPickItem> Tags { get; }The tags to choose.
TotalCount
Section titled “TotalCount”int TotalCount { get; }Every device of the list.
Visible
Section titled “Visible”RangeObservableCollection<DevicePickItem> Visible { get; }The devices the search shows.