maui-linux/Xamarin.Forms.Material.iOS/MaterialDatePickerRenderer.cs

32 строки
1.2 KiB
C#

using System.ComponentModel;
using UIKit;
using Xamarin.Forms.Platform.iOS;
namespace Xamarin.Forms.Material.iOS
{
public class MaterialDatePickerRenderer : DatePickerRendererBase<MaterialTextField>, IMaterialEntryRenderer
{
protected override MaterialTextField CreateNativeControl() => new NoCaretMaterialTextField(this, Element);
protected override void SetBackgroundColor(Color color) => ApplyTheme();
protected internal override void UpdateTextColor() => Control?.UpdateTextColor(this);
protected virtual void ApplyTheme() => Control?.ApplyTheme(this);
protected internal override void UpdateFont()
{
base.UpdateFont();
Control?.ApplyTypographyScheme(Element);
}
protected override void OnElementChanged(ElementChangedEventArgs<DatePicker> e)
{
base.OnElementChanged(e);
UpdatePlaceholder();
}
void UpdatePlaceholder() => Control?.UpdatePlaceholder(this);
string IMaterialEntryRenderer.Placeholder => string.Empty;
Color IMaterialEntryRenderer.PlaceholderColor => Color.Default;
Color IMaterialEntryRenderer.TextColor => Element?.TextColor ?? Color.Default;
Color IMaterialEntryRenderer.BackgroundColor => Element?.BackgroundColor ?? Color.Default;
}
}