<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>https://wiki.augmensys.com/index.php?action=history&amp;feed=atom&amp;title=Traits</id>
		<title>Traits - Revision history</title>
		<link rel="self" type="application/atom+xml" href="https://wiki.augmensys.com/index.php?action=history&amp;feed=atom&amp;title=Traits"/>
		<link rel="alternate" type="text/html" href="https://wiki.augmensys.com/index.php?title=Traits&amp;action=history"/>
		<updated>2026-04-25T05:14:09Z</updated>
		<subtitle>Revision history for this page on the wiki</subtitle>
		<generator>MediaWiki 1.24.2</generator>

	<entry>
		<id>https://wiki.augmensys.com/index.php?title=Traits&amp;diff=29727&amp;oldid=prev</id>
		<title>KGR at 12:01, 24 April 2026</title>
		<link rel="alternate" type="text/html" href="https://wiki.augmensys.com/index.php?title=Traits&amp;diff=29727&amp;oldid=prev"/>
				<updated>2026-04-24T12:01:03Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table class='diff diff-contentalign-left'&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;tr style='vertical-align: top;'&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Revision as of 12:01, 24 April 2026&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 126:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 126:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;----&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;----&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;[[Category:Client|Traits]]&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;[[Category:Mobile|Traits]]&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;[[Category:MAUI|Traits]]&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>KGR</name></author>	</entry>

	<entry>
		<id>https://wiki.augmensys.com/index.php?title=Traits&amp;diff=29726&amp;oldid=prev</id>
		<title>KGR: Created page with &quot;= UBIK Traits (Client) =  '''UBIK Traits''' provide the ability to define a dynamic list of lightweight properties for individual instances (objects). Unlike traditional UBIK...&quot;</title>
		<link rel="alternate" type="text/html" href="https://wiki.augmensys.com/index.php?title=Traits&amp;diff=29726&amp;oldid=prev"/>
				<updated>2026-04-24T11:44:37Z</updated>
		
		<summary type="html">&lt;p&gt;Created page with &amp;quot;= UBIK Traits (Client) =  &amp;#039;&amp;#039;&amp;#039;UBIK Traits&amp;#039;&amp;#039;&amp;#039; provide the ability to define a dynamic list of lightweight properties for individual instances (objects). Unlike traditional UBIK...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;= UBIK Traits (Client) =&lt;br /&gt;
