Ejemplo n.º 1
0
        /// <summary>
        /// Retrieves the referenced element from the specified namescope.
        /// </summary>
        /// <param name="namescope">The namescope from which to retrieve the referenced element.</param>
        /// <returns></returns>
        public UIElement GetReferencedElement(Namescope namescope)
        {
            Contract.Require(namescope, nameof(namescope));

            var element = namescope.GetElementByName(Name);
            if (element == null)
                throw new UvmlException(PresentationStrings.NamedElementDoesNotExist.Format(Name));

            return element;
        }
        /// <summary>
        /// Retrieves the referenced element from the specified namescope.
        /// </summary>
        /// <param name="namescope">The namescope from which to retrieve the referenced element.</param>
        /// <returns></returns>
        public UIElement GetReferencedElement(Namescope namescope)
        {
            Contract.Require(namescope, nameof(namescope));

            var element = namescope.GetElementByName(Name);

            if (element == null)
            {
                throw new UvmlException(PresentationStrings.NamedElementDoesNotExist.Format(Name));
            }

            return(element);
        }