Skip to content
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
84 changes: 0 additions & 84 deletions src/Controls/docs/Microsoft.Maui.Controls/Picker.xml
Original file line number Diff line number Diff line change
Expand Up @@ -34,90 +34,6 @@
<summary>A <see cref="T:Microsoft.Maui.Controls.View" /> control for picking an element in a list.</summary>
<remarks>
<para>The visual representation of a Picker is similar to a <see cref="T:Microsoft.Maui.Controls.Entry" />, but a picker control appears in place of a keyboard.</para>
<para>The following example shows the creation of a Picker.</para>
<example>
<code lang="csharp lang-csharp"><![CDATA[using System;
using System.Collections.Generic;
using Microsoft.Maui.Controls;

namespace FormsGallery
{
class PickerDemoPage : ContentPage
{
// Dictionary to get Color from color name.
Dictionary<string, Color> nameToColor = new Dictionary<string, Color>
{
{ "Aqua", Color.Aqua }, { "Black", Color.Black },
{ "Blue", Color.Blue }, { "Fuchsia", Color.Fuchsia },
{ "Gray", Color.Gray }, { "Green", Color.Green },
{ "Lime", Color.Lime }, { "Maroon", Color.Maroon },
{ "Navy", Color.Navy }, { "Olive", Color.Olive },
{ "Purple", Color.Purple }, { "Red", Color.Red },
{ "Silver", Color.Silver }, { "Teal", Color.Teal },
{ "White", Color.White }, { "Yellow", Color.Yellow }
};

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

Picker picker = new Picker
{
Title = "Color",
VerticalOptions = LayoutOptions.CenterAndExpand
};

foreach (string colorName in nameToColor.Keys)
{
picker.Items.Add(colorName);
}

// Create BoxView for displaying picked Color
BoxView boxView = new BoxView
{
WidthRequest = 150,
HeightRequest = 150,
HorizontalOptions = LayoutOptions.Center,
VerticalOptions = LayoutOptions.CenterAndExpand
};

picker.SelectedIndexChanged += (sender, args) =>
{
if (picker.SelectedIndex == -1)
{
boxView.Color = Color.Default;
}
else
{
string colorName = picker.Items[picker.SelectedIndex];
boxView.Color = nameToColor[colorName];
}
};

// 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,
picker,
boxView
}
};

}
}
}
]]></code>
</example>
<para>
<img href="~/xml/Microsoft.Maui.Controls/_images/Picker.TripleScreenShot.png" />
</para>
Expand Down