&lt;br /&gt;
'''UBIK Traits''' provide the ability to define a dynamic list of lightweight properties for individual instances (objects). Unlike traditional UBIK Properties, which are rigidly bound to a MetaClass, instances of the same entity can possess a different list of traits. &lt;br /&gt;
&lt;br /&gt;
This feature is particularly useful for data that only becomes known at runtime or varies significantly from instance to instance.&lt;br /&gt;
&lt;br /&gt;
{{Attention|This feature must be used wisely, too many traits could impact the performance. Traits do not replace properties.}}&lt;br /&gt;
&lt;br /&gt;
== ViewModel Architecture &amp;amp; Data Access ==&lt;br /&gt;
To work with traits in the UI (XAML), the &amp;lt;code&amp;gt;ContentViewModel&amp;lt;/code&amp;gt; provides several dedicated accessors and collections. &lt;br /&gt;
&lt;br /&gt;
=== 1. ValueAccessors (Recommended for Read/Write) ===&lt;br /&gt;
The &amp;lt;code&amp;gt;ValueAccessors&amp;lt;/code&amp;gt; acts as a combined dynamic value resolver. It is the '''preferred way''' to read or edit values in the UI because of its built-in fallback logic:&lt;br /&gt;
# '''Trait Lookup:''' First attempts to resolve the value via a trait with the specified name.&lt;br /&gt;
# '''Property Fallback:''' If no trait is found, it queries a regular UBIK Property with that name.&lt;br /&gt;
# '''Default:''' If neither exists, it returns &amp;lt;code&amp;gt;null&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== 2. TraitByName (Traits Only) ===&lt;br /&gt;
A dedicated collection (&amp;lt;code&amp;gt;ObservableTraitDictionary&amp;lt;/code&amp;gt;) that exclusively loads and initializes traits. Unlike the &amp;lt;code&amp;gt;ValueAccessors&amp;lt;/code&amp;gt;, this does not fall back to regular properties.&lt;br /&gt;
* '''Usage:''' When you explicitly want to query ''only'' traits (e.g., read-only display in the UI).&lt;br /&gt;
&lt;br /&gt;
=== 3. Values (Raw Data) ===&lt;br /&gt;
This is a combined getter that returns the raw value directly from the dictionary, instead of providing a complex &amp;lt;code&amp;gt;TraitViewModel&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;PropertyViewModel&amp;lt;/code&amp;gt;.&lt;br /&gt;
* '''Usage:''' For pure display purposes or evaluations&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== Commands (Set &amp;amp; Create Values) ==&lt;br /&gt;
&lt;br /&gt;
=== SetValueCommand ===&lt;br /&gt;
This command on the &amp;lt;code&amp;gt;ContentViewModel&amp;lt;/code&amp;gt; orchestrates value assignments and handles the '''creation of new traits''' if necessary.&lt;br /&gt;
* '''If the trait exists:''' The value will be overwritten.&lt;br /&gt;
* '''If a property exists:''' The property's value will be overwritten (if it is not locked/read-only).&lt;br /&gt;
* '''If neither exists:''' A new &amp;lt;code&amp;gt;TraitViewModel&amp;lt;/code&amp;gt; is created and added to the UBIKContent.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== Customizing / UI Integration (XAML Examples) ==&lt;br /&gt;
&lt;br /&gt;
To display traits in custom XAML templates, make them editable, or create new ones, standard UBIK controls like &amp;lt;code&amp;gt;EvalExpression&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;SfListViewExt&amp;lt;/code&amp;gt; are used. Here are real-world code examples to guide you:&lt;br /&gt;
&lt;br /&gt;
=== 1. Pure Display of All Traits (List View) ===&lt;br /&gt;
If you simply want to display all traits of an object, you can bind directly to &amp;lt;code&amp;gt;Content.Traits&amp;lt;/code&amp;gt;. Here, it is combined with the Syncfusion ListView (&amp;lt;code&amp;gt;SfListViewExt&amp;lt;/code&amp;gt;):&lt;br /&gt;
{{Attention| With that you only bind on DataModel level (changes on viewmodel level are only visible after saving).}}&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;controls:SfListViewExt ItemsSource=&amp;quot;{Binding Content.Traits}&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;controls:SfListViewExt.ItemTemplate&amp;gt;&lt;br /&gt;
        &amp;lt;DataTemplate&amp;gt;&lt;br /&gt;
            &amp;lt;Border Padding=&amp;quot;10,8&amp;quot; BackgroundColor=&amp;quot;#FAFAFA&amp;quot; Stroke=&amp;quot;#E0E0E0&amp;quot; StrokeShape=&amp;quot;RoundRectangle 8&amp;quot;&amp;gt;&lt;br /&gt;
                &amp;lt;Grid ColumnDefinitions=&amp;quot;0.4*, 0.6*&amp;quot;&amp;gt;&lt;br /&gt;
                    &amp;lt;Label Grid.Column=&amp;quot;0&amp;quot; FontAttributes=&amp;quot;Bold&amp;quot; Text=&amp;quot;{Binding Name}&amp;quot; VerticalTextAlignment=&amp;quot;Center&amp;quot; /&amp;gt;&lt;br /&gt;
                    &amp;lt;Label Grid.Column=&amp;quot;1&amp;quot; Text=&amp;quot;{Binding Value, TargetNullValue='Not found'}&amp;quot; TextColor=&amp;quot;#555555&amp;quot; VerticalTextAlignment=&amp;quot;Center&amp;quot; /&amp;gt;&lt;br /&gt;
                &amp;lt;/Grid&amp;gt;&lt;br /&gt;
            &amp;lt;/Border&amp;gt;&lt;br /&gt;
        &amp;lt;/DataTemplate&amp;gt;&lt;br /&gt;
    &amp;lt;/controls:SfListViewExt.ItemTemplate&amp;gt;&lt;br /&gt;
&amp;lt;/controls:SfListViewExt&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== 2. Edit a Single Trait or Property (via ValueAccessors) ===&lt;br /&gt;
To dynamically query and edit a specific trait, use the &amp;lt;code&amp;gt;EvalExpression&amp;lt;/code&amp;gt; with the &amp;lt;code&amp;gt;ValueAccessors&amp;lt;/code&amp;gt; context. The &amp;lt;code&amp;gt;TwoWay&amp;lt;/code&amp;gt; binding ensures that changes are written directly back to the ViewModel.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;controls:EvalExpression x:Name=&amp;quot;EvalS2&amp;quot; Context=&amp;quot;{Binding ValueAccessors}&amp;quot; Expression=&amp;quot;Context[P0]&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;controls:EvalExpressionParameter Name=&amp;quot;P0&amp;quot; Value=&amp;quot;{Binding Path=Text, Source={x:Reference S2NameInput}}&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/controls:EvalExpression&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;Entry x:Name=&amp;quot;S2NameInput&amp;quot; Placeholder=&amp;quot;Enter name...&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;Entry x:Name=&amp;quot;S2ValueInput&amp;quot; Text=&amp;quot;{Binding Result.Value, Source={x:Reference EvalS2}, Mode=TwoWay, FallbackValue='Not found'}&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== 3. Delete a Trait ===&lt;br /&gt;
Deleting a trait does not require a dedicated command. Instead, it uses an event behavior to directly invoke the &amp;lt;code&amp;gt;Delete&amp;lt;/code&amp;gt; method on the evaluator's result.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;Button Text=&amp;quot;Delete&amp;quot; BackgroundColor=&amp;quot;#D32F2F&amp;quot; TextColor=&amp;quot;White&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;Button.Behaviors&amp;gt;&lt;br /&gt;
        &amp;lt;behaviors:EventHandlerBehavior EventName=&amp;quot;Clicked&amp;quot;&amp;gt;&lt;br /&gt;
            &amp;lt;behaviors:InvokeMethodAction TargetObject=&amp;quot;{Binding Result, Source={x:Reference EvalS2}}&amp;quot; MethodName=&amp;quot;Delete&amp;quot; /&amp;gt;&lt;br /&gt;
        &amp;lt;/behaviors:EventHandlerBehavior&amp;gt;&lt;br /&gt;
    &amp;lt;/Button.Behaviors&amp;gt;&lt;br /&gt;
