/// <summary>
        /// Returns a <see cref="String"/> that represents this instance.
        /// </summary>
        /// <param name="length">
        /// The length.
        /// </param>
        /// <param name="cultureInfo">
        /// The culture info.
        /// </param>
        /// <returns>
        /// A <see cref="String"/> that represents this instance.
        /// </returns>
        internal static string ToString(SplitPanelLength length, CultureInfo cultureInfo)
        {
            switch (length.UnitType)
            {
                case SplitPanelUnitType.Auto:
                    return "Auto";

                case SplitPanelUnitType.Star:
                    if (length.Value == 1.0d)
                    {
                        return "*";
                    }

                    return Convert.ToString(length.Value, cultureInfo) + "*";
            }

            return Convert.ToString(length.Value, cultureInfo);
        }
Example #2
0
 /// <summary>
 /// Sets the value of the Length attached property to a given <see cref="UIElement"/>.
 /// </summary>
 /// <param name="element">
 /// The element on which to set the Length attached property.
 /// </param>
 /// <param name="value">
 /// The property value to set.
 /// </param>
 public static void SetLength(UIElement element, SplitPanelLength value)
 {
     element.SetValue(LengthProperty, value);
 }