Skip to content

Legacy Compatibility mode

Simnico99 edited this page Jul 27, 2022 · 5 revisions

Contents

  1. Basic Explanation
  2. Usage
  3. Results

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.EnableBackdrop();
    }
}

Results

Windows 11:
image

Windows 10:
image