diff --git a/ILSpy/TextView/DecompilerTextView.cs b/ILSpy/TextView/DecompilerTextView.cs
index 1864f31e2..c3fb79724 100644
--- a/ILSpy/TextView/DecompilerTextView.cs
+++ b/ILSpy/TextView/DecompilerTextView.cs
@@ -129,15 +129,6 @@ namespace ICSharpCode.ILSpy.TextView
textEditor.TextArea.TextView.BackgroundRenderers.Add(textMarkerService);
textEditor.TextArea.TextView.LineTransformers.Add(textMarkerService);
- textEditor.SetResourceReference(FoldingMargin.FoldingMarkerBackgroundBrushProperty,
- SystemColors.WindowBrushKey);
- textEditor.SetResourceReference(FoldingMargin.SelectedFoldingMarkerBackgroundBrushProperty,
- SystemColors.WindowBrushKey);
- textEditor.SetResourceReference(FoldingMargin.FoldingMarkerBrushProperty,
- SystemColors.ControlDarkBrushKey);
- textEditor.SetResourceReference(FoldingMargin.SelectedFoldingMarkerBrushProperty,
- SystemColors.ControlTextBrushKey);
-
ContextMenuProvider.Add(this);
this.DataContextChanged += DecompilerTextView_DataContextChanged;
diff --git a/ILSpy/TextView/DecompilerTextView.xaml b/ILSpy/TextView/DecompilerTextView.xaml
index 4fc3e0802..6bd88c9bb 100644
--- a/ILSpy/TextView/DecompilerTextView.xaml
+++ b/ILSpy/TextView/DecompilerTextView.xaml
@@ -2,7 +2,8 @@
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:properties="clr-namespace:ICSharpCode.ILSpy.Properties"
- xmlns:ae="clr-namespace:ICSharpCode.AvalonEdit;assembly=ICSharpCode.AvalonEdit">
+ xmlns:ae="clr-namespace:ICSharpCode.AvalonEdit;assembly=ICSharpCode.AvalonEdit"
+ xmlns:folding="clr-namespace:ICSharpCode.AvalonEdit.Folding;assembly=ICSharpCode.AvalonEdit">
@@ -11,7 +12,12 @@
+ Foreground="{DynamicResource {x:Static SystemColors.InfoTextBrushKey}}"
+ folding:FoldingMargin.FoldingMarkerBackgroundBrush="{DynamicResource {x:Static SystemColors.WindowBrushKey}}"
+ folding:FoldingMargin.SelectedFoldingMarkerBackgroundBrush="{DynamicResource {x:Static SystemColors.WindowBrushKey}}"
+ folding:FoldingMargin.FoldingMarkerBrush="{DynamicResource {x:Static SystemColors.ControlDarkBrushKey}}"
+ folding:FoldingMargin.SelectedFoldingMarkerBrush="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"
+ >