Hi,
On the latest version (this definitely wasn't an issue in the past) there is a 1px margin to the left of the LeftWindowCommands which appears even if no icon is specified. Would it be possible to revert to the old behaviour and not have this 1px margin?
Cheers!
@SkinnySackboy This is caused by the inner Margin of the WindowCommandsItem. This exists since 1.5.0, before it was a 8 pixel gap.
The difference now is, that the Border of the Window is now correct interpreted (this was wrong in 1.5). So in 1.5 you didn't see an additional gap, cause the the inner Margin of the Items are also 1px like the Border. In 1.6 you see now the correct thing. You can override the ItemcontainerStyle for the WindowCommandsItem to remove the inner margin.
I will solve this in the future by using the Padding/Margin properties.
<Style TargetType="{x:Type Controls:WindowCommandsItem}">
<Setter Property="IsTabStop" Value="False" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type Controls:WindowCommandsItem}">
<StackPanel HorizontalAlignment="{Binding HorizontalContentAlignment, Mode=OneWay, RelativeSource={RelativeSource AncestorType={x:Type Controls:WindowCommands}}}"
VerticalAlignment="{Binding VerticalContentAlignment, Mode=OneWay, RelativeSource={RelativeSource AncestorType={x:Type Controls:WindowCommands}}}"
Orientation="Horizontal">
<!-- set the Margin to 0 -->
<ContentPresenter x:Name="PART_ContentPresenter"
Margin="0"
Content="{TemplateBinding Content}"
ContentStringFormat="{TemplateBinding ContentStringFormat}"
ContentTemplate="{TemplateBinding ContentTemplate}"
ContentTemplateSelector="{TemplateBinding ContentTemplateSelector}"
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
<Rectangle x:Name="PART_Separator"
Width="1"
Height="{Binding SeparatorHeight, Mode=OneWay, RelativeSource={RelativeSource AncestorType={x:Type Controls:WindowCommands}}}"
Fill="{Binding Foreground, Mode=OneWay, RelativeSource={RelativeSource AncestorType={x:Type Controls:WindowCommands}}}"
IsHitTestVisible="False"
Opacity="0.25"
SnapsToDevicePixels="True"
UseLayoutRounding="True" />
</StackPanel>
<ControlTemplate.Triggers>
<Trigger Property="IsSeparatorVisible" Value="False">
<Setter TargetName="PART_Separator" Property="Visibility" Value="Collapsed" />
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
Thanks, so you mean in the future I should be able to set the margin directly and it should work?
<mahAppsControls:WindowCommands Margin="0">
Most helpful comment
Thanks, so you mean in the future I should be able to set the margin directly and it should work?
<mahAppsControls:WindowCommands Margin="0">