I am trying to create new WPF application usign MahApps.Metro. I do exactly as described in quick start guide (http://mahapps.com/MahApps.Metro/guides/quick-start.html):
At this point I can run the application, but the window is transparent. Title bar text and buttons are visible (and buttons are not styled), but the background is transparent.
After that I receive an exception on startup:
System.IOException
{"Cannot locate resource 'styles/colours.xaml'."}
Seems as for some reason it cannot find resources in the assembly. But I don't understand why.
from the wiki
'Colours' -> 'Colors'
Yes, we changed all
Colours
toColors
! The naming of the colors were inconsistent so we decided to change the naming. Also the resource dictionary goes fromColours.xaml
toColors.xaml
.
release notes for 0.11.0
<Application x:Class="WpfApplication.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
StartupUri="MainWindow.xaml">
<Application.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Controls.xaml" />
<ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Fonts.xaml" />
<ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Colors.xaml" />
<ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Accents/Blue.xaml" />
<ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Accents/BaseLight.xaml" />
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</Application.Resources>
</Application>
<controls:MetroWindow x:Class="WpfApplication.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:controls="http://metro.mahapps.com/winfx/xaml/controls"
Title="MainWindow"
Height="600"
Width="800">
<Grid>
<!-- now your content -->
</Grid>
</controls:MetroWindow>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With