Beispiel #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;
        }
Beispiel #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();
        }
Beispiel #3
0
 public static void UpdateFont(this MauiComboBox nativeComboBox, IPicker picker, IFontManager fontManager) =>
 nativeComboBox.UpdateFont(picker.Font, fontManager);
Beispiel #4
0
 public static void UpdateCharacterSpacing(this MauiComboBox nativeComboBox, IPicker picker)
 {
     nativeComboBox.CharacterSpacing = picker.CharacterSpacing.ToEm();
 }
Beispiel #5
0
 public static void UpdateSelectedIndex(this MauiComboBox nativeComboBox, IPicker picker)
 {
     nativeComboBox.SelectedIndex = picker.SelectedIndex;
 }
Beispiel #6
0
 public static void UpdateTextColor(this MauiComboBox nativeComboBox, IPicker picker)
 {
     nativeComboBox.UpdateTextColor(picker, null);
 }
Beispiel #7
0
 public static void UpdateHorizontalTextAlignment(this MauiComboBox nativeComboBox, IPicker picker)
 {
     nativeComboBox.HorizontalContentAlignment = picker.HorizontalTextAlignment.ToNativeHorizontalAlignment();
 }