Reputation:
Icon on button with Icon ressources Metro
I want to add image in my button with the metro pack icon, but i cant add the resources in my App.xaml
I used this command : Install-Package MahApps.Metro.Resources
and added <ResourceDictionary Source="/Resources/Icons.xaml" />
In my App.xaml but this line didnt work, I have an error...
So I cant add my image with <VisualBrush Visual="{StaticResource appbar_add}" />
Source: official documentation But I cant use the icon resource.
Upvotes: 2
Views: 2619
Reputation: 5122
I'm using that package too in my WPF apps (MahApps.Metro), but I can only reference icons using DynamicResource (so, not using StaticResource), for example:
<VisualBrush Stretch="Fill" Visual="{DynamicResource appbar_magnify}" />
Look at the official documentation here
Upvotes: 0
Reputation: 1234
The MahApps.Metro.Resources package does not contain the styles for those circle buttons. Use command Install-Package MahApps.Metro
.
App.xaml:
MainWindow.xaml:
Result:
Upvotes: 2
Reputation: 1234
The Fill property on each path in Icons.xaml references a nonexistent BlackBrush:
You can fix this by replacing "{DynamicResource BlackBrush}" with "Black" or including Colors.xaml in your App.xaml.
Upvotes: 1