Exemplo n.º 1
0
        Wc.CompositionPropertySet GetCompositionPropertySet(Wd.CompositionPropertySet obj)
        {
            if (GetExisting(obj, out Wc.CompositionPropertySet result))
            {
                return(result);
            }

            // CompositionPropertySets are usually created implicitly by CompositionObjects that own them.
            // If the CompositionPropertySet is not owned, then create it now.
            if (obj.Owner == null)
            {
                result = _c.CreatePropertySet();
            }
            else
            {
                result = GetCompositionObject(obj.Owner).Properties;
            }

            result = CacheAndInitializeCompositionObject(obj, result);

            foreach (var prop in obj.ScalarProperties)
            {
                result.InsertScalar(prop.Key, prop.Value);
            }

            foreach (var prop in obj.Vector2Properties)
            {
                result.InsertVector2(prop.Key, prop.Value);
            }

            StartAnimations(obj, result);
            return(result);
        }
Exemplo n.º 2
0
        internal void SetRootVisual(WinCompData.Visual rootVisual)
        {
            // Save the root visual.
            _wincompDataRootVisual = rootVisual;

            // Find the theming property set, if any.
            var graph = ObjectGraph <Graph.Node> .FromCompositionObject(_wincompDataRootVisual, includeVertices : false);

            _wincompDataThemingPropertySet = graph.
                                             CompositionObjectNodes.
                                             Where(n => n.Object is WinCompData.CompositionPropertySet cps && cps.Owner is null).
                                             Select(n => (WinCompData.CompositionPropertySet)n.Object).FirstOrDefault();
        }