|
29 | 29 | <Docs>
|
30 | 30 | <summary>Represents a control that displays a list of data items.</summary>
|
31 | 31 | <remarks>
|
32 |
| - <format type="text/markdown">< |
42 |
| - |
43 |
| - 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). |
44 |
| - |
45 |
| - 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. |
46 |
| - |
47 |
| - 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>. |
48 |
| - |
49 |
| - 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). |
50 |
| - |
51 |
| - 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>. |
52 |
| - |
53 |
| - Displaying a large number of items may cause performance issues. See [Optimizing Performance: Controls](/dotnet/framework/wpf/advanced/optimizing-performance-controls) for more information. |
54 |
| - |
55 |
| -## Customizing the ListView Control |
56 |
| - 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). |
57 |
| - |
| 32 | + <format type="text/markdown">< |
| 42 | +
|
| 43 | + 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). |
| 44 | +
|
| 45 | + 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. |
| 46 | +
|
| 47 | + 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>. |
| 48 | +
|
| 49 | + 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. |
| 50 | +
|
| 51 | + 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>. |
| 52 | +
|
| 53 | + Displaying a large number of items may cause performance issues. See [Optimizing Performance: Controls](/dotnet/framework/wpf/advanced/optimizing-performance-controls) for more information. |
| 54 | +
|
| 55 | +## Customizing the ListView Control |
| 56 | + 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). |
| 57 | +
|
58 | 58 | 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.
|
59 |
| - |
60 |
| -[!INCLUDE[setting-a-visual-property](~/includes/visual-property-note.md)] |
61 |
| - |
62 |
| -## Examples |
63 |
| - 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. |
64 |
| - |
65 |
| - :::code language="xaml" source="~/snippets/csharp/System.Windows.Controls/GridView/Overview/Window1.xaml" id="Snippetlistviewemployee"::: |
66 |
| - |
| 59 | +
|
| 60 | +[!INCLUDE[setting-a-visual-property](~/includes/visual-property-note.md)] |
| 61 | +
|
| 62 | +## Examples |
| 63 | + 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. |
| 64 | +
|
| 65 | + :::code language="xaml" source="~/snippets/csharp/System.Windows.Controls/GridView/Overview/Window1.xaml" id="Snippetlistviewemployee"::: |
| 66 | +
|
67 | 67 | ]]></format>
|
68 | 68 | </remarks>
|
69 | 69 | <altmember cref="T:System.Windows.Controls.ListViewItem" />
|
|
247 | 247 | <param name="e">The event arguments.</param>
|
248 | 248 | <summary>Responds to an <see cref="M:System.Windows.Controls.ItemsControl.OnItemsChanged(System.Collections.Specialized.NotifyCollectionChangedEventArgs)" />.</summary>
|
249 | 249 | <remarks>
|
250 |
| - <format type="text/markdown"><![CDATA[ |
251 |
| - |
252 |
| -## Remarks |
253 |
| - This method is called when there is a change in the items collection of a <xref:System.Windows.Controls.ListView> control. |
254 |
| - |
| 250 | + <format type="text/markdown"><![CDATA[ |
| 251 | +
|
| 252 | +## Remarks |
| 253 | + This method is called when there is a change in the items collection of a <xref:System.Windows.Controls.ListView> control. |
| 254 | +
|
255 | 255 | ]]></format>
|
256 | 256 | </remarks>
|
257 | 257 | </Docs>
|
|
286 | 286 | <param name="item">The object to use to create the <see cref="T:System.Windows.Controls.ListViewItem" />.</param>
|
287 | 287 | <summary>Sets the styles, templates, and bindings for a <see cref="T:System.Windows.Controls.ListViewItem" />.</summary>
|
288 | 288 | <remarks>
|
289 |
| - <format type="text/markdown"><![CDATA[ |
290 |
| - |
291 |
| -## Remarks |
292 |
| - This method prepares a <xref:System.Windows.Controls.ListViewItem> control for display according to the specified <xref:System.Windows.Controls.ListView.View%2A>. |
293 |
| - |
| 289 | + <format type="text/markdown"><![CDATA[ |
| 290 | +
|
| 291 | +## Remarks |
| 292 | + This method prepares a <xref:System.Windows.Controls.ListViewItem> control for display according to the specified <xref:System.Windows.Controls.ListView.View%2A>. |
| 293 | +
|
294 | 294 | ]]></format>
|
295 | 295 | </remarks>
|
296 | 296 | </Docs>
|
|
320 | 320 | <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>
|
321 | 321 | <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>
|
322 | 322 | <remarks>
|
323 |
| - <format type="text/markdown"><. |
327 |
| - |
328 |
| -<a name="dependencyPropertyInfo_View"></a> |
329 |
| -## Dependency Property Information |
330 |
| - |
331 |
| -||| |
332 |
| -|-|-| |
333 |
| -|Identifier field|<xref:System.Windows.Controls.ListView.ViewProperty>| |
334 |
| -|Metadata properties set to `true`|None| |
335 |
| - |
| 323 | + <format type="text/markdown"><. |
| 327 | +
|
| 328 | +<a name="dependencyPropertyInfo_View"></a> |
| 329 | +## Dependency Property Information |
| 330 | +
|
| 331 | +||| |
| 332 | +|-|-| |
| 333 | +|Identifier field|<xref:System.Windows.Controls.ListView.ViewProperty>| |
| 334 | +|Metadata properties set to `true`|None| |
| 335 | +
|
336 | 336 | > [!NOTE]
|
337 |
| -> The type of property metadata for this property is <xref:System.Windows.PropertyMetadata>, not <xref:System.Windows.FrameworkPropertyMetadata>. |
338 |
| - |
339 |
| - |
340 |
| - |
341 |
| -## Examples |
342 |
| - 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. |
343 |
| - |
| 337 | +> The type of property metadata for this property is <xref:System.Windows.PropertyMetadata>, not <xref:System.Windows.FrameworkPropertyMetadata>. |
| 338 | +
|
| 339 | +
|
| 340 | +
|
| 341 | +## Examples |
| 342 | + 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. |
| 343 | +
|
344 | 344 | :::code language="csharp" source="~/snippets/csharp/System.Windows.Controls/GridView/Overview/Window1.xaml.cs" id="Snippetlistviewview":::
|
345 | 345 | :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Wpf/ListViewCode/visualbasic/window1.xaml.vb" id="Snippetlistviewview":::
|
346 |
| - :::code language="xaml" source="~/snippets/csharp/System.Windows.Controls/GridView/Overview/Window1.xaml" id="Snippetlistviewview"::: |
347 |
| - |
| 346 | + :::code language="xaml" source="~/snippets/csharp/System.Windows.Controls/GridView/Overview/Window1.xaml" id="Snippetlistviewview"::: |
| 347 | +
|
348 | 348 | ]]></format>
|
349 | 349 | </remarks>
|
350 | 350 | <altmember cref="T:System.Windows.Controls.ViewBase" />
|
|
0 commit comments