I know that in Visual Studio XAML code I can create DataTemplates for ListBox like this:
Code: Select all
<ListBox ItemsSource="{Binding Inputs}">
<ListBox.ItemTemplate>
<DataTemplate>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"></ColumnDefinition>
<ColumnDefinition Width="*"></ColumnDefinition>
</Grid.ColumnDefinitions>
<TextBlock Grid.Column="0" Text="{Binding Name}"/>
<Ellipse Grid.Column="1" Fill="{Binding IndicatorColor}"/>
</Grid>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
Best regards,
Heiki