Skip to content
This repository has been archived by the owner on Sep 2, 2021. It is now read-only.

Working with WPF 4.0

Koen Zwikstra edited this page Feb 9, 2015 · 1 revision

MUI targets both WPF 4.0 and 4.5. The download package contains assemblies for both WPF versions. When you use NuGet, the correct WPF version is automatically selected based on the target framework of your project. The Visual Studio 2012 templates however only work for WPF 4.5.

There is one workaround required in WPF 4.0 for control styling to work correctly. Make sure you add an empty style for a rectangle in your App.xaml.

<Application.Resources>
  <ResourceDictionary>
    <!-- WPF 4.0 workaround -->
    <Style TargetType="{x:Type Rectangle}" />
    <!-- end of workaround -->
    <ResourceDictionary.MergedDictionaries>
      <ResourceDictionary Source="/FirstFloor.ModernUI;component/Assets/ModernUI.xaml" />
      <ResourceDictionary Source="/FirstFloor.ModernUI;component/Assets/ModernUI.Light.xaml"/>
    </ResourceDictionary.MergedDictionaries>
  </ResourceDictionary>
</Application.Resources>