&amp;lt;/Button&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== 4. Create or Overwrite a Trait (via SetValueCommand) ===&lt;br /&gt;
To create traits entirely from scratch (or explicitly overwrite an existing value), the &amp;lt;code&amp;gt;SetValueCommand&amp;lt;/code&amp;gt; of the &amp;lt;code&amp;gt;ContentViewModel&amp;lt;/code&amp;gt; is used. A &amp;lt;code&amp;gt;KeyValueList&amp;lt;/code&amp;gt; must be passed to this command.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;Grid ColumnDefinitions=&amp;quot;*, Auto&amp;quot; ColumnSpacing=&amp;quot;10&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;Entry x:Name=&amp;quot;S4NameInput&amp;quot; Placeholder=&amp;quot;Name of the (new) trait...&amp;quot; /&amp;gt;&lt;br /&gt;
    &amp;lt;Entry x:Name=&amp;quot;S4ValueInput&amp;quot; Grid.Column=&amp;quot;0&amp;quot; Placeholder=&amp;quot;Enter value to set...&amp;quot; /&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
    &amp;lt;Button Grid.Column=&amp;quot;1&amp;quot; Command=&amp;quot;{Binding SetValueCommand}&amp;quot; Text=&amp;quot;Set&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;lt;Button.CommandParameter&amp;gt;&lt;br /&gt;
            &amp;lt;classes:KeyValueList&amp;gt;&lt;br /&gt;
                &amp;lt;classes:KeyValueParameter Key=&amp;quot;PropertyName&amp;quot; Value=&amp;quot;{Binding Text, Source={x:Reference S4NameInput}}&amp;quot; /&amp;gt;&lt;br /&gt;
                &amp;lt;classes:KeyValueParameter Key=&amp;quot;PropertyValue&amp;quot; Value=&amp;quot;{Binding Text, Source={x:Reference S4ValueInput}}&amp;quot; /&amp;gt;&lt;br /&gt;
            &amp;lt;/classes:KeyValueList&amp;gt;&lt;br /&gt;
        &amp;lt;/Button.CommandParameter&amp;gt;&lt;br /&gt;
    &amp;lt;/Button&amp;gt;&lt;br /&gt;
&amp;lt;/Grid&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== 5. Edit Specific Datatypes (e.g., DatePicker) ===&lt;br /&gt;
Traits store actual underlying datatypes (such as &amp;lt;code&amp;gt;DateTime&amp;lt;/code&amp;gt;). This means you can bind regular UI controls like a &amp;lt;code&amp;gt;DatePicker&amp;lt;/code&amp;gt; directly to the result of the &amp;lt;code&amp;gt;EvalExpression&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;controls:EvalExpression x:Name=&amp;quot;EvalDateTime&amp;quot; Context=&amp;quot;{Binding}&amp;quot; Expression=&amp;quot;Context.ValueAccessors[P0]&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;controls:EvalExpressionParameter Name=&amp;quot;P0&amp;quot; Value=&amp;quot;{Binding Path=Text, Source={x:Reference DateTraitNameInput}}&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/controls:EvalExpression&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;Entry x:Name=&amp;quot;DateTraitNameInput&amp;quot; Text=&amp;quot;TRAIT_DATETIME&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;DatePicker x:Name=&amp;quot;DateTestPicker&amp;quot; Date=&amp;quot;{Binding Result.Value, Source={x:Reference EvalDateTime}}&amp;quot; Format=&amp;quot;dd.MM.yyyy&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;Button Command=&amp;quot;{Binding SetValueCommand}&amp;quot; Text=&amp;quot;Set&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;Button.CommandParameter&amp;gt;&lt;br /&gt;
        &amp;lt;classes:KeyValueList&amp;gt;&lt;br /&gt;
            &amp;lt;classes:KeyValueParameter Key=&amp;quot;PropertyName&amp;quot; Value=&amp;quot;{Binding Text, Source={x:Reference DateTraitNameInput}}&amp;quot; /&amp;gt;&lt;br /&gt;
            &amp;lt;classes:KeyValueParameter Key=&amp;quot;PropertyValue&amp;quot; Value=&amp;quot;{Binding Date, Source={x:Reference DateTestPicker}}&amp;quot; /&amp;gt;&lt;br /&gt;
        &amp;lt;/classes:KeyValueList&amp;gt;&lt;br /&gt;
    &amp;lt;/Button.CommandParameter&amp;gt;&lt;br /&gt;
&amp;lt;/Button&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;/div&gt;</summary>
		<author><name>KGR</name></author>	</entry>

	</feed>