public object Convert(object value, Type targetType, object parameter, CultureInfo culture) { if (value != null) { return(OfficeLocationUtils.GetRGBColorByOfficeLocation(value.ToString())); } return(OfficeLocationUtils.DEFAULT_RGB_COLOR); }
private void OnOfficeLocationSelected(object sender, EventArgs e) { var picker = sender as Picker; int selectedIndex = picker.SelectedIndex; if (selectedIndex != -1) { GetViewModel().SelectedIndexOfficeLocation = selectedIndex; } OfficeLabel.Text = OfficePicker.Items[OfficePicker.SelectedIndex]; OfficeLabel.TextColor = Color.FromHex(OfficeLocationUtils.GetRGBColorByOfficeLocation(OfficeLabel.Text)); }