using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

using Xamarin.Forms;
using Xamarin.Forms.Xaml;
using XamarinStudy.CustomViewCells;

namespace XamarinStudy.Views
{
	[XamlCompilation(XamlCompilationOptions.Compile)]
	public partial class SampleTableViewSimpleRegisterPage : ContentPage
	{
		public SampleTableViewSimpleRegisterPage()
		{
			InitializeComponent();
		}

		private async void sexButton_Clicked(object sender, EventArgs e)
		{
			string result = await DisplayActionSheet("Sex", "Cancel", null, "Male", "Female");
			if (result != "Cancel")
				sexLabel.Text = result;
		}

		private void customCell_Tapped(object sender, EventArgs e)
		{
			Navigation.PushAsync(new JobSelector(this));
		}

		public void SetJob(string value)
		{
			customCell.Title = value;
			customCell.Detail = "";
		}

		private void notifySwitch_PropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e)
		{
			customCell.IsVisible = notifySwitch.IsToggled;
		}
	}
}