diff options
author | Kangho Hur <kangho.hur@samsung.com> | 2017-01-24 14:09:11 +0900 |
---|---|---|
committer | Kangho Hur <kangho.hur@samsung.com> | 2017-04-24 13:36:52 +0900 |
commit | b4d15c3fa75dd0bdf2600f80c7623adf06ba84e0 (patch) | |
tree | 7fb6e1e6c53122dfd5953d3dad0646e713ffdca7 /Xamarin.Forms.Core | |
parent | bb9c8517a890e4a9d1a96e1f99bc9123dcc8a0a6 (diff) | |
download | xamarin-forms-b4d15c3fa75dd0bdf2600f80c7623adf06ba84e0.tar.gz xamarin-forms-b4d15c3fa75dd0bdf2600f80c7623adf06ba84e0.tar.bz2 xamarin-forms-b4d15c3fa75dd0bdf2600f80c7623adf06ba84e0.zip |
Add FontWeight for Label and Entry
- This change is for the referernce application (Clock) to follow UX guideline. (Internal only).
- We will improve design and implementation of this APIs in the next release, if requred.
Change-Id: Ifac91174a5859adecc9ec6bff1a1d568512ee70b
Diffstat (limited to 'Xamarin.Forms.Core')
4 files changed, 81 insertions, 0 deletions
diff --git a/Xamarin.Forms.Core/PlatformConfiguration/TizenSpecific/Entry.cs b/Xamarin.Forms.Core/PlatformConfiguration/TizenSpecific/Entry.cs new file mode 100644 index 00000000..c84dcc36 --- /dev/null +++ b/Xamarin.Forms.Core/PlatformConfiguration/TizenSpecific/Entry.cs @@ -0,0 +1,30 @@ +namespace Xamarin.Forms.PlatformConfiguration.TizenSpecific +{ + using FormsElement = Forms.Entry; + + public static class Entry + { + public static readonly BindableProperty FontWeightProperty = BindableProperty.Create("FontWeight", typeof(FontWeight), typeof(FormsElement), FontWeight.None); + + public static FontWeight GetFontWeight(BindableObject element) + { + return (FontWeight)element.GetValue(FontWeightProperty); + } + + public static void SetFontWeight(BindableObject element, FontWeight weight) + { + element.SetValue(FontWeightProperty, weight); + } + + public static FontWeight GetFontWeight(this IPlatformElementConfiguration<Tizen, FormsElement> config) + { + return GetFontWeight(config.Element); + } + + public static IPlatformElementConfiguration<Tizen, FormsElement> SetFontWeight(this IPlatformElementConfiguration<Tizen, FormsElement> config, FontWeight weight) + { + SetFontWeight(config.Element, weight); + return config; + } + } +} diff --git a/Xamarin.Forms.Core/PlatformConfiguration/TizenSpecific/FontWeight.cs b/Xamarin.Forms.Core/PlatformConfiguration/TizenSpecific/FontWeight.cs new file mode 100644 index 00000000..8838bc07 --- /dev/null +++ b/Xamarin.Forms.Core/PlatformConfiguration/TizenSpecific/FontWeight.cs @@ -0,0 +1,18 @@ +namespace Xamarin.Forms.PlatformConfiguration.TizenSpecific +{ + public enum FontWeight + { + None, + Normal, + Thin, + UltraLight, + Light, + Book, + Medium, + SemiBold, + Bold, + UltraBold, + Black, + ExtraBlack + } +} diff --git a/Xamarin.Forms.Core/PlatformConfiguration/TizenSpecific/Label.cs b/Xamarin.Forms.Core/PlatformConfiguration/TizenSpecific/Label.cs new file mode 100644 index 00000000..d95daa83 --- /dev/null +++ b/Xamarin.Forms.Core/PlatformConfiguration/TizenSpecific/Label.cs @@ -0,0 +1,30 @@ +namespace Xamarin.Forms.PlatformConfiguration.TizenSpecific +{ + using FormsElement = Forms.Label; + + public static class Label + { + public static readonly BindableProperty FontWeightProperty = BindableProperty.Create("FontWeight", typeof(FontWeight), typeof(FormsElement), FontWeight.None); + + public static FontWeight GetFontWeight(BindableObject element) + { + return (FontWeight)element.GetValue(FontWeightProperty); + } + + public static void SetFontWeight(BindableObject element, FontWeight weight) + { + element.SetValue(FontWeightProperty, weight); + } + + public static FontWeight GetFontWeight(this IPlatformElementConfiguration<Tizen, FormsElement> config) + { + return GetFontWeight(config.Element); + } + + public static IPlatformElementConfiguration<Tizen, FormsElement> SetFontWeight(this IPlatformElementConfiguration<Tizen, FormsElement> config, FontWeight weight) + { + SetFontWeight(config.Element, weight); + return config; + } + } +} diff --git a/Xamarin.Forms.Core/Xamarin.Forms.Core.csproj b/Xamarin.Forms.Core/Xamarin.Forms.Core.csproj index bca78f26..80d03e17 100644 --- a/Xamarin.Forms.Core/Xamarin.Forms.Core.csproj +++ b/Xamarin.Forms.Core/Xamarin.Forms.Core.csproj @@ -110,11 +110,14 @@ <Compile Include="PlatformConfiguration\iOSSpecific\UIStatusBarAnimation.cs" /> <Compile Include="PlatformConfiguration\iOSSpecific\UpdateMode.cs" /> <Compile Include="PlatformConfiguration\iOSSpecific\VisualElement.cs" /> + <Compile Include="PlatformConfiguration\TizenSpecific\Entry.cs" /> + <Compile Include="PlatformConfiguration\TizenSpecific\Label.cs" /> <Compile Include="PlatformConfiguration\TizenSpecific\Image.cs" /> <Compile Include="PlatformConfiguration\TizenSpecific\ProgressBar.cs" /> <Compile Include="PlatformConfiguration\TizenSpecific\Button.cs" /> <Compile Include="PlatformConfiguration\TizenSpecific\ButtonStyle.cs" /> <Compile Include="PlatformConfiguration\TizenSpecific\Switch.cs" /> + <Compile Include="PlatformConfiguration\TizenSpecific\FontWeight.cs" /> <Compile Include="PlatformConfiguration\TizenSpecific\SwitchStyle.cs" /> <Compile Include="PlatformConfiguration\WindowsSpecific\MasterDetailPage.cs" /> <Compile Include="PlatformConfiguration\WindowsSpecific\CollapseStyle.cs" /> |