Files
Common.Wpf/HtmlTextBlock/TextFragmentStyle.cs
2014-04-30 17:33:21 -04:00

32 lines
830 B
C#

using System.Windows;
using System.Windows.Media;
namespace Common.Wpf.HtmlTextBlock
{
public class TextFragmentStyle
{
public Brush Color { get; set; }
public FontStyle? Style { get; set; }
public FontWeight? Weight { get; set; }
public double? Size { get; set; }
public bool? Underline { get; set; }
public void Apply(TextFragment fragment)
{
if (Color != null)
fragment.Color = Color;
if (Style.HasValue)
fragment.Style = Style.Value;
if (Weight.HasValue)
fragment.Weight = Weight.Value;
if (Size.HasValue)
fragment.Size = Size.Value;
if (Underline.HasValue)
fragment.Underline = Underline.Value;
}
}
}