Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
private static FrameworkPropertyMetadata CloneFrameworkPropertyMetadata(FrameworkPropertyMetadata src)
{
FrameworkPropertyMetadataOptions options = FrameworkPropertyMetadataOptions.None;
if (src.AffectsArrange)
options |= FrameworkPropertyMetadataOptions.AffectsArrange;
if (src.AffectsMeasure)
options |= FrameworkPropertyMetadataOptions.AffectsMeasure;
if (src.AffectsParentArrange)
options |= FrameworkPropertyMetadataOptions.AffectsParentArrange;
if (src.AffectsParentMeasure)
options |= FrameworkPropertyMetadataOptions.AffectsParentMeasure;
if (src.AffectsRender)
options |= FrameworkPropertyMetadataOptions.AffectsRender;
if (src.BindsTwoWayByDefault)
options |= FrameworkPropertyMetadataOptions.BindsTwoWayByDefault;
if (src.Inherits)
options |= FrameworkPropertyMetadataOptions.Inherits;
if (src.Journal)
options |= FrameworkPropertyMetadataOptions.Journal;
if (src.IsNotDataBindable)
options |= FrameworkPropertyMetadataOptions.NotDataBindable;
if (src.OverridesInheritanceBehavior)
options |= FrameworkPropertyMetadataOptions.OverridesInheritanceBehavior;
if (src.SubPropertiesDoNotAffectRender)
options |= FrameworkPropertyMetadataOptions.SubPropertiesDoNotAffectRender;
return new FrameworkPropertyMetadata(
src.DefaultValue,
options,
src.PropertyChangedCallback,
src.CoerceValueCallback,
src.IsAnimationProhibited,
src.DefaultUpdateSourceTrigger);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.