public static UIElement CreateAgentGrid(BcsAtomicAgentNode agent)
{
var gridBorder = new Border
{
Margin = new Thickness(5),
BorderThickness = new Thickness(3),
CornerRadius = new CornerRadius(3),
BorderBrush = Brushes.LightBlue
};
var grid = new Grid
{
Background = Brushes.LightBlue,
};
gridBorder.Child = grid;
AddRowControlToGrid(grid, new Label { Content = $"Agent: {agent.Name}" });
AddRowControlToGrid(grid, new Label { Content = $"Required state: {agent.CurrentState?.Name ?? "-"}" });
string possibleStatesText = $"Possible states: {string.Join(", ", agent.AllStates.Select(agentState => agentState.Name ?? string.Empty))}";
AddRowControlToGrid(grid, new Label { Content = possibleStatesText });
return gridBorder;
}