You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: xml/System.Windows/ContentElement.xml
+39-28Lines changed: 39 additions & 28 deletions
Original file line number
Diff line number
Diff line change
@@ -38,12 +38,13 @@
38
38
<xref:System.Windows.ContentElement> shares many common [!INCLUDE[TLA2#tla_api#plural](~/includes/tla2sharptla-apisharpplural-md.md)] with <xref:System.Windows.UIElement>. These common [!INCLUDE[TLA2#tla_api#plural](~/includes/tla2sharptla-apisharpplural-md.md)] do not come from a shared class inheritance. But they do share common naming, similar behavior, and similar internal implementation of [!INCLUDE[TLA2#tla_api#plural](~/includes/tla2sharptla-apisharpplural-md.md)] in each class. The similarity is because <xref:System.Windows.ContentElement> and <xref:System.Windows.UIElement> are each classes that are an element base, although each has different intentions for its markup object model behavior.
39
39
40
40
In particular, <xref:System.Windows.UIElement> descends from <xref:System.Windows.Media.Visual>, which provides the lower-level graphics support for rendering a <xref:System.Windows.ContentElement> to a rectangular region within a composited window, whereas <xref:System.Windows.ContentElement> defers rendering so that concepts more common to document scenarios, such as flow and wrapping, are more easily supported. These two related classes also implement the common interfaces <xref:System.Windows.IInputElement> and <xref:System.Windows.Media.Animation.IAnimatable>.
41
-
41
+
42
+
## Notes to inheritors
43
+
44
+
The <xref:System.Windows.ContentElement> class does not yet define all aspects of a complete content element for flow-style presentation. <xref:System.Windows.FrameworkContentElement> is an immediately derived class of <xref:System.Windows.ContentElement>. <xref:System.Windows.FrameworkContentElement> includes a more complete set of additional members that support rendering a <xref:System.Windows.FrameworkContentElement> within a content host and using the WPF framework-level layout system.
45
+
42
46
]]></format>
43
47
</remarks>
44
-
<block subset="none" type="overrides">
45
-
<para>The <see cref="T:System.Windows.ContentElement" /> class does not yet define all aspects of a complete content element for flow-style presentation. <see cref="T:System.Windows.FrameworkContentElement" /> is an immediately derived class of <see cref="T:System.Windows.ContentElement" />. <see cref="T:System.Windows.FrameworkContentElement" /> includes a more complete set of additional members that support rendering a <see cref="T:System.Windows.FrameworkContentElement" /> within a content host and using the WPF framework-level layout system.</para>
When inherited by <xref:System.Windows.Documents.Hyperlink> or its derived classes, <xref:System.Windows.Documents.Hyperlink> overrides the metadata for this dependency property and redefines the default value of this property to be `true`.
When you derive from <xref:System.Windows.ContentElement>, consider whether you want your element to be focusable, because by default it will not be focusable. If you want your element to be focusable, override the metadata for this property in your derived class static constructor as follows:
where `myElement` is the class name of the type that you are overriding the metadata value on.
1218
1225
1219
1226
## Examples
1220
1227
The following example creates a style that makes a <xref:System.Windows.Documents.Paragraph> focusable by default and gives it a visual behavior when it receives focus.
@@ -1223,14 +1230,6 @@
1223
1230
1224
1231
]]></format>
1225
1232
</remarks>
1226
-
<block subset="none" type="overrides">
1227
-
<para>When you derive from <see cref="T:System.Windows.ContentElement" />, consider whether you want your element to be focusable, because by default it will not be focusable. If you want your element to be focusable, override the metadata for this property in your derived class static constructor as follows:
<summary>Gets a value that becomes the return value of <see cref="P:System.Windows.ContentElement.IsEnabled" /> in derived classes.</summary>
1978
1977
<value>
1979
1978
<see langword="true" /> if the element is enabled; otherwise, <see langword="false" />.</value>
1980
-
<remarks>To be added.</remarks>
1981
-
<block subset="none" type="overrides">
1982
-
<para>The default implementation of this property caches the value and also calculates whether the parent element of this element is enabled. (If the parent is not enabled, the child element cannot be effectively enabled in practical [!INCLUDE[TLA#tla_ui](~/includes/tlasharptla-ui-md.md)].) If you choose to override this implementation, make certain that you call the base implementation to preserve this behavior.</para>
1983
-
</block>
1979
+
<remarks>
1980
+
<format type="text/markdown"><![CDATA[
1981
+
1982
+
## Notes to inheritors
1983
+
1984
+
The default implementation of this property caches the value and also calculates whether the parent element of this element is enabled. If the parent is not enabled, the child element cannot be effectively enabled in practical user interface. If you choose to override this implementation, make certain that you call the base implementation to preserve this behavior.
1985
+
1986
+
]]></format>
1987
+
</remarks>
1984
1988
</Docs>
1985
1989
</Member>
1986
1990
<Member MemberName="IsEnabledProperty">
@@ -4379,12 +4383,17 @@
4379
4383
<Docs>
4380
4384
<summary>Returns class-specific <see cref="T:System.Windows.Automation.Peers.AutomationPeer" /> implementations for the [!INCLUDE[TLA#tla_winclient](~/includes/tlasharptla-winclient-md.md)] infrastructure.</summary>
<para>The implementation of this method is typically to call the constructor of a specific <see cref="T:System.Windows.Automation.Peers.AutomationPeer" /> implementation, and return it as the return value.
4386
+
<remarks>
4387
+
<format type="text/markdown"><] infrastructure. For details on implementing this pattern, see <see cref="T:System.Windows.Automation.Peers.AutomationPeer" />.</para>
4387
-
</block>
4389
+
## Notes to inheritors
4390
+
4391
+
The implementation of this method is typically to call the constructor of a specific <xref:System.Windows.Automation.Peers.AutomationPeer" /> implementation, and return it as the return value.
4392
+
4393
+
All <xref:System.Windows.ContentElement> derived classes should implement this method in order to provide their own specific <xref:System.Windows.Automation.Peers.AutomationPeer> implementations to the WPF infrastructure. For details on implementing this pattern, see <xref:System.Windows.Automation.Peers.AutomationPeer>.
4394
+
4395
+
]]></format>
4396
+
</remarks>
4388
4397
</Docs>
4389
4398
</Member>
4390
4399
<Member MemberName="OnDragEnter">
@@ -4607,11 +4616,13 @@
4607
4616
4608
4617
This On* method implementation is intended to raise the event, and this same method implementation is invoked internally to raise the event when the <xref:System.Windows.ContentElement.IsFocused%2A> property value changes. The <xref:System.Windows.ContentElement.OnGotFocus%2A> implementation differs from some other [!INCLUDE[TLA#tla_winclient](~/includes/tlasharptla-winclient-md.md)] On* implementations, which only provide a convenient way to add class handling for that event.
4609
4618
4619
+
## Notes to inheritors
4620
+
4621
+
Unless you have a deliberate and unusual need to not raise the focus events, make sure that your implementation calls the base implementation. Otherwise, the <xref:System.Windows.ContentElement.GotFocus> event is not raised during typical user operations that ordinarily set focus to this element. If you do not intend your element to be focusable, you can prevent the element from being focusable by setting <xref:System.Windows.ContentElement.Focusable> to `false`.
4622
+
Note that by default a <xref:System.Windows.ContentElement.Focusable> is not focusable, therefore setting <xref:System.Windows.ContentElement.Focusable> deliberately might not be necessary.
4623
+
4610
4624
]]></format>
4611
4625
</remarks>
4612
-
<block subset="none" type="overrides">
4613
-
<para>Unless you have a deliberate and unusual need to not raise the focus events, make sure that your implementation calls the base implementation. Otherwise, the <see cref="E:System.Windows.ContentElement.GotFocus" /> event is not raised during typical user operations that ordinarily set focus to this element. If you do not intend your element to be focusable, you can prevent the element from being focusable by setting <see cref="P:System.Windows.ContentElement.Focusable" /> to <see langword="false" />. Note that by default a <see cref="P:System.Windows.ContentElement.Focusable" /> is not focusable, therefore setting <see cref="P:System.Windows.ContentElement.Focusable" /> deliberately might not be necessary.</para>
0 commit comments