Example #1
0
        public static void UpdateTitle(this MauiComboBox nativeComboBox, IPicker picker)
        {
            nativeComboBox.Header = null;

            nativeComboBox.HeaderTemplate = string.IsNullOrEmpty(picker.Title) ? null :
                                            (UI.Xaml.DataTemplate)UI.Xaml.Application.Current.Resources["ComboBoxHeader"];

            nativeComboBox.DataContext = picker;
        }
Example #2
0
        public static void UpdateTextColor(this MauiComboBox nativeComboBox, IPicker picker, WBrush?defaultForeground)
        {
            Color color = picker.TextColor;

            if (color.IsDefault() && defaultForeground == null)
            {
                return;
            }

            nativeComboBox.Foreground = color.IsDefault() ? (defaultForeground ?? color.ToNative()) : color.ToNative();
        }
Example #3
0
 public static void UpdateFont(this MauiComboBox nativeComboBox, IPicker picker, IFontManager fontManager) =>
 nativeComboBox.UpdateFont(picker.Font, fontManager);
Example #4
0
 public static void UpdateCharacterSpacing(this MauiComboBox nativeComboBox, IPicker picker)
 {
     nativeComboBox.CharacterSpacing = picker.CharacterSpacing.ToEm();
 }
Example #5
0
 public static void UpdateSelectedIndex(this MauiComboBox nativeComboBox, IPicker picker)
 {
     nativeComboBox.SelectedIndex = picker.SelectedIndex;
 }
Example #6
0
 public static void UpdateTextColor(this MauiComboBox nativeComboBox, IPicker picker)
 {
     nativeComboBox.UpdateTextColor(picker, null);
 }
Example #7
0
 public static void UpdateHorizontalTextAlignment(this MauiComboBox nativeComboBox, IPicker picker)
 {
     nativeComboBox.HorizontalContentAlignment = picker.HorizontalTextAlignment.ToNativeHorizontalAlignment();
 }