/ /// Add an object child to this control /// protected virtual void AddChild( object value) / /// Add an object child to this control /// void IAddChild. Return ReadLocalValue( ContentProperty) != DependencyProperty. Public virtual bool ShouldSerializeContent() / // Lets derived classes control the serialization behavior for Content DP
/ /// This method is used by TypeDescriptor to determine if this property should /// be serialized. / internal void ClearContentControl( object item)Ĭontent = BindingExpressionBase. / /// Undo the effect of PrepareContentControl. SetValue( ContentStringFormatProperty, itemStringFormat) SetValue( ContentTemplateSelectorProperty, itemTemplateSelector) SetValue( ContentTemplateProperty, itemTemplate) copy styles from the ItemsControl if ( ContentIsItem || ! HasNonDefaultValue( ContentProperty)) don't treat Content as a logical child ContentIsNotLogical = true / internal void PrepareContentControl( object item,ĭataTemplateSelector itemTemplateSelector, Internal static string ContentObjectToString( object content)įrameworkElement feContent = content as FrameworkElement / /// internal override string GetPlainText() / /// Gives a string representation of this object. Return new ContentModelTreeEnumerator( this, content) If ( logicalParent != null & logicalParent != this) TemplatedParent ĭependencyObject d = content as DependencyObject ĭependencyObject logicalParent = LogicalTreeHelper. If the current ContentControl is in a Template.VisualTree and is meant to host // the content for the container then that content shows up as the logical child // for the container and not for the current ContentControl. If ( ContentIsNotLogical || content = null) / /// Returns enumerator to logical children /// protected internal override IEnumerator LogicalChildren _dType = DependencyObjectType.FromSystemTypeInternal( typeof( ContentControl)) ĬontrolsTraceLogger.AddControl(Telemetr圜ontrols.ContentControl) OverrideMetadata( typeof( ContentControl), new FrameworkPropertyMetadata( typeof( ContentControl))) / public ContentControl() : base()ĭefaultStyleKeyProperty. Use alternative constructor /// that accepts a Dispatcher for best performance. / /// Default DependencyObject constructor /// /// /// Automatic determination of current Dispatcher. Public class ContentControl : Control, IAddChild / /// /// ContentControl adds Content, ContentTemplate, ContentTemplateSelector and Part features to a Control. / /// The base class for all controls with a single piece of content.