Skip to content

Getting started with controls

Simnico99 edited this page Apr 7, 2023 · 10 revisions

Click here for versions before 5.0.0

Contents

  1. Usage
  2. Result
  3. Usage (Version 4.0 and Earlier)

Usage

  1. Add the ControlsDictionnary and ThemeDictionnary if it wasn't there already
<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"
    StartupUri="MainWindow.xaml">
    <Application.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <mica:ThemeDictionary Theme="Auto" /> <!-- Here -->
                <mica:ControlsDictionary /> <!-- And Here -->
            </ResourceDictionary.MergedDictionaries>
        </ResourceDictionary>
    </Application.Resources>
</Application>
  1. To use the controls just add the following namespace to your Control (Window, Page, Etc)
xmlns:controls="clr-namespace:MicaWP.Controls;assembly=MicaWPF"
  1. Here is an exemple of a Control (MicaTextBox)
<controls:TextBox Height="34" Watermark="Test01" />

Result:

image

Clone this wiki locally