Skip to content

Legacy Compatibility mode

Simnico99 edited this page Apr 9, 2022 · 5 revisions

Basic Explanation

This way should only be used when using a 3rd party window or for compatibility reasons with your custom window style etc. The recommanded way is explained here: Quick Start.

Usage

MainWindow.xaml.cs

using System.Windows;
using MicaWPF.Helpers;

namespace MicaWPF.DesktopApp;

public partial class MainWindow : Window
{
    public MainWindow()
    {
        InitializeComponent();
        Loaded += MainWindow_Loaded; //You should only enable it when the window is loaded (Add this line)
    }

    private void MainWindow_Loaded(object sender, RoutedEventArgs e)  //Add this entire method or add the method EnableMica to your Loaded event method.
    {
        this.EnableMica();
    }
}

Result

Windows 11:
image

Windows 10:
image