Browse Source

TextBlock.SetFontFamily fix

pull/1564/head
Benedikt Schroeder 8 years ago
parent
commit
3220e31308
  1. 5
      src/Avalonia.Controls/TextBlock.cs
  2. 2
      src/Avalonia.Visuals/Media/FontFamily.cs

5
src/Avalonia.Controls/TextBlock.cs

@ -4,7 +4,6 @@
using System;
using System.Reactive;
using System.Reactive.Linq;
using Avalonia.Data;
using Avalonia.LogicalTree;
using Avalonia.Media;
using Avalonia.Metadata;
@ -31,7 +30,7 @@ namespace Avalonia.Controls
public static readonly AttachedProperty<FontFamily> FontFamilyProperty =
AvaloniaProperty.RegisterAttached<TextBlock, Control, FontFamily>(
nameof(FontFamily),
defaultValue: new FontFamily("Courier New"),
defaultValue: FontFamily.Default,
inherits: true);
/// <summary>
@ -278,7 +277,7 @@ namespace Avalonia.Controls
/// <param name="control">The control.</param>
/// <param name="value">The property value to set.</param>
/// <returns>The font family.</returns>
public static void SetFontFamily(Control control, string value)
public static void SetFontFamily(Control control, FontFamily value)
{
control.SetValue(FontFamilyProperty, value);
}

2
src/Avalonia.Visuals/Media/FontFamily.cs

@ -10,7 +10,7 @@ namespace Avalonia.Media
{
public class FontFamily
{
internal static FontFamily Default = new FontFamily("Courier New");
public static FontFamily Default => new FontFamily("Courier New");
/// <summary>
/// Initializes a new instance of the <see cref="T:Avalonia.Media.FontFamily" /> class.

Loading…
Cancel
Save