SkillAgentSearch skills...

MicaWPF

This is a library to make Mica available in WPF.

Install / Use

/learn @Simnico99/MicaWPF
About this skill

Quality Score

0/100

Supported Platforms

Universal

README

<div align="center">

<a href="https://www.nuget.org/packages/MicaWPF/latest">NuGet</a> <a href="https://www.nuget.org/packages/MicaWPF/">NuGet(download)</a> <a href="https://www.codefactor.io/repository/github/simnico99/micawpf/overview/main">CodeFactor</a> <a href="https://dev.azure.com/ZirconCloud/MicaWPF/_build">Azure Pipelines</a><br/> <a href="https://github.com/Simnico99/MicaWPF/graphs/contributors">Contributors</a> <a href="https://github.com/Simnico99/MicaWPF/network/members">Forks</a> <a href="https://github.com/Simnico99/MicaWPF/stargazers">Stargazers</a> <a href="https://github.com/Simnico99/MicaWPF/issues">Issues</a> <a href="https://github.com/Simnico99/MicaWPF/blob/main/LICENSE">License</a>

</div> <!-- PROJECT LOGO --> <br /> <p align="center"> <a href="https://github.com/Simnico99/MicaWPF"> <img src="/Logo/MicaWPFLogo%20-%2080x56.png" alt="Logo" width="80" height="56"> </a> <h3 align="center">MicaWPF</h3> <p align="center"> This is a library to make Mica available in WPF. <br /> <a href="https://github.com/Simnico99/MicaWPF/wiki"><strong>Explore the docs »</strong></a> <br /> <br /> <a href="https://github.com/Simnico99/MicaWPF/tree/main/src/MicaWPF.Demo">View Demo</a> · <a href="https://github.com/Simnico99/MicaWPF/issues/new?assignees=Simnico99&labels=bug%2CNeeds-Triage&projects=&template=bug_report.yaml&title=%5BBug%5D%3A+">Report Bug</a> · <a href="https://github.com/Simnico99/MicaWPF/issues/new?assignees=Simnico99&labels=enhancement%2CNeeds-Triage&projects=&template=feature_request.yaml&title=%5BFeature+Request%5D%3A+">Request Feature</a> </p> </p> <!-- TABLE OF CONTENTS --> <details> <summary>Table of Contents</summary> <ol> <li> <a href="#about-the-project">About The Project</a> <ul> <li><a href="#built-with">Built With</a></li> </ul> </li> <li> <a href="#getting-started">Getting Started</a> <ul> <li><a href="#installation">Installation</a></li> <li><a href="#usage">Usage</a></li> </ul> </li> <li><a href="#roadmap">Roadmap</a></li> <li><a href="#contributing">Contributing</a></li> <li><a href="#license">License</a></li> <li><a href="#contact">Contact</a></li> <li><a href="#acknowledgements">Acknowledgements</a></li> </ol> </details> <!-- ABOUT THE PROJECT -->

About The Project

The project aim to mimic Windows 11 Mica Behaviors in a WPF application since WPF is a well established framework and also it aims to gracefully revert to a Windows 10 style that is kinda similar to the Dark and Light mode of Windows 11 to keep inline with the style.

Windows 11<br/> Mica_Exemple

Windows 10<br/> Supports falling back to dark or light theme on Windows 10. image<br/>

Here are some exemple controls: image 74d755e6e4ae5fddb0b5fe64d2869e81 42cbe5065b53c4e8369f2f4bbeb1311a image

Built With

<!-- GETTING STARTED -->

Getting Started

To get a local copy up and running follow these simple steps.

Installation

NuGet

  1. Download via the Nuget package manager or use the NuGet Command line.
    Install-Package MicaWPF (or MicaWPF.Lite)
    
  2. If you have used the NuGet Command line restore de packages.
    nuget restore MicaWPF.sln
    

Using source

  1. Clone the repo.
    git clone https://github.com/Simnico99/MicaWPF.git
    
  2. Restore NuGet packages.
    nuget restore MicaWPF.sln
    
  3. Add the project in your project reference.
<!-- USAGE EXAMPLES -->

Usage

(Works for both MicaWPF and MicaWPF.Lite)

  1. To start Change the <Window><Window/> for <controls:MicaWindow></controls:MicaWindow>.
  2. Add the namespace by adding xmlns:controls="clr-namespace:MicaWPF.Controls;assembly=MicaWPF" (For MicaWPF.Lite xmlns:controls="clr-namespace:MicaWPF.Lite.Controls;assembly=MicaWPF.Lite").

Here is an exemple:

<controls:MicaWindow  
        x:Class="MicaWPF.DesktopApp.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        xmlns:local="clr-namespace:MicaWPF.DesktopApp"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        xmlns:controls="clr-namespace:MicaWPF.Controls;assembly=MicaWPF"
        mc:Ignorable="d"
        Title="MainWindow" 
        Height="450" 
        Width="800" >
    <Grid>

    </Grid>
</controls:MicaWindow>
  1. You need to add <mica:ThemeDictionary Theme="Auto" /> and <mica:ControlsDictionary /> to your App.xaml resources.

Here is an exemple:

<Application
    x:Class="MicaWPF.DesktopApp.App"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:mica="clr-namespace:MicaWPF.Styles;assembly=MicaWPF" <!-- For the lite version: clr-namespace:MicaWPF.Styles;assembly=MicaWPF.Lite -->
    StartupUri="MainWindow.xaml">
    <Application.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <mica:ThemeDictionary DesignModeTheme="Dark" Theme="Auto" /> <!-- And Here (You can change to Light, Dark or auto here) -->
                <!-- <mica:ThemeDictionary />  works too-->
		<mica:ControlsDictionary /> <!-- This is mandatory -->
            </ResourceDictionary.MergedDictionaries>
        </ResourceDictionary>
    </Application.Resources>
</Application>

(Does not apply to MicaWPF.Lite) Now get into your Window code:

  1. Add the namespace using MicaWPF.Controls;.
  2. Change the Window inherited class to MicaWindow.

Here is an exemple of what it might look like using .NET9:

using MicaWPF.Controls;

namespace MicaWPF.DesktopApp;

public partial class MainWindow : MicaWindow
{
    public MainWindow()
    {
        InitializeComponent();
    }
}

Note For .Net6.0, .Net7.0, .Net8.0 and .Net9.0

You will need to change your CSPROJ to include the windows build after the netx.0-windows. Here is an exemple using .Net9.0 just change the net9 for net8, net7 or net6 for the other versions.

MicaWPF:

<TargetFramework>net9.0-windows</TargetFramework>
<TargetPlatformMinVersion>7.0</TargetPlatformMinVersion>

MicaWPF.Lite:

<TargetFramework>net9.0-windows</TargetFramework>

For more examples, please refer to the Documentation

<!-- ROADMAP -->

Roadmap

See the open issues for a list of proposed features (and known issues).

<!-- CONTRIBUTING -->

Contributing

Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are greatly appreciated.

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

FAQ

Q: What is the difference between MicaWPF and MicaWPF.Lite?

A: The MicaWPF.Lite Nuget package only contains the MicaWindow code<br/> and a trim down accent color detection so it takes way less space.<br /> Take note that accent colors are not as accurate on the light version.

Q: The title bar buttons are weird, how do I fix?

A: Apply TitleBarType="WinUI" like this:

<mica:MicaWindow [your code...]
TitleBarType="WinUI"
>
[other code...]
</mica:MicaWindow>
<!-- LICENSE -->

License

Distributed under the MIT License. See LICENSE for more information.

<!-- CONTACT -->

Contact

Simnico99 - @TheSimnico99

Project Link: https://github.com/Simnico99

<!-- ACKNOWLEDGEMENTS -->

Acknowledgements

Alt

View on GitHub
GitHub Stars257
CategoryDevelopment
Updated9h ago
Forks12

Languages

C#

Security Score

100/100

Audited on Mar 25, 2026

No findings