Avalonia Code OnlyItaliano

API › RAVAL

RPropertyList class

public sealed class RPropertyList : UserControl

An editable list of name = value pairs, also from the properties of an object.

Constructors

RPropertyList()

An empty list.

Properties

object Target { get; }

The object whose properties are shown (null: pairs added by hand).

int Count { get; }

How many properties.

Methods

RPropertyList Add(string name, string value)

Adds a property with its value.

RPropertyList Show(object target)

Shows the public properties of an object (texts, numbers, yes/no, enums) in place of what is there; the values confirmed are written back into it.

void Reload()

Reads the values of the object again (it changed elsewhere).

void Clear()

Removes all the properties (and forgets the object).

string Value(string name)

The value of a property (null if there is none).

TextBox Box(string name)

The text box of a property (null if there is none).

void Confirm(int i)

Confirms the value of row i, as Enter does: Changed if different from the last confirmed one; with Show, written into the object or refused.

static object Convert(string text, Type type)

A text as a value of the type: numbers as RFormat reads them, yes/no in words, enums by name (null if it does not convert).

Events

event Action<string, string> Changed

When a value is confirmed and different: name, new value.

event Action<string, string> Rejected

When a value cannot be written into the object (Show): the name and the reason. The box has already gone back to the value of the object.