Exemple #1
0
        private void HandleAfterBeginInit(object createdObject,
            ref DependencyObject rootObject,
            DependencyObject container,
            FrameworkElement feContainer,
            TemplateNameScope nameScope,
            IEnumerator<String> nameEnumerator)
        {
            // We need to wire names for all FEs and FCEs.  We do this as soon as the object is
            // initalized since it needs to happen before we assign any properties or wire to the parent
            if (!Names.CurrentFrame.InsideNameScope &&
                (createdObject is FrameworkElement || createdObject is FrameworkContentElement))
            {
                nameEnumerator.MoveNext();
                nameScope.RegisterNameInternal(nameEnumerator.Current, createdObject);
            }

            Names.CurrentFrame.Instance = createdObject;
        }