Ejemplo n.º 1
0
        public static RowDefinitions FromString(String val)
        {
            var coll = new RowDefinitions();

            foreach (var row in val.Split(','))
            {
                var rd = new RowDefinition
                {
                    Height = GridLength.FromString(row.Trim())
                };
                coll.Add(rd);
            }
            return(coll);
        }
Ejemplo n.º 2
0
 public override Object ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, Object value)
 {
     if (value == null)
     {
         return(null);
     }
     if (value is RowDefinitions)
     {
         return(value);
     }
     else if (value is String)
     {
         return(RowDefinitions.FromString(value.ToString()));
     }
     return(base.ConvertFrom(context, culture, value));
 }