Skip to content

Commit

Permalink
Move XamlDisplayAvaloniaEdit to separate file
Browse files Browse the repository at this point in the history
  • Loading branch information
SKProCH committed Oct 9, 2023
1 parent eec0ae3 commit 2aef37e
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 13 deletions.
17 changes: 17 additions & 0 deletions ShowMeTheXaml.Avalonia.AvaloniaEdit/XamlDisplayAvaloniaEdit.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
using Avalonia;
using TextMateSharp.Grammars;

namespace ShowMeTheXaml.Avalonia.AvaloniaEdit;

public static class XamlDisplayAvaloniaEdit {
public static readonly AttachedProperty<ThemeName> CodeHighlightThemeNameProperty =
AvaloniaProperty.RegisterAttached<XamlDisplay, ThemeName>("CodeHighlightThemeName", typeof(XamlDisplayAvaloniaEdit));

public static ThemeName GetCodeHighlightThemeName(XamlDisplay element) {
return element.GetValue(CodeHighlightThemeNameProperty);
}

public static void SetCodeHighlightThemeName(XamlDisplay element, ThemeName value) {
element.SetValue(CodeHighlightThemeNameProperty, value);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -39,17 +39,4 @@ protected override void OnDetachedFromVisualTree() {
_disposable?.Dispose();
_textMateInstallation?.Dispose();
}
}

public static class XamlDisplayAvaloniaEdit {
public static readonly AttachedProperty<ThemeName> CodeHighlightThemeNameProperty =
AvaloniaProperty.RegisterAttached<XamlDisplay, ThemeName>("CodeHighlightThemeName", typeof(XamlDisplayAvaloniaEdit));

public static ThemeName GetCodeHighlightThemeName(XamlDisplay element) {
return element.GetValue(CodeHighlightThemeNameProperty);
}

public static void SetCodeHighlightThemeName(XamlDisplay element, ThemeName value) {
element.SetValue(CodeHighlightThemeNameProperty, value);
}
}

0 comments on commit 2aef37e

Please sign in to comment.