Table of Contents

Property VisualThemeType

Namespace
Alternet.Editor.Wpf
Assembly
Alternet.Editor.Wpf.v9.dll

VisualThemeType

Gets or sets visual theme type for the editor.

public VisualThemeType VisualThemeType { get; set; }

Property Value

VisualThemeType

Examples

Here is how to set a VisualThemeType different VisualThemeType from the C# code:

public partial class MainWindow : Window
{
    private void Window_Loaded(object sender, RoutedEventArgs e)
    {
        var textEditor = new Alternet.Editor.Wpf.TextEditor();
        textEditor.VisualThemeType = Alternet.Editor.Wpf.VisualThemeType.Custom;
        textEditor.VisualTheme = CustomVisualTheme.Instance;
    }
}

public class CustomVisualTheme
    : Alternet.Editor.Wpf.StandardVisualTheme
{
    public static readonly CustomVisualTheme Instance = new CustomVisualTheme();

    public CustomVisualTheme()
        : base("Custom")
    {
    }

    protected override VisualThemeColors GetColors()
    {
        var colors = DarkVisualTheme.Instance.Colors.Clone();
        colors.Reswords = System.Drawing.Color.Red;
        colors.WindowBackground = System.Drawing.Color.FromArgb(40, 40, 40);
        return colors;
    }
}

Here is how to set a VisualThemeType different VisualThemeType from the Visual Basic code:

Partial Public Class MainWindow
    Private Sub Window_Loaded(ByVal sender As Object, ByVal e As RoutedEventArgs)
        Dim textEditor = New Alternet.Editor.Wpf.TextEditor()
        textEditor.VisualThemeType = Alternet.Editor.VisualThemeType.Custom
        textEditor.VisualTheme = CustomVisualTheme.Instance
    End Sub
End Class

Public Class CustomVisualTheme
    Inherits Alternet.Editor.Wpf.StandardVisualTheme

    Public Shared ReadOnly Instance As CustomVisualTheme = New CustomVisualTheme()

    Public Sub New()
        MyBase.New("Custom")
    End Sub

    Protected Overrides Function GetColors() As VisualThemeColors
        Dim Colors As VisualThemeColors = DarkVisualTheme.Instance.Colors.Clone()
        Colors.Reswords = System.Drawing.Color.Red
        Colors.WindowBackground = System.Drawing.Color.FromArgb(40, 40, 40)
        Return Colors
    End Function
End Class

Remarks

Gets or sets visual theme type that specifies fonts and colors for all TextEditor visual elements and dialog boxes.

Possible values are None, Light, Dark, and Custom. Custom type allows specifying a user-defined set of fonts and colors.