private ItemsControl CreatePropertyView(PtfPropertyView propertyView) { var template = FindResource("ItemsControlTemplate") as ControlTemplate; ItemsControl itemsControl = new ItemsControl() { Tag = "PropertyPanel", Margin = new Thickness(170, 21, 0, 0), HorizontalAlignment = System.Windows.HorizontalAlignment.Stretch, VerticalAlignment = System.Windows.VerticalAlignment.Stretch, Template = template }; foreach (var item in propertyView) { if (item.ControlType == Microsoft.Protocols.TestManager.Kernel.ControlType.Group) { ExpandGroup eg = new ExpandGroup(); eg.Name = item.Name; foreach (var i in item) { eg.AddItem(CreateItem(i, 14)); } eg.Associate(itemsControl); } else { itemsControl.Items.Add(CreateItem(item)); } } return(itemsControl); }
private ItemsControl CreatePropertyView(PtfPropertyView propertyView) { var template = FindResource("ItemsControlTemplate") as ControlTemplate; ItemsControl itemsControl = new ItemsControl() { Tag = "PropertyPanel", Margin = new Thickness(170, 21, 0, 0), HorizontalAlignment = System.Windows.HorizontalAlignment.Stretch, VerticalAlignment = System.Windows.VerticalAlignment.Stretch, Template = template }; foreach (var item in propertyView) { if (item.ControlType == Microsoft.Protocols.TestManager.Kernel.ControlType.Group) { ExpandGroup eg = new ExpandGroup(); eg.Name = item.Name; foreach (var i in item) { eg.AddItem(CreateItem(i, 14)); } eg.Associate(itemsControl); } else { itemsControl.Items.Add(CreateItem(item)); } } return itemsControl; }