/// <summary>
        /// Converts the composite document to a <see cref="UvssDocument"/> instance appropriate
        /// for the specified creen density.
        /// </summary>
        private UvssDocument ToUvssDocumentInternal(ScreenDensityBucket density)
        {
            var document = new UvssDocument(Ultraviolet);

            foreach (var child in children)
            {
                document.Append(child.Get(density));
            }

            return(document);
        }
Пример #2
0
        /// <inheritdoc/>
        protected override void OnValidationComplete(String path, UvssDocument asset, Boolean validated)
        {
            if (validated)
            {
                return;
            }

            var upf = Ultraviolet.GetUI().GetPresentationFoundation();

            upf.TrySetGlobalStyleSheet(this);
        }
Пример #3
0
        /// <summary>
        /// Appends another styling document to the end of this document.
        /// </summary>
        /// <param name="document">The document to append to the end of this document.</param>
        public void Append(UvssDocument document)
        {
            Contract.Require(document, nameof(document));

            Ultraviolet.ValidateResource(document);

            this.ruleSets.AddRange(document.RuleSets);
            this.storyboardDefinitions.AddRange(document.StoryboardDefinitions);

            foreach (var storyboardDefinition in document.storyboardDefinitions)
            {
                this.storyboardDefinitionsByName[storyboardDefinition.Name] = storyboardDefinition;
            }

            foreach (var storyboardInstance in document.storyboardInstancesByName)
            {
                this.storyboardInstancesByName[storyboardInstance.Key] = storyboardInstance.Value;
            }

            CategorizeRuleSets();
        }
 /// <summary>
 /// Called when one of the document's children finishes validating.
 /// </summary>
 /// <param name="path">The asset path of the asset which was reloaded.</param>
 /// <param name="asset">The asset which was reloaded.</param>
 /// <param name="validated">A value indicating whether the asset that was loading validated successfully.</param>
 protected abstract void OnValidationComplete(String path, UvssDocument asset, Boolean validated);
 /// <summary>
 /// Called when one of the document's children is validating.
 /// </summary>
 /// <param name="path">The asset path of the asset which is being reloaded.</param>
 /// <param name="asset">The asset which is being reloaded.</param>
 /// <returns><see langword="true"/> if the specified asset is valid; otherwise, <see langword="false"/>.</returns>
 protected abstract bool OnValidating(String path, UvssDocument asset);
Пример #6
0
 /// <inheritdoc/>
 protected override void OnValidationComplete(String path, UvssDocument asset, Boolean validated)
 {
     validationComplete?.Invoke(path, asset, validated);
 }
Пример #7
0
 /// <inheritdoc/>
 protected override bool OnValidating(String path, UvssDocument asset)
 {
     return(validating?.Invoke(path, asset) ?? true);
 }
Пример #8
0
        /// <inheritdoc/>
        protected override bool OnValidating(String path, UvssDocument asset)
        {
            var upf = Ultraviolet.GetUI().GetPresentationFoundation();

            return(upf.TrySetGlobalStyleSheet(this));
        }