8000 Move notes to inheritors to inside CDATA block (#1616) · shdvr/dotnet-api-docs@0c0d7b4 · GitHub
[go: up one dir, main page]

Skip to content

Commit 0c0d7b4

Browse files
authored
Move notes to inheritors to inside CDATA block (dotnet#1616)
1 parent 86f46a6 commit 0c0d7b4

File tree

1 file changed

+39
-28
lines changed

1 file changed

+39
-28
lines changed

xml/System.Windows/ContentElement.xml

Lines changed: 39 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -38,12 +38,13 @@
3838
<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.
3939

4040
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+
4246
]]></format>
4347
</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>
46-
</block>
4748
<altmember cref="T:System.Windows.UIElement" />
4849
<altmember cref="T:System.Windows.FrameworkContentElement" />
4950
</Docs>
@@ -1206,15 +1207,21 @@
12061207

12071208
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`.
12081209

1209-
<a name="dependencyPropertyInfo_Focusable"></a>
1210-
## Dependency Property Information
1210+
### Dependency property information
12111211

12121212
|||
12131213
|-|-|
12141214
|Identifier field|<xref:System.Windows.ContentElement.FocusableProperty>|
12151215
|Metadata properties set to `true`|None|
12161216

1217-
1217+
## Notes to inheritors
1218+
1219+
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:
1220+
1221+
[!code-csharp[CorePseudocode#UIElementShortOverride](~/samples/snippets/csharp/VS_Snippets_Wpf/CorePseudocode/CSharp/corepseudocode.cs#uielementshortoverride)]
1222+
[!code-vb[CorePseudocode#UIElementShortOverride](~/samples/snippets/visualbasic/VS_Snippets_Wpf/CorePseudocode/visualbasic/corepseudocode.vb#uielementshortoverride)]
1223+
1224+
where `myElement` is the class name of the type that you are overriding the metadata value on.
12181225

12191226
## Examples
12201227
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 @@
12231230

12241231
]]></format>
12251232
</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:
1228-
1229-
[!code-csharp[CorePseudocode#UIElementShortOverride](~/samples/snippets/csharp/VS_Snippets_Wpf/CorePseudocode/CSharp/corepseudocode.cs#uielementshortoverride)]
1230-
[!code-vb[CorePseudocode#UIElementShortOverride](~/samples/snippets/visualbasic/VS_Snippets_Wpf/CorePseudocode/visualbasic/corepseudocode.vb#uielementshortoverride)]
1231-
1232-
where <paramref name="myElement" /> is the class name of the type that you are overriding the metadata value on.</para>
1233-
</block>
12341233
<altmember cref="M:System.Windows.FrameworkElement.MoveFocus(System.Windows.Input.TraversalRequest)" />
12351234
<altmember cref="E:System.Windows.UIElement.GotKeyboardFocus" />
12361235
<altmember cref="E:System.Windows.UIElement.LostKeyboardFocus" />
@@ -1977,10 +1976,15 @@
19771976
<summary>Gets a value that becomes the return value of <see cref="P:System.Windows.ContentElement.IsEnabled" /> in derived classes.</summary>
19781977
<value>
19791978
<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>
19841988
</Docs>
19851989
</Member>
19861990
<Member MemberName="IsEnabledProperty">
@@ -4379,12 +4383,17 @@
43794383
<Docs>
43804384
<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>
43814385
<returns>The type-specific <see cref="T:System.Windows.Automation.Peers.AutomationPeer" /> implementation.</returns>
4382-
<remarks>To be added.</remarks>
4383-
<block subset="none" type="overrides">
4384-
<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"><![CDATA[
43854388

4386-
All <see cref="T:System.Windows.ContentElement" /> derived classes should implement this method in order to provide their own specific <see cref="T:System.Windows.Automation.Peers.AutomationPeer" /> implementations to the [!INCLUDE[TLA#tla_winclient](~/includes/tlasharptla-winclient-md.md)] 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>
43884397
</Docs>
43894398
</Member>
43904399
<Member MemberName="OnDragEnter">
@@ -4607,11 +4616,13 @@
46074616

46084617
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.
46094618

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+
46104624
]]></format>
46114625
</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>
4614-
</block>
46154626
<altmember cref="P:System.Windows.ContentElement.Focusable" />
46164627
<altmember cref="E:System.Windows.ContentElement.GotFocus" />
46174628
</Docs>
@@ -11552,4 +11563,4 @@
1155211563
</Docs>
1155311564
</Member>
1155411565
</Members>
11555-
</Type>
11566+
</Type>

0 commit comments

Comments
 (0)
0