private static DependencyProperty LayoutPropertyFromTimeline()

in src/Microsoft.Xaml.Behaviors/Core/ExtendedVisualStateManager.cs [192:236]


        private static DependencyProperty LayoutPropertyFromTimeline(Timeline timeline, bool forceRuntimeProperty)
        {
            PropertyPath path = Storyboard.GetTargetProperty(timeline);

            if (path == null || path.PathParameters == null || path.PathParameters.Count == 0)
            {
                return null;
            }

            DependencyProperty property = path.PathParameters[0] as DependencyProperty;

            if (property != null)
            {
                if (property.Name == "RuntimeVisibility" && property.OwnerType.Name.EndsWith("DesignTimeProperties", StringComparison.Ordinal))
                {
                    if (!LayoutProperties.Contains(property))
                    {
                        LayoutProperties.Add(property);
                    }
                    return forceRuntimeProperty ? property : UIElement.VisibilityProperty;
                }
                else if (property.Name == "RuntimeWidth" && property.OwnerType.Name.EndsWith("DesignTimeProperties", StringComparison.Ordinal))
                {
                    if (!LayoutProperties.Contains(property))
                    {
                        LayoutProperties.Add(property);
                    }
                    return forceRuntimeProperty ? property : FrameworkElement.WidthProperty;
                }
                else if (property.Name == "RuntimeHeight" && property.OwnerType.Name.EndsWith("DesignTimeProperties", StringComparison.Ordinal))
                {
                    if (!LayoutProperties.Contains(property))
                    {
                        LayoutProperties.Add(property);
                    }
                    return forceRuntimeProperty ? property : FrameworkElement.HeightProperty;
                }
                else if (LayoutProperties.Contains(property))
                {
                    return property;
                }
            }

            return null;
        }