예제 #1
0
		void SetBillingCountry()
		{
			countryPicker.SelectedIndex = countryPicker.SelectedIndex > -1 ? countryPicker.SelectedIndex : 0;
			var selectedValue = countryPicker.Items[countryPicker.SelectedIndex];
			_currentDiscoveredCountry = _countryDiscoverer.DiscoverCountry(selectedValue);
			postcodeEntry.Placeholder = _currentDiscoveredCountry.GetPostcodeTitle();
			postcodeEntry.Text = string.Empty;

			if (_currentDiscoveredCountry.IsPostcodeNumeric())
			{
				postcodeEntry.Keyboard = Keyboard.Numeric;
				postcodeEntry.Digits = "0123456789";
			}
			else
			{
				postcodeEntry.Keyboard = Keyboard.Text;
				postcodeEntry.Digits = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ";
			}

			postcodeEntry.MaxLength = _currentDiscoveredCountry.GetPostcodeLength();
			postcodeEntry.IsEnabled = _currentDiscoveredCountry.IsPostcodeRequired();
			Validate(postcodeEntry);
		}