コード例 #1
0
        private static FrameworkElement ExtractItem(DisplayOption option)
        {
            var ctrl = new ItemControl {
                Margin = new Thickness(3)
            };

            ctrl.SetBinding(FrameworkElement.DataContextProperty, new Binding(option.PropertyName));
            if (option.Wide)
            {
                ctrl.SetValue(Grid.ColumnSpanProperty, 2);
            }
            return(ctrl);
        }