Skip to content

Commit aaeb7b7

Browse files
committed
Add platform-specific handling for FontWeight during deserialization in XshdColor
1 parent 6d24366 commit aaeb7b7

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

ICSharpCode.AvalonEdit/Highlighting/Xshd/XshdColor.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,11 @@ protected XshdColor(SerializationInfo info, StreamingContext context)
9898
this.Foreground = (HighlightingBrush)info.GetValue("Foreground", typeof(HighlightingBrush));
9999
this.Background = (HighlightingBrush)info.GetValue("Background", typeof(HighlightingBrush));
100100
if (info.GetBoolean("HasWeight"))
101-
this.FontWeight = System.Windows.FontWeight.FromOpenTypeWeight(info.GetInt32("Weight"));
101+
#if WINDOWS_APP_SDK
102+
this.FontWeight = global::Windows.UI.Text.FontWeight.FromOpenTypeWeight(info.GetInt32("Weight"));
103+
#else
104+
this.FontWeight = System.Windows.FontWeight.FromOpenTypeWeight(info.GetInt32("Weight"));
105+
#endif
102106
if (info.GetBoolean("HasStyle"))
103107
this.FontStyle = (FontStyle?)new FontStyleConverter().ConvertFromInvariantString(info.GetString("Style"));
104108
this.ExampleText = info.GetString("ExampleText");

0 commit comments

Comments
 (0)