Skip to content

Quick start

Simnico99 edited this page Apr 8, 2022 · 13 revisions

Here is a really quick start to get you ready for using the new Mica material in your WPF app.

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

Here is an exemple:

<mica: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:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        xmlns:local="clr-namespace:MicaWPF.DesktopApp"
        mc:Ignorable="d"
        Title="MainWindow" 
        Height="450" 
        Width="800"
        xmlns:mica="clr-namespace:MicaWPF.Controls;assembly=MicaWPF" >
    <Grid>

    </Grid>
</mica:MicaWindow>

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 .NET6:

using MicaWPF.Controls;

namespace MicaWPF.DesktopApp;

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