예제 #1
0
        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));
            }
        }
예제 #2
0
파일: FullLayout.cs 프로젝트: Egaros/lib
 public static IEnumerable <DependencyProperty> GetLayoutProperties(LayoutKind layoutKind)
 {
     return(BaseLayout.GetLayoutProperties(GetLayoutType(layoutKind)));
 }