2016-05-13 07:11:32 +03:00
|
|
|
|
using System;
|
|
|
|
|
using Bit.App.Resources;
|
|
|
|
|
using Xamarin.Forms;
|
|
|
|
|
|
|
|
|
|
namespace Bit.App.Controls
|
|
|
|
|
{
|
2016-05-18 04:28:19 +03:00
|
|
|
|
public class FormPickerCell : ExtendedViewCell
|
2016-05-13 07:11:32 +03:00
|
|
|
|
{
|
|
|
|
|
public FormPickerCell(string labelText, string[] pickerItems)
|
|
|
|
|
{
|
|
|
|
|
Label = new Label
|
|
|
|
|
{
|
|
|
|
|
Text = labelText,
|
|
|
|
|
FontSize = 14,
|
2016-05-17 06:54:24 +03:00
|
|
|
|
TextColor = Color.FromHex("777777"),
|
|
|
|
|
VerticalOptions = LayoutOptions.Start
|
2016-05-13 07:11:32 +03:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
Picker = new ExtendedPicker
|
|
|
|
|
{
|
2016-05-17 06:54:24 +03:00
|
|
|
|
HasBorder = false,
|
2016-05-19 06:55:30 +03:00
|
|
|
|
VerticalOptions = LayoutOptions.CenterAndExpand
|
2016-05-13 07:11:32 +03:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
foreach(var item in pickerItems)
|
|
|
|
|
{
|
|
|
|
|
Picker.Items.Add(item);
|
|
|
|
|
}
|
|
|
|
|
Picker.SelectedIndex = 0;
|
|
|
|
|
|
|
|
|
|
var stackLayout = new StackLayout
|
|
|
|
|
{
|
2016-06-14 03:03:16 +03:00
|
|
|
|
Padding = new Thickness(15, 10)
|
2016-05-13 07:11:32 +03:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
stackLayout.Children.Add(Label);
|
|
|
|
|
stackLayout.Children.Add(Picker);
|
|
|
|
|
|
|
|
|
|
View = stackLayout;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public Label Label { get; private set; }
|
|
|
|
|
public ExtendedPicker Picker { get; private set; }
|
|
|
|
|
}
|
|
|
|
|
}
|