Ejemplo n.º 1
0
        public T GetValue <T>(CompositeObjectProperty prop)
        {
            if (!CanSet(prop))
            {
                throw new System.Exception();
            }

            prop = PropertyManager.Instance.GetVirtualProperty(GetType(), prop);

            var propVal = ValueStorage.Storage.GetValue(this, prop);

            if (propVal == CompositeObjectProperty.UnsetValue)
            {
                if (prop.Metadata is IPropertyMetadata <T> typedMetadata)
                {
                    return(typedMetadata.DefaultValue);
                }
                else
                {
                    return(default);
Ejemplo n.º 2
0
        static Window()
        {
            CompositeObjectProperty.OverrideProperty <bool, Window>(IsVisibleProperty,
                                                                    false);

            CompositeObjectProperty.OverrideProperty <IBrush, Window>(BackgroundProperty,