// Get Tags and Qualifications for the pickers
        async void GetAdditionalData()
        {
            Tags = new ObservableCollection <Tag>();

            Qualifications = new ObservableCollection <string>(Constants.StaticQualifications);

            var tags = await StoreManager.TagStore.GetItemsAsync();

            if (tags != null && tags.Any())
            {
                Tags = new ObservableCollection <Tag>(tags);
            }

            var list_codes = ReadJsonFile();

            if (list_codes != null)
            {
                CountryCodes = new ObservableCollection <CountryCode>(list_codes);

                SelectedCountry = CountryCodes.First((arg) => arg.Name == "France");
            }

            if (ExistingContact != null)
            {
                Qualification = ExistingContact.Qualification;

                if (!string.IsNullOrEmpty(ExistingContact.Mobile))
                {
                    var code = CountryCodes?.Where((arg) => arg.DialCode == ExistingContact?.Mobile?.Split('-')?.First())?.First();

                    if (code != null)
                    {
                        SelectedCountry = code;
                    }
                }

                if (!string.IsNullOrEmpty(ExistingContact.Tags))
                {
                    Tag = Tags?.Where((arg) => arg.Name == ExistingContact?.Tags)?.First();
                }
            }
        }
Example #2
0
 public string GetCountry(string id)
 {
     return(CountryCodes.Where(r => r.CountryCodeID == id).Select(r => r.Name).FirstOrDefault());
 }