diff options
author | Stephane Delcroix <stephane@delcroix.org> | 2017-03-03 09:16:04 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-03-03 09:16:04 +0100 |
commit | d9ef5525b441375b8d127b6b006b97615b37dcdf (patch) | |
tree | 00ef649aefc5b68feeadef77e94d34a66a5ee33a /Xamarin.Forms.Core/Editor.cs | |
parent | 62cdb35a0bcdd76414ec01501de0ed3f7227acab (diff) | |
download | xamarin-forms-d9ef5525b441375b8d127b6b006b97615b37dcdf.tar.gz xamarin-forms-d9ef5525b441375b8d127b6b006b97615b37dcdf.tar.bz2 xamarin-forms-d9ef5525b441375b8d127b6b006b97615b37dcdf.zip |
[Core] Share BP across IFontElement implementors (#783)
* [Core] Share BP accross IFontElement implementors
* make sure the converter is used
Diffstat (limited to 'Xamarin.Forms.Core/Editor.cs')
-rw-r--r-- | Xamarin.Forms.Core/Editor.cs | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/Xamarin.Forms.Core/Editor.cs b/Xamarin.Forms.Core/Editor.cs index 92a6b9df..66c5caa7 100644 --- a/Xamarin.Forms.Core/Editor.cs +++ b/Xamarin.Forms.Core/Editor.cs @@ -13,12 +13,11 @@ namespace Xamarin.Forms editor.TextChanged(editor, new TextChangedEventArgs((string)oldValue, (string)newValue)); }); - public static readonly BindableProperty FontFamilyProperty = BindableProperty.Create("FontFamily", typeof(string), typeof(Editor), default(string)); + public static readonly BindableProperty FontFamilyProperty = FontElement.FontFamilyProperty; - public static readonly BindableProperty FontSizeProperty = BindableProperty.Create("FontSize", typeof(double), typeof(Editor), -1.0, - defaultValueCreator: bindable => Device.GetNamedSize(NamedSize.Default, (Editor)bindable)); + public static readonly BindableProperty FontSizeProperty = FontElement.FontSizeProperty; - public static readonly BindableProperty FontAttributesProperty = BindableProperty.Create("FontAttributes", typeof(FontAttributes), typeof(Editor), FontAttributes.None); + public static readonly BindableProperty FontAttributesProperty = FontElement.FontAttributesProperty; public static readonly BindableProperty TextColorProperty = BindableProperty.Create("TextColor", typeof(Color), typeof(Editor), Color.Default); readonly Lazy<PlatformConfigurationRegistry<Editor>> _platformConfigurationRegistry; @@ -54,6 +53,21 @@ namespace Xamarin.Forms set { SetValue(FontSizeProperty, value); } } + void IFontElement.OnFontFamilyChanged(string oldValue, string newValue) + { + } + + void IFontElement.OnFontSizeChanged(double oldValue, double newValue) + { + } + + double IFontElement.FontSizeDefaultValueCreator() => + Device.GetNamedSize(NamedSize.Default, (Editor)this); + + void IFontElement.OnFontAttributesChanged(FontAttributes oldValue, FontAttributes newValue) + { + } + public event EventHandler Completed; public event EventHandler<TextChangedEventArgs> TextChanged; |