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

Remove excessive ListView API doc #24327

Merged
merged 1 commit into from
Aug 22, 2024
Merged
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
118 changes: 0 additions & 118 deletions src/Controls/docs/Microsoft.Maui.Controls/ListView.xml
Original file line number Diff line number Diff line change
Expand Up @@ -45,124 +45,6 @@
</Attributes>
<Docs>
<summary>An <see cref="T:Microsoft.Maui.Controls.ItemsView`1" /> that displays a collection of data as a vertical list.</summary>
<remarks>
<para>
<img href="~/xml/Microsoft.Maui.Controls/_images/ListView.TripleScreenShot.png" />
</para>
<para>The following example shows a basic use:</para>
<example>
<code lang="csharp lang-csharp"><![CDATA[
using System;
using System.Collections.Generic;
using Microsoft.Maui.Controls;

namespace FormsGallery
{
class ListViewDemoPage : ContentPage
{
class Person
{
public Person(string name, DateTime birthday, Color favoriteColor)
{
this.Name = name;
this.Birthday = birthday;
this.FavoriteColor = favoriteColor;
}

public string Name { private set; get; }

public DateTime Birthday { private set; get; }

public Color FavoriteColor { private set; get; }
};

public ListViewDemoPage()
{
Label header = new Label
{
Text = "ListView",
FontSize = Device.GetNamedSize (NamedSize.Large, typeof(Label)),
HorizontalOptions = LayoutOptions.Center
};

// Define some data.
List<Person> people = new List<Person>
{
new Person("Abigail", new DateTime(1975, 1, 15), Color.Aqua),
new Person("Bob", new DateTime(1976, 2, 20), Color.Black),
// ...etc.,...
new Person("Yvonne", new DateTime(1987, 1, 10), Color.Purple),
new Person("Zachary", new DateTime(1988, 2, 5), Color.Red)
};

// Create the ListView.
ListView listView = new ListView
{
// Source of data items.
ItemsSource = people,

// Define template for displaying each item.
// (Argument of DataTemplate constructor is called for
// each item; it must return a Cell derivative.)
ItemTemplate = new DataTemplate(() =>
{
// Create views with bindings for displaying each property.
Label nameLabel = new Label();
nameLabel.SetBinding(Label.TextProperty, "Name");

Label birthdayLabel = new Label();
birthdayLabel.SetBinding(Label.TextProperty,
new Binding("Birthday", BindingMode.OneWay,
null, null, "Born {0:d}"));

BoxView boxView = new BoxView();
boxView.SetBinding(BoxView.ColorProperty, "FavoriteColor");

// Return an assembled ViewCell.
return new ViewCell
{
View = new StackLayout
{
Padding = new Thickness(0, 5),
Orientation = StackOrientation.Horizontal,
Children =
{
boxView,
new StackLayout
{
VerticalOptions = LayoutOptions.Center,
Spacing = 0,
Children =
{
nameLabel,
birthdayLabel
}
}
}
}
};
})
};

// Accomodate iPhone status bar.
this.Padding = new Thickness(10, Device.OnPlatform(20, 0, 0), 10, 5);

// Build the page.
this.Content = new StackLayout
{
Children =
{
header,
listView
}
};
}
}
}

]]></code>
</example>
</remarks>
</Docs>
<Members>
<Member MemberName=".ctor">
Expand Down
Loading