Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Delete 404 WPF sample links #9873

Merged
merged 2 commits into from
May 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
337 changes: 168 additions & 169 deletions xml/System.Windows.Controls/ContentPresenter.xml

Large diffs are not rendered by default.

252 changes: 125 additions & 127 deletions xml/System.Windows.Controls/ControlTemplate.xml

Large diffs are not rendered by default.

31 changes: 15 additions & 16 deletions xml/System.Windows.Controls/FlowDocumentReaderViewingMode.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,25 +21,24 @@
<Docs>
<summary>Names viewing modes for the <see cref="T:System.Windows.Controls.FlowDocumentReader" /> control.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The following figure provides an example of Page viewing mode. Page mode displays a single page of content at a time. Note that this mode includes page navigation controls that display the current page count and position and provide **Next** and **Previous** page buttons. This viewing mode does not display scroll bars.
![FlowDocReader ViewMode of Page](~/add/media/flowdocrdrviewmode-page.png "FlowDocReader ViewMode of Page")
The following figure provides an example of TwoPage viewing mode. TwoPage mode is similar to Page mode, except two facing pages are displayed at a time, similar to an open book. Note that this mode includes page navigation controls that display the current page count and position and provide **Next** and **Previous** page buttons; in this mode, the **Next** and **Previous** page buttons cause content to jump by two pages at a time, similar to turning a page in a book. The current page number indicates the leading page. This viewing mode does not display scroll bars.
![FlowDocumentReader ViewMode of Book](~/add/media/flowdocrdrviewmode-book.png "FlowDocumentReader ViewMode of Book")
The following figure provides an example of Scroll viewing mode. This viewing mode does not include page navigation controls; rather, the user navigates content using provided scroll bars. For the purposes of page count and navigation, Scroll viewing mode presents a single page whose number is always 1.
![Screenshot: FlowDocumentReader ViewMode of Scroll](~/add/media/flowdocrdrviewmode-scroll.png "Screenshot: FlowDocumentReader ViewMode of Scroll")
<format type="text/markdown"><![CDATA[

## Remarks
The following figure provides an example of Page viewing mode. Page mode displays a single page of content at a time. Note that this mode includes page navigation controls that display the current page count and position and provide **Next** and **Previous** page buttons. This viewing mode does not display scroll bars.

![FlowDocReader ViewMode of Page](~/add/media/flowdocrdrviewmode-page.png)

The following figure provides an example of TwoPage viewing mode. TwoPage mode is similar to Page mode, except two facing pages are displayed at a time, similar to an open book. Note that this mode includes page navigation controls that display the current page count and position and provide **Next** and **Previous** page buttons; in this mode, the **Next** and **Previous** page buttons cause content to jump by two pages at a time, similar to turning a page in a book. The current page number indicates the leading page. This viewing mode does not display scroll bars.

![FlowDocumentReader ViewMode of Book](~/add/media/flowdocrdrviewmode-book.png)

The following figure provides an example of Scroll viewing mode. This viewing mode does not include page navigation controls; rather, the user navigates content using provided scroll bars. For the purposes of page count and navigation, Scroll viewing mode presents a single page whose number is always 1.

![Screenshot: FlowDocumentReader ViewMode of Scroll](~/add/media/flowdocrdrviewmode-scroll.png)

]]></format>
</remarks>
<altmember cref="P:System.Windows.Controls.FlowDocumentReader.ViewingMode" />
<related type="ExternalDocumentation" href="https://go.microsoft.com/fwlink/?LinkID=160054">WPF Layout Gallery Sample</related>
</Docs>
<Members>
<Member MemberName="Page">
Expand Down
1,269 changes: 633 additions & 636 deletions xml/System.Windows.Controls/ItemsControl.xml

Large diffs are not rendered by default.

132 changes: 66 additions & 66 deletions xml/System.Windows.Controls/ListView.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,41 +29,41 @@
<Docs>
<summary>Represents a control that displays a list of data items.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
<xref:System.Windows.Controls.ListView> is an <xref:System.Windows.Controls.ItemsControl>, which means it can contain a collection of objects of any type (such as string, image, or panel). For more information, see the <xref:System.Windows.Controls.ItemsControl> class.
The presentation of the data items in a <xref:System.Windows.Controls.ListView> is defined by its view mode, which is specified by the <xref:System.Windows.Controls.ListView.View%2A> property. Windows Presentation Foundation (WPF) provides a <xref:System.Windows.Controls.GridView> view mode that partitions the <xref:System.Windows.Controls.ListView> data item content into columns. The properties and methods on <xref:System.Windows.Controls.GridView> and its related classes style and specify the content of the columns.
The following illustration shows a <xref:System.Windows.Controls.ListView> with a <xref:System.Windows.Controls.GridView> view.
![ListView with GridView output](~/add/media/listviewgridview.JPG "ListView with GridView output")
You can also define custom views by creating a class that derives from <xref:System.Windows.Controls.ViewBase>. For more information, see [How to: Create a Custom View Mode for a ListView](/dotnet/framework/wpf/controls/how-to-create-a-custom-view-mode-for-a-listview).
If you define a custom <xref:System.Windows.Controls.ItemsControl.ItemContainerStyle%2A> for a <xref:System.Windows.Controls.ListView> control and also define an <xref:System.Windows.Controls.ItemsControl.ItemTemplate%2A>, you must include a <xref:System.Windows.Controls.ContentPresenter> in the <xref:System.Windows.Controls.ItemsControl.ItemContainerStyle%2A>. The <xref:System.Windows.Controls.ContentPresenter> is required for the <xref:System.Windows.Controls.ItemsControl.ItemTemplate%2A> to work correctly.
To avoid alignment issues in a <xref:System.Windows.Controls.GridView> view mode, do not add content or set properties that affect the width of an item in the <xref:System.Windows.Controls.ItemsControl.ItemContainerStyle%2A> of a <xref:System.Windows.Controls.ListView>. To prevent alignment issues, use properties and templates that are defined for the <xref:System.Windows.Controls.GridView> view mode. This includes properties and templates that are defined for classes that are used in a <xref:System.Windows.Controls.GridView> view mode, such as <xref:System.Windows.Controls.GridViewColumn> and <xref:System.Windows.Controls.GridViewColumnHeader>.
Two <xref:System.Windows.Controls.ListView> controls cannot share the same view. To specify a view that can be used more than one time, use templates or styles. For an example of a <xref:System.Windows.Controls.GridView> and other custom views that are defined as reusable resources, see [ListView with Multiple Views Sample](https://go.microsoft.com/fwlink/?LinkID=160013).
Do not use the <xref:System.Windows.Controls.Control.HorizontalContentAlignment%2A> and <xref:System.Windows.Controls.Control.VerticalContentAlignment%2A> properties for <xref:System.Windows.Controls.ListView> content that is displayed by using a <xref:System.Windows.Controls.GridView>. To specify the alignment of content in a column of a <xref:System.Windows.Controls.GridView>, define a <xref:System.Windows.Controls.GridViewColumn.CellTemplate%2A>.
Displaying a large number of items may cause performance issues. See [Optimizing Performance: Controls](/dotnet/framework/wpf/advanced/optimizing-performance-controls) for more information.
## Customizing the ListView Control
To apply the same property settings to multiple <xref:System.Windows.Controls.ListView> controls, use the <xref:System.Windows.FrameworkElement.Style%2A> property. You can modify the default <xref:System.Windows.Controls.ControlTemplate> to give the control a unique appearance. For more information about creating a <xref:System.Windows.Controls.ControlTemplate>, see [Customizing the Appearance of an Existing Control by Creating a ControlTemplate](/dotnet/framework/wpf/controls/customizing-the-appearance-of-an-existing-control). To see the parts and states that are specific to the <xref:System.Windows.Controls.ListView>, see [ListView Styles and Templates](/dotnet/framework/wpf/controls/listview-styles-and-templates).
<format type="text/markdown"><![CDATA[

## Remarks
<xref:System.Windows.Controls.ListView> is an <xref:System.Windows.Controls.ItemsControl>, which means it can contain a collection of objects of any type (such as string, image, or panel). For more information, see the <xref:System.Windows.Controls.ItemsControl> class.

The presentation of the data items in a <xref:System.Windows.Controls.ListView> is defined by its view mode, which is specified by the <xref:System.Windows.Controls.ListView.View%2A> property. Windows Presentation Foundation (WPF) provides a <xref:System.Windows.Controls.GridView> view mode that partitions the <xref:System.Windows.Controls.ListView> data item content into columns. The properties and methods on <xref:System.Windows.Controls.GridView> and its related classes style and specify the content of the columns.

The following illustration shows a <xref:System.Windows.Controls.ListView> with a <xref:System.Windows.Controls.GridView> view.

![ListView with GridView output](~/add/media/listviewgridview.JPG "ListView with GridView output")

You can also define custom views by creating a class that derives from <xref:System.Windows.Controls.ViewBase>. For more information, see [How to: Create a Custom View Mode for a ListView](/dotnet/framework/wpf/controls/how-to-create-a-custom-view-mode-for-a-listview).

If you define a custom <xref:System.Windows.Controls.ItemsControl.ItemContainerStyle%2A> for a <xref:System.Windows.Controls.ListView> control and also define an <xref:System.Windows.Controls.ItemsControl.ItemTemplate%2A>, you must include a <xref:System.Windows.Controls.ContentPresenter> in the <xref:System.Windows.Controls.ItemsControl.ItemContainerStyle%2A>. The <xref:System.Windows.Controls.ContentPresenter> is required for the <xref:System.Windows.Controls.ItemsControl.ItemTemplate%2A> to work correctly.

To avoid alignment issues in a <xref:System.Windows.Controls.GridView> view mode, do not add content or set properties that affect the width of an item in the <xref:System.Windows.Controls.ItemsControl.ItemContainerStyle%2A> of a <xref:System.Windows.Controls.ListView>. To prevent alignment issues, use properties and templates that are defined for the <xref:System.Windows.Controls.GridView> view mode. This includes properties and templates that are defined for classes that are used in a <xref:System.Windows.Controls.GridView> view mode, such as <xref:System.Windows.Controls.GridViewColumn> and <xref:System.Windows.Controls.GridViewColumnHeader>.

Two <xref:System.Windows.Controls.ListView> controls cannot share the same view. To specify a view that can be used more than one time, use templates or styles.

Do not use the <xref:System.Windows.Controls.Control.HorizontalContentAlignment%2A> and <xref:System.Windows.Controls.Control.VerticalContentAlignment%2A> properties for <xref:System.Windows.Controls.ListView> content that is displayed by using a <xref:System.Windows.Controls.GridView>. To specify the alignment of content in a column of a <xref:System.Windows.Controls.GridView>, define a <xref:System.Windows.Controls.GridViewColumn.CellTemplate%2A>.

Displaying a large number of items may cause performance issues. See [Optimizing Performance: Controls](/dotnet/framework/wpf/advanced/optimizing-performance-controls) for more information.

## Customizing the ListView Control
To apply the same property settings to multiple <xref:System.Windows.Controls.ListView> controls, use the <xref:System.Windows.FrameworkElement.Style%2A> property. You can modify the default <xref:System.Windows.Controls.ControlTemplate> to give the control a unique appearance. For more information about creating a <xref:System.Windows.Controls.ControlTemplate>, see [Customizing the Appearance of an Existing Control by Creating a ControlTemplate](/dotnet/framework/wpf/controls/customizing-the-appearance-of-an-existing-control). To see the parts and states that are specific to the <xref:System.Windows.Controls.ListView>, see [ListView Styles and Templates](/dotnet/framework/wpf/controls/listview-styles-and-templates).

Dependency properties for this control might be set by the control's default style. If a property is set by a default style, the property might change from its default value when the control appears in the application. The default style is determined by which desktop theme is used when the application is running.
[!INCLUDE[setting-a-visual-property](~/includes/visual-property-note.md)]
## Examples
The following example shows how to create a <xref:System.Windows.Controls.ListView> control that implements a <xref:System.Windows.Controls.GridView> as its <xref:System.Windows.Controls.ListView.View%2A>. The illustration in the Remarks section is taken from this example.
:::code language="xaml" source="~/snippets/csharp/System.Windows.Controls/GridView/Overview/Window1.xaml" id="Snippetlistviewemployee":::

[!INCLUDE[setting-a-visual-property](~/includes/visual-property-note.md)]

## Examples
The following example shows how to create a <xref:System.Windows.Controls.ListView> control that implements a <xref:System.Windows.Controls.GridView> as its <xref:System.Windows.Controls.ListView.View%2A>. The illustration in the Remarks section is taken from this example.

:::code language="xaml" source="~/snippets/csharp/System.Windows.Controls/GridView/Overview/Window1.xaml" id="Snippetlistviewemployee":::

]]></format>
</remarks>
<altmember cref="T:System.Windows.Controls.ListViewItem" />
Expand Down Expand Up @@ -247,11 +247,11 @@
<param name="e">The event arguments.</param>
<summary>Responds to an <see cref="M:System.Windows.Controls.ItemsControl.OnItemsChanged(System.Collections.Specialized.NotifyCollectionChangedEventArgs)" />.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
This method is called when there is a change in the items collection of a <xref:System.Windows.Controls.ListView> control.
<format type="text/markdown"><![CDATA[

## Remarks
This method is called when there is a change in the items collection of a <xref:System.Windows.Controls.ListView> control.

]]></format>
</remarks>
</Docs>
Expand Down Expand Up @@ -286,11 +286,11 @@
<param name="item">The object to use to create the <see cref="T:System.Windows.Controls.ListViewItem" />.</param>
<summary>Sets the styles, templates, and bindings for a <see cref="T:System.Windows.Controls.ListViewItem" />.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
This method prepares a <xref:System.Windows.Controls.ListViewItem> control for display according to the specified <xref:System.Windows.Controls.ListView.View%2A>.
<format type="text/markdown"><![CDATA[

## Remarks
This method prepares a <xref:System.Windows.Controls.ListViewItem> control for display according to the specified <xref:System.Windows.Controls.ListView.View%2A>.

]]></format>
</remarks>
</Docs>
Expand Down Expand Up @@ -320,31 +320,31 @@
<summary>Gets or sets an object that defines how the data is styled and organized in a <see cref="T:System.Windows.Controls.ListView" /> control.</summary>
<value>A <see cref="T:System.Windows.Controls.ViewBase" /> object that specifies how to display information in the <see cref="T:System.Windows.Controls.ListView" />.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The .NET Framework environment includes the configurable view mode named <xref:System.Windows.Controls.GridView>. You can also create a custom view that inherits from <xref:System.Windows.Controls.ViewBase>. For more information, see [How to: Create a Custom View Mode for a ListView](/dotnet/framework/wpf/controls/how-to-create-a-custom-view-mode-for-a-listview).
<a name="dependencyPropertyInfo_View"></a>
## Dependency Property Information
|||
|-|-|
|Identifier field|<xref:System.Windows.Controls.ListView.ViewProperty>|
|Metadata properties set to `true`|None|
<format type="text/markdown"><![CDATA[

## Remarks
The .NET Framework environment includes the configurable view mode named <xref:System.Windows.Controls.GridView>. You can also create a custom view that inherits from <xref:System.Windows.Controls.ViewBase>. For more information, see [How to: Create a Custom View Mode for a ListView](/dotnet/framework/wpf/controls/how-to-create-a-custom-view-mode-for-a-listview).

<a name="dependencyPropertyInfo_View"></a>
## Dependency Property Information

|||
|-|-|
|Identifier field|<xref:System.Windows.Controls.ListView.ViewProperty>|
|Metadata properties set to `true`|None|

> [!NOTE]
> The type of property metadata for this property is <xref:System.Windows.PropertyMetadata>, not <xref:System.Windows.FrameworkPropertyMetadata>.
## Examples
The following example shows how to specify a <xref:System.Windows.Controls.GridView> object as the <xref:System.Windows.Controls.ListView.View%2A> for a <xref:System.Windows.Controls.ListView> control.
> The type of property metadata for this property is <xref:System.Windows.PropertyMetadata>, not <xref:System.Windows.FrameworkPropertyMetadata>.



## Examples
The following example shows how to specify a <xref:System.Windows.Controls.GridView> object as the <xref:System.Windows.Controls.ListView.View%2A> for a <xref:System.Windows.Controls.ListView> control.

:::code language="csharp" source="~/snippets/csharp/System.Windows.Controls/GridView/Overview/Window1.xaml.cs" id="Snippetlistviewview":::
:::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Wpf/ListViewCode/visualbasic/window1.xaml.vb" id="Snippetlistviewview":::
:::code language="xaml" source="~/snippets/csharp/System.Windows.Controls/GridView/Overview/Window1.xaml" id="Snippetlistviewview":::
:::code language="xaml" source="~/snippets/csharp/System.Windows.Controls/GridView/Overview/Window1.xaml" id="Snippetlistviewview":::

]]></format>
</remarks>
<altmember cref="T:System.Windows.Controls.ViewBase" />
Expand Down
Loading
Loading