using System; using System.Windows.Controls; namespace BPA.UIControl.DataAnnotations { /// /// DataGrid 列宽 /// [AttributeUsage(AttributeTargets.Property)] public class ColumnWidthAttribute : Attribute { /// /// 列宽 /// public DataGridLength Width { get; } /// /// DataGrid 列宽 /// /// 列宽 public ColumnWidthAttribute(string width) { var converter = new DataGridLengthConverter(); Width = (DataGridLength)converter.ConvertFromString(width); } } }