public override void WriteXml(System.Xml.XmlWriter writer) { if (DockWidth.Value != 1.0 || !DockWidth.IsStar) { writer.WriteAttributeString("DockWidth", _gridLengthConverter.ConvertToInvariantString(DockWidth)); } if (DockHeight.Value != 1.0 || !DockHeight.IsStar) { writer.WriteAttributeString("DockHeight", _gridLengthConverter.ConvertToInvariantString(DockHeight)); } if (DockMinWidth != 25.0) { writer.WriteAttributeString("DockMinWidth", DockMinWidth.ToString(CultureInfo.InvariantCulture)); } if (DockMinHeight != 25.0) { writer.WriteAttributeString("DockMinHeight", DockMinHeight.ToString(CultureInfo.InvariantCulture)); } if (FloatingWidth != 0.0) { writer.WriteAttributeString("FloatingWidth", FloatingWidth.ToString(CultureInfo.InvariantCulture)); } if (FloatingHeight != 0.0) { writer.WriteAttributeString("FloatingHeight", FloatingHeight.ToString(CultureInfo.InvariantCulture)); } if (FloatingLeft != 0.0) { writer.WriteAttributeString("FloatingLeft", FloatingLeft.ToString(CultureInfo.InvariantCulture)); } if (FloatingTop != 0.0) { writer.WriteAttributeString("FloatingTop", FloatingTop.ToString(CultureInfo.InvariantCulture)); } if (IsMaximized) { writer.WriteAttributeString("IsMaximized", IsMaximized.ToString()); } base.WriteXml(writer); }
private static string ConvertToString(GridLength gridLength) { return(GridLengthConverter.ConvertToInvariantString(gridLength) ?? string.Empty); }