I started using MahApps.Metro just yesterday, and I can't figure out how to get application icon to show as window icon on a window (or better, all of them). Here in the example window icon is included, but I can't seem to get it. When I use
ShowIconOnTitleBar="True"
it doesn't do anything. What am I doing wrong?
You need to set the Icon
property like this example (taken from the Mahapps demo app) :
<Controls:MetroWindow x:Class="MetroDemo.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:Controls="clr-namespace:MahApps.Metro.Controls;assembly=MahApps.Metro"
Title="MahApps.Metro - Demo Application"
Width="960" Height="600"
Icon="mahapps.metro.logo2.ico"
ShowIconOnTitleBar="True"
ShowTitleBar="True">
<Grid />
</Controls:MetroWindow>
I suggest that you download the source code for the Mahapps project, which also contains the source for a demo app (too bad they don't advertise it on their website), it's great for examples. You can find it on GitHub here
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