コード例 #1
0
        /// <summary>
        /// Loads the document template.
        /// </summary>
        /// <returns>DependencyObject.</returns>
        /// <exception cref="System.NotImplementedException"></exception>
        public DependencyObject LoadDocumentTemplate()
        {
            if (DocumentVisualTree == null) return null;

            var root = DocumentVisualTree;
            var expressions = new List<BindingToSet>();
            var newInstance = CloneObject(root, null, expressions);
            newInstance.SetValue(DocEx.ForceRefreshExpressionProperty, expressions);

            var fragment = new DocumentFragment {Content = newInstance as FrameworkContentElement};
            return fragment;
        }
コード例 #2
0
        /// <summary>
        /// Loads the document template.
        /// </summary>
        /// <returns>DependencyObject.</returns>
        /// <exception cref="System.NotImplementedException"></exception>
        public DependencyObject LoadDocumentTemplate()
        {
            if (DocumentVisualTree == null)
            {
                return(null);
            }

            var root        = DocumentVisualTree;
            var expressions = new List <BindingToSet>();
            var newInstance = CloneObject(root, null, expressions);

            newInstance.SetValue(DocEx.ForceRefreshExpressionProperty, expressions);

            var fragment = new DocumentFragment {
                Content = newInstance as FrameworkContentElement
            };

            return(fragment);
        }