Click or drag to resize

GUITableModelItemSource Property

Targets a collection that will provide context for a dynamic series of objects in the Table.

Namespace:  Livit.Learn.Model.GUI
Assembly:  Livit.Learn.Model (in Livit.Learn.Model.dll) Version: 0.0.0.0
Syntax
C#
public string ItemSource { get; set; }

Property Value

Type: String
Remarks

Using ItemSource and ItemTemplate will dynamically create a series of objects based on those defined in ItemTemplate. Each of these individual objects will have the DataContext of their corresponding element in the ItemSource collection.

This allows the creation of a Table with a number of child objects that will automatically refresh as the user progresses in the simulation.

Examples
The following Table refers to Missions that are unlocked by the user:
XML
<Table Id="MissionsChecklist" ItemSource="{Binding ActiveQuests.Missions.UnlockedList}">
  <ItemTemplate>
    <Label Name="Completed" Text="{Binding Title}" />
  </ItemTemplate>
</Table>
For instance, if the user has currently unlocked 3 missions, the visible result in the simulation will be:
XML
<Table Id="MissionsChecklist" ItemSource="{Binding ActiveQuests.Missions.UnlockedList}">
  <ItemTemplate>
    <Label Name="Completed" Text="Enter the Lab" />
    <Label Name="Completed" Text="Prepare Sample" />
    <Label Name="Completed" Text="Process Sample" />
  </ItemTemplate>
</Table>
See Also