You got a couple options to achieve your requirement.
- Tweak the library to add a
Margin
property to Icon
and submit a pull request
MahApps.Metro is on Git, you could just fork it and tweak the Title bar icon with a Margin
property as you desire.
Currently TitleBar Icon does not seem to have this property and starts from the edges based on it's xaml definition.
<Grid x:Name="PART_TitleBar" Background="Transparent"
Height="{Binding TitlebarHeight, Mode=OneWay, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Controls:MetroWindow}}}"
Visibility="{TemplateBinding ShowTitleBar, Converter={StaticResource BooleanToVisibilityConverter}}"
Grid.Column="0">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="auto" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<Image Visibility="{TemplateBinding ShowIconOnTitleBar, Converter={StaticResource BooleanToVisibilityConverter}}"
Source="{TemplateBinding Icon}"
RenderOptions.EdgeMode="Aliased"
RenderOptions.BitmapScalingMode="HighQuality" />
You could then submit a pull request to allow the authors to integrate it into the main library if they reckon it's a nice feature.
- Easier option: Tweak your Title bar Icon image with a transparent padding
In the source for your Title bar image add a transparent padding. Something like:
Now when you use this as the Icon
in your MetroWindow
you should have an output like: