Nebula
Loading...
Searching...
No Matches
Nebula.Ui.DataModel Class Referencesealed

Detailed Description

A data model.

Bind its variables before loading documents that use it

Public Member Functions

void BindComponent< T > (string name, Nebula.Game.Entity entity)
 Bind a component of an entity as a variable, its fields become members ({{ name.field }}).
void BindComponent (string name, ulong entityId, uint componentId)
 Bind a component by its native id.
void BindEvent (string name, Action< UiEvent > handler)
 Bind a data event, used as data-event-click="name".
void DirtyVariable (string name)
 Mark a variable dirty so the views using it update.
void Remove ()
 Remove the model and its bindings from the UI.

Package Functions

 DataModel (string name)

Properties

string Name [get]

Private Attributes

readonly List< GCHandle > eventHandles = new List<GCHandle>()

Constructor & Destructor Documentation

◆ DataModel()

Nebula.Ui.DataModel.DataModel ( string name)
inlinepackage

Member Function Documentation

◆ BindComponent()

void Nebula.Ui.DataModel.BindComponent ( string name,
ulong entityId,
uint componentId )
inline

Bind a component by its native id.

◆ BindComponent< T >()

void Nebula.Ui.DataModel.BindComponent< T > ( string name,
Nebula.Game.Entity entity )
inline

Bind a component of an entity as a variable, its fields become members ({{ name.field }}).

The UI reads and writes the component in place

Type Constraints
T :Nebula.Game.NativeComponent 

◆ BindEvent()

void Nebula.Ui.DataModel.BindEvent ( string name,
Action< UiEvent > handler )
inline

Bind a data event, used as data-event-click="name".

The handler gets the element the event is on

◆ DirtyVariable()

void Nebula.Ui.DataModel.DirtyVariable ( string name)
inline

Mark a variable dirty so the views using it update.

◆ Remove()

void Nebula.Ui.DataModel.Remove ( )
inline

Remove the model and its bindings from the UI.

Member Data Documentation

◆ eventHandles

readonly List<GCHandle> Nebula.Ui.DataModel.eventHandles = new List<GCHandle>()
private

Property Documentation

◆ Name

string Nebula.Ui.DataModel.Name
get

The documentation for this class was generated from the following file:
  • /github/workspace/code/addons/rmlui/nsharp/NebulaUi/Ui.cs