Exemple #1
0
        public static void AddProperties(DependencyObject element, XElement result)
        {
            var proxy = ProxyManager.GetProxy(element);

            if (proxy != element)
            {
                ValueDiscoveryStrategy valueProvider = new ExcludeByDefaultValueDiscoveryStrategy();
                var values = valueProvider.GetValues(proxy);
                foreach (var value in values)
                {
                    string propertyName  = value.Name;
                    string propertyValue = value.GetValue <object>().ToString();
                    string defaultValue  = null;
                    if (defaultValues.TryGetValue(propertyName, out defaultValue) && defaultValue == propertyValue)
                    {
                        continue;
                    }
                    result.Add(new XAttribute(propertyName, propertyValue));
                }
            }
        }
 public ComplexTypeEditor()
 {
     ValueDiscoveryStrategy = new ExcludeByDefaultValueDiscoveryStrategy();
     Expanded    = false;
     this.Margin = new Thickness(32, 0, 0, 0);
 }