Skip to content

IssuedCertificateListViewModel

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

The list of certificates (SDK 0.4.0; the PKI Certificates tab: its CA list and its certificate list): newest first, read from the server one page at a time with the filters (state, use, issued by) and the search (it waits for the typing to stop), the grid’s selection in one step, View certificate. Shown by IssuedCertificateList; the first read shows the overlay, later ones the progress row.

public class IssuedCertificateListViewModel : ObservableObject

Inherits ObservableObject

IssuedCertificateListViewModel(IIssuedCertificateSource source, TimeProvider? time = null)

A list that reads from source; time for the search delay (tests).

bool CanGroup { get; init; }

Whether the list offers Group by (a source that groups on the server, the PKI page); false: the select is hidden and the rows have no group headers.

IIssuedCertificateListDialogs? Dialogs { get; set; }

The certificate window (the view).

string? EmptyText { get; }

One line when the list is empty: what to do first, or that nothing matches.

string? Error { get; set; }

“Cannot read the certificates: …” directly below the table; null after a good read.

IssuedCertificateGroupChoice GroupBy { get; set; }

The chosen grouping; a change reads the first page again.

IReadOnlyList<IssuedCertificateGroupChoice> GroupChoices { get; }

“Group by type” (the default), “Group by issuer”, “No groups”.

IReadOnlyList<string> GroupTitles { get; private set; }

The group headers of the shown page in their order (the view rebuilds its groups when they change).

bool HasError { get; }

IssuedCertificateListViewModel.Error is set.

bool HasPages { get; }

More rows than one page: Previous and Next show.

bool IsGrouped { get; private set; }

The rows have group headers (IssuedCertificateRow.GroupTitle).

bool IsLoading { get; set; }

The first read (the overlay over the grid).

bool IsReloading { get; set; }

A later read (filter, page, change on the server): the progress row above the grid.

bool IsWorking { get; }

A write of the page runs (IssuedCertificateListViewModel.WorkText): its buttons stay off.

IAsyncRelayCommand NextPageCommand { get; }

Gets an IAsyncRelayCommand instance wrapping IssuedCertificateListViewModel.NextPageAsync.

string NextText { get; }

“Next 500”.

string NoRowsText { get; init; }

The empty list without filters: what to do first (default IssuedCertificateTexts.NoCertificates).

int Offset { get; set; }

The first row of the shown page.

int PageSize { get; init; }

Rows of one page.

string PageText { get; }

“1-500 of 12,345”; empty without rows.

IAsyncRelayCommand PreviousPageCommand { get; }

Gets an IAsyncRelayCommand instance wrapping IssuedCertificateListViewModel.PreviousPageAsync.

string PreviousText { get; }

“Previous 500”.

string ProgressText { get; }

The text of the progress row: the write while one runs, else “Reading the certificates”.

RangeObservableCollection<IssuedCertificateRow> Rows { get; }

The rows of the shown page, newest first (bound to the grid).

string? Search { get; set; }

Text in any column, the device’s host name or serial, or the certificate’s serial; read 300 ms after the last key.

TimeSpan SearchDelay { get; init; }

Wait after typing in the search before the server is asked.

IReadOnlyList<IssuedCertificateRow> Selected { get; }

The chosen rows (the grid’s selection).

bool ShowsFilters { get; init; }

The filters show (default); false for a short list such as the PKI page’s CAs (the search always shows).

bool ShowsProgress { get; }

The progress row above the grid shows: a later read or a write of the page.

bool ShowsUsedIn { get; init; }

A CA list (the PKI page’s): the Used in column shows (the policies that use each CA) and the Type column is wider (the OADM CA’s badges); false by default.

RangeObservableCollection<IssuedCertificateFilter> SourceChoices { get; }

“Issued by any” and the CAs the server lists, or Task and EST when it lists none.

IssuedCertificateFilter SourceFilter { get; set; }

The chosen source; a change reads the first page again.

IReadOnlyList<IssuedCertificateFilter> StateChoices { get; }

“All states” and every state a row can have: Valid, Expires soon, Expired (decision 2026-10-25: no Replaced, the list holds only each camera’s current certificates; decision 2026-10-26: no Revoked, a certificate no longer accepted is not listed).

IssuedCertificateFilter StateFilter { get; set; }

The chosen state; a change reads the first page again.

TimeProvider Time { get; }

Protected: for classes that derive from it

The clock of the search delay and the certificate window.

int Total { get; set; }

How many certificates match the filters and the search.

IReadOnlyList<IssuedCertificateFilter> UseChoices { get; }

“All uses” and every use.

IssuedCertificateFilter UseFilter { get; set; }

The chosen use; a change reads the first page again.

IAsyncRelayCommand ViewCertificateCommand { get; }

Gets an IAsyncRelayCommand instance wrapping IssuedCertificateListViewModel.ViewCertificateAsync.

IAsyncRelayCommand<IssuedCertificateRow?> ViewRowCommand { get; }

Gets an IAsyncRelayCommand<T> instance wrapping IssuedCertificateListViewModel.ViewRowAsync.

string? WorkText { get; protected set; }

The text of a write the page runs on the list (“Deleting the certificates”); null while none runs. The progress row shows it above the grid.

virtual IReadOnlyList<IssuedCertificateAction> ActionsOf(IssuedCertificateRow row)

Protected: for classes that derive from it

The actions of one row: View by default; a page adds its own (everyday ones first, a separator, the red ones last).

Task LoadAsync(CancellationToken ct = default)

Reads the page at IssuedCertificateListViewModel.Offset with the filters (the first time with the overlay).

IReadOnlyList<IssuedCertificateAction> MenuOf(IssuedCertificateRow row)

The actions menu of a row (its ⋯ button and its right-click menu): the row’s own actions, or, when the row is one of several chosen rows, what the page does with all of them (IssuedCertificateListViewModel.SelectionActions) when it offers something.

virtual IReadOnlyList<IssuedCertificateStatus> MoreStatesOf(IssuedCertificateInfo row)

Protected: for classes that derive from it

Statuses the page adds below the type of a row (the OADM CA’s trust); none by default.

virtual void OnGroupingChanged(IssuedCertificateGrouping grouping)

Protected: for classes that derive from it

After the user chose another grouping (a page keeps the choice).

virtual void OnSelectionChanged()

Protected: for classes that derive from it

After every change of IssuedCertificateListViewModel.Selected (commands of a derived list).

virtual void OnWorkChanged()

Protected: for classes that derive from it

After every change of IssuedCertificateListViewModel.WorkText (commands of a derived list stay off while a write runs).

void RefreshRows()

Protected: for classes that derive from it

Builds the rows of the shown page again (the page’s IssuedCertificateListViewModel.MoreStatesOf changed); the selection stays.

virtual IReadOnlyList<IssuedCertificateAction> SelectionActions()

Protected: for classes that derive from it

The actions for several chosen rows; none by default (the menu then shows the row’s own).

void SetSelection(IEnumerable<IssuedCertificateRow> rows)

The grid’s selection changed (one step for many rows).

virtual Task ShowMessageAsync(string title, string message)

Protected: for classes that derive from it

A message to the user (the page’s message window).

Task ViewAsync(IssuedCertificateRow row)

Protected: for classes that derive from it

Shows row in the shared certificate window (or why it cannot be shown).

int WarningDaysFor(IssuedCertificateRow row, DateTime nowUtc)

The warning days of the certificate window: the server’s (PKI’s setting) when the page said, else what makes the window agree with the row’s state (Expires soon or Valid), else the default.

event EventHandler? GroupsChanged

The groups of the shown page changed (another grouping, other counts): the view groups the rows again.

event EventHandler? SelectionRestored

The rows were replaced and the selection kept: the view selects them again in the grid.