csharpc-sharpdotnetxamlavaloniauicross-platformcross-platform-xamlavaloniaguimulti-platformuser-interfacedotnetcore
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
39 lines
1.2 KiB
39 lines
1.2 KiB
using System.Linq;
|
|
|
|
namespace Avalonia.Controls
|
|
{
|
|
/// <summary>
|
|
/// A collection of <see cref="RowDefinition"/>s.
|
|
/// </summary>
|
|
public class RowDefinitions : DefinitionList<RowDefinition>
|
|
{
|
|
/// <summary>
|
|
/// Initializes a new instance of the <see cref="RowDefinitions"/> class.
|
|
/// </summary>
|
|
public RowDefinitions() : base()
|
|
{
|
|
}
|
|
|
|
/// <summary>
|
|
/// Initializes a new instance of the <see cref="RowDefinitions"/> class.
|
|
/// </summary>
|
|
/// <param name="s">A string representation of the row definitions.</param>
|
|
public RowDefinitions(string s)
|
|
: this()
|
|
{
|
|
AddRange(GridLength.ParseLengths(s).Select(x => new RowDefinition(x)));
|
|
}
|
|
|
|
public override string ToString()
|
|
{
|
|
return string.Join(",", this.Select(x => x.Height));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Parses a string representation of row definitions collection.
|
|
/// </summary>
|
|
/// <param name="s">The row definitions string.</param>
|
|
/// <returns>The <see cref="RowDefinitions"/>.</returns>
|
|
public static RowDefinitions Parse(string s) => new RowDefinitions(s);
|
|
}
|
|
}
|
|
|