public override void WriteProperties(DependencyObject dependencyObject, XElement element) { var layoutProperties = BaseLayout.GetLayoutProperties(_layoutType); foreach (var layoutProperty in layoutProperties) { if (BaseLayout.ShouldSerializeProperty(_layoutType, dependencyObject, layoutProperty) == false) { continue; } var value = dependencyObject.GetValue(layoutProperty); if (value == null) { continue; } var stringValue = Convert.ToString(value, CultureInfo.InvariantCulture); if (string.IsNullOrEmpty(stringValue)) { continue; } var propertyName = FormatProperty(_layoutType, layoutProperty.GetName()); element.Add(new XAttribute(propertyName, stringValue)); } }
public static IEnumerable <DependencyProperty> GetLayoutProperties(LayoutKind layoutKind) { return(BaseLayout.GetLayoutProperties(GetLayoutType(layoutKind))); }