protected object ResolveCurrentStyle(SceneElement targetElement, PropertyReference propertyReference, bool allowDefaultStyle)
        {
            ReferenceStep referenceStep = propertyReference[0];
            object        computedValue = targetElement.GetComputedValue(propertyReference);
            StyleNode     styleNode     = targetElement.GetLocalOrDefaultValue(propertyReference) as StyleNode;
            bool          flag          = computedValue == null || styleNode != null && styleNode.IsDefaultStyle;

            if (!allowDefaultStyle && flag && referenceStep.Equals((object)BaseFrameworkElement.StyleProperty))
            {
                return((object)null);
            }
            if (computedValue != null)
            {
                Style style = computedValue as Style;
                if (style != null)
                {
                    foreach (SetterBase setterBase in (Collection <SetterBase>)style.Setters)
                    {
                        Setter            setter = setterBase as Setter;
                        FrameworkTemplate frameworkTemplate;
                        if (setter != null && (frameworkTemplate = setter.Value as FrameworkTemplate) != null && frameworkTemplate.VisualTree != null)
                        {
                            return((object)null);
                        }
                    }
                }
            }
            return(computedValue);
        }
 public ConvertibleBrushReference(SceneElement sceneElement)
     : this(sceneElement.GetLocalOrDefaultValue(DesignTimeProperties.BrushKeyProperty) as string, sceneElement.GetLocalOrDefaultValue(DesignTimeProperties.BrushDocumentReferenceProperty) as string)
 {
 }
示例#3
0
 public static IEnumerable <string> GetReferencedAnnotationIds(SceneElement element)
 {
     ExceptionChecks.CheckNullArgument <SceneElement>(element, "element");
     return(AnnotationUtils.ParseAnnotationReferences(element.GetLocalOrDefaultValue(AnnotationSceneNode.ReferencesProperty) as string ?? string.Empty));
 }
示例#4
0
 public static double GetBottom(SceneElement element)
 {
     return((double)element.GetLocalOrDefaultValue(CanvasElement.BottomProperty));
 }
示例#5
0
 public static double GetRight(SceneElement element)
 {
     return((double)element.GetLocalOrDefaultValue(CanvasElement.RightProperty));
 }
 private static bool GetAutoLayoutRounding(SceneElement element)
 {
     return(LayoutRoundingHelper.AutoLayoutRoundingValue.Equals(element.GetLocalOrDefaultValue(DesignTimeProperties.LayoutRoundingProperty)));
 }