예제 #1
0
        private static GridViewColumn CreateColumn(ResourceCustomField customField)
        {
            var template = new DataTemplate {
                DataType = typeof(string)
            };
            var fef = new FrameworkElementFactory(typeof(TextBlock));

            fef.SetBinding(TextBlock.TextProperty, new Binding("[" + customField.Name + "]")
            {
                StringFormat = customField.EditingFormat
            });
            template.VisualTree = fef;
            var c = new GridViewColumn {
                Header = customField.Name, CellTemplate = template
            };

            Presentation.Common.ListViewLM.ProportionalColumn.ApplyWidth(c, 1);
            return(c);
        }
 public ResourceCustomFieldViewModel(ResourceCustomField model)
 {
     Model = model;
 }