public static class Entry
{
- public static readonly BindableProperty FontWeightProperty = BindableProperty.Create("FontWeight", typeof(FontWeight), typeof(FormsElement), FontWeight.None);
+ public static readonly BindableProperty FontWeightProperty = BindableProperty.Create("FontWeight", typeof(string), typeof(FormsElement), FontWeight.None);
- public static FontWeight GetFontWeight(BindableObject element)
+ public static string GetFontWeight(BindableObject element)
{
- return (FontWeight)element.GetValue(FontWeightProperty);
+ return (string)element.GetValue(FontWeightProperty);
}
- public static void SetFontWeight(BindableObject element, FontWeight weight)
+ public static void SetFontWeight(BindableObject element, string weight)
{
element.SetValue(FontWeightProperty, weight);
}
- public static FontWeight GetFontWeight(this IPlatformElementConfiguration<Tizen, FormsElement> config)
+ public static string GetFontWeight(this IPlatformElementConfiguration<Tizen, FormsElement> config)
{
return GetFontWeight(config.Element);
}
- public static IPlatformElementConfiguration<Tizen, FormsElement> SetFontWeight(this IPlatformElementConfiguration<Tizen, FormsElement> config, FontWeight weight)
+ public static IPlatformElementConfiguration<Tizen, FormsElement> SetFontWeight(this IPlatformElementConfiguration<Tizen, FormsElement> config, string weight)
{
SetFontWeight(config.Element, weight);
return config;
namespace Xamarin.Forms.PlatformConfiguration.TizenSpecific
{
- public enum FontWeight
+ public static class FontWeight
{
- None,
- Normal,
- Thin,
- UltraLight,
- Light,
- Book,
- Medium,
- SemiBold,
- Bold,
- UltraBold,
- Black,
- ExtraBlack
+ public const string None = "None";
+ public const string Normal = "Normal";
+ public const string Thin = "Thin";
+ public const string UltraLight = "UltraLight";
+ public const string Light = "Light";
+ public const string Book = "Book";
+ public const string Medium = "Medium";
+ public const string SemiBold = "SemiBold";
+ public const string Bold = "Bold";
+ public const string UltraBold = "UltraBold";
+ public const string Black= "Black";
+ public const string ExtraBlack= "ExtraBlack";
}
}
public static class Label
{
- public static readonly BindableProperty FontWeightProperty = BindableProperty.Create("FontWeight", typeof(FontWeight), typeof(FormsElement), FontWeight.None);
+ public static readonly BindableProperty FontWeightProperty = BindableProperty.Create("FontWeight", typeof(string), typeof(FormsElement), FontWeight.None);
- public static FontWeight GetFontWeight(BindableObject element)
+ public static string GetFontWeight(BindableObject element)
{
- return (FontWeight)element.GetValue(FontWeightProperty);
+ return (string)element.GetValue(FontWeightProperty);
}
- public static void SetFontWeight(BindableObject element, FontWeight weight)
+ public static void SetFontWeight(BindableObject element, string weight)
{
element.SetValue(FontWeightProperty, weight);
}
- public static FontWeight GetFontWeight(this IPlatformElementConfiguration<Tizen, FormsElement> config)
+ public static string GetFontWeight(this IPlatformElementConfiguration<Tizen, FormsElement> config)
{
return GetFontWeight(config.Element);
}
- public static IPlatformElementConfiguration<Tizen, FormsElement> SetFontWeight(this IPlatformElementConfiguration<Tizen, FormsElement> config, FontWeight weight)
+ public static IPlatformElementConfiguration<Tizen, FormsElement> SetFontWeight(this IPlatformElementConfiguration<Tizen, FormsElement> config, string weight)
{
SetFontWeight(config.Element, weight);
return config;
/// Gets or sets the font weight for the text.
/// </summary>
/// <value>The weight of the font.</value>
- public FontWeight FontWeight
+ public string FontWeight
{
get
{
+++ /dev/null
-namespace Xamarin.Forms.Platform.Tizen.Native
-{
- /// <summary>
- /// Enumerates values that describe options for line braking.
- /// </summary>
- public enum FontWeight
- {
- None,
- Normal,
- Thin,
- UltraLight,
- Light,
- Book,
- Medium,
- SemiBold,
- Bold,
- UltraBold,
- Black,
- ExtraBlack
- }
-}
/// Gets or sets the font weight for the text.
/// </summary>
/// <value>The weight of the font.</value>
- public FontWeight FontWeight
+ public string FontWeight
{
get
{
using System;
using System.Text;
using EColor = ElmSharp.Color;
+using Specific = Xamarin.Forms.PlatformConfiguration.TizenSpecific;
namespace Xamarin.Forms.Platform.Tizen.Native
{
/// <summary>
/// Gets or sets the font weight for the text.
/// </summary>
- public FontWeight FontWeight { get; set; }
+ public string FontWeight { get; set; }
/// <summary>
/// Gets or sets the line break mode for the text.
Text = "";
FontFamily = "";
FontSize = -1;
- FontWeight = FontWeight.None;
+ FontWeight = Specific.FontWeight.None;
FontAttributes = FontAttributes.None;
ForegroundColor = EColor.Default;
BackgroundColor = EColor.Default;
else
{
// FontWeight is only available in case of FontAttributes.Bold is not used.
- switch (FontWeight)
+ if(FontWeight != Specific.FontWeight.None)
{
- case FontWeight.Bold:
- _formattingString.Append("font_weight=Bold ");
- break;
- case FontWeight.SemiBold:
- _formattingString.Append("font_weight=SemiBold ");
- break;
- case FontWeight.UltraBold:
- _formattingString.Append("font_weight=UltraBold ");
- break;
- case FontWeight.Black:
- _formattingString.Append("font_weight=Black ");
- break;
- case FontWeight.ExtraBlack:
- _formattingString.Append("font_weight=ExtraBlack ");
- break;
- case FontWeight.Book:
- _formattingString.Append("font_weight=Book ");
- break;
- case FontWeight.Light:
- _formattingString.Append("font_weight=Light ");
- break;
- case FontWeight.Medium:
- _formattingString.Append("font_weight=Medium ");
- break;
- case FontWeight.Normal:
- _formattingString.Append("font_weight=Normal ");
- break;
- case FontWeight.Thin:
- _formattingString.Append("font_weight=Thin ");
- break;
- case FontWeight.UltraLight:
- _formattingString.Append("font_weight=UltraLight ");
- break;
+ _formattingString.AppendFormat("font_weight={0} ", FontWeight);
}
}
using System;
-using System.ComponentModel;
using EColor = ElmSharp.Color;
-using Xamarin.Forms.PlatformConfiguration.TizenSpecific;
using Specific = Xamarin.Forms.PlatformConfiguration.TizenSpecific.VisualElement;
namespace Xamarin.Forms.Platform.Tizen
void UpdateFontWeight()
{
- var weight = Specific.GetFontWeight(Element);
- Control.FontWeight = ConvertToNativeFontWeight(weight);
- }
-
- Native.FontWeight ConvertToNativeFontWeight(FontWeight weight)
- {
- switch (weight)
- {
- case FontWeight.Bold:
- return Native.FontWeight.Bold;
- case FontWeight.SemiBold:
- return Native.FontWeight.SemiBold;
- case FontWeight.UltraBold:
- return Native.FontWeight.UltraBold;
- case FontWeight.Black:
- return Native.FontWeight.Black;
- case FontWeight.ExtraBlack:
- return Native.FontWeight.ExtraBlack;
- case FontWeight.Book:
- return Native.FontWeight.Book;
- case FontWeight.Light:
- return Native.FontWeight.Light;
- case FontWeight.Medium:
- return Native.FontWeight.Medium;
- case FontWeight.Normal:
- return Native.FontWeight.Normal;
- case FontWeight.Thin:
- return Native.FontWeight.Thin;
- case FontWeight.UltraLight:
- return Native.FontWeight.UltraLight;
- default:
- return Native.FontWeight.None;
- }
+ Control.FontWeight = Specific.GetFontWeight(Element);
}
}
}
-using Xamarin.Forms.PlatformConfiguration.TizenSpecific;
-
using EColor = ElmSharp.Color;
using Specific = Xamarin.Forms.PlatformConfiguration.TizenSpecific.Label;
void UpdateFormattedText()
{
- if(Element.FormattedText != null)
+ if (Element.FormattedText != null)
Control.FormattedText = ConvertFormattedText(Element.FormattedText);
}
void UpdateFontWeight()
{
- var weight = Specific.GetFontWeight(Element);
-
- Control.FontWeight = ConvertToNativeFontWeight(weight);
+ Control.FontWeight = Specific.GetFontWeight(Element);
}
Native.LineBreakMode ConvertToNativeLineBreakMode(LineBreakMode mode)
return Native.LineBreakMode.WordWrap;
}
}
-
- Native.FontWeight ConvertToNativeFontWeight(FontWeight weight)
- {
- switch (weight)
- {
- case FontWeight.Bold:
- return Native.FontWeight.Bold;
- case FontWeight.SemiBold:
- return Native.FontWeight.SemiBold;
- case FontWeight.UltraBold:
- return Native.FontWeight.UltraBold;
- case FontWeight.Black:
- return Native.FontWeight.Black;
- case FontWeight.ExtraBlack:
- return Native.FontWeight.ExtraBlack;
- case FontWeight.Book:
- return Native.FontWeight.Book;
- case FontWeight.Light:
- return Native.FontWeight.Light;
- case FontWeight.Medium:
- return Native.FontWeight.Medium;
- case FontWeight.Normal:
- return Native.FontWeight.Normal;
- case FontWeight.Thin:
- return Native.FontWeight.Thin;
- case FontWeight.UltraLight:
- return Native.FontWeight.UltraLight;
- default:
- return Native.FontWeight.None;
- }
- }
}
}
<Compile Include="Native\Keyboard.cs" />
<Compile Include="Native\Label.cs" />
<Compile Include="Native\LayoutEventArgs.cs" />
- <Compile Include="Native\FontWeight.cs" />
<Compile Include="Native\LineBreakMode.cs" />
<Compile Include="Native\ListView.cs" />
<Compile Include="Native\MasterDetailPage.cs" />