public static UIElement ForGroup(IDominatorGroup group, IUIRegistrationContext context) { var panel = new StackPanel(); var description = CreateDescription(group.Description, forGroup: true); panel.Children.Add(description); var nestedStackPanel = new StackPanel { Margin = new Thickness(16, 8, 0, 8) }; foreach (var nested in group.Nested) { var nestedUI = ForDominator(nested, context); nestedStackPanel.Children.Add(nestedUI); } panel.Children.Add(nestedStackPanel); return panel; }
static DominationState QueryGroupState(IDominatorGroup group) { var nested = group.Nested.Select(QueryState).ToArray(); var state = CumulativeState(nested.Select(ns => ns.State_)); return new DominationState(state, nested); }