各种 RibbonControls 的 ControlTemplate 具有在控件组中添加右侧边框的触发器(即 IsInControlGroup 属性为 True):
<!-- IsInControlGroup -->
<Trigger Property="IsInControlGroup" Value="True">
<Setter TargetName="OuterBorder" Property="BorderBrush" Value="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=Ribbon.BorderBrush}" />
<Setter TargetName="OuterBorder" Property="BorderThickness" Value="0,0,1,0" />
<Setter TargetName="OuterBorder" Property="CornerRadius" Value="0" />
<Setter TargetName="InnerBorder" Property="CornerRadius" Value="0" />
</Trigger>
我编辑了这一行:
<Setter TargetName="OuterBorder" Property="BorderThickness" Value="0,0,1,0" />
至 :
<Setter TargetName="OuterBorder" Property="BorderThickness" Value="0,0,0,0" />
或者,您可以删除整个触发器。
注意:我的位于 ControlsLibrary 项目的 Themes 文件夹中的 Generic.xaml 中,顶部有以下内容
<!--=================================================================
Copyright (C) Microsoft Corporation. All rights reserved.
This file was generated from individual xaml files found
in wcp\themes\xaml\, please do not edit it directly.
To generate this file, bcz in Wcp\Themes\Generator and copy
the generated theme files from the output directory to
the corresponding themes\ folder.
To automatically copy the files, set the environment variable
set THEMEXAML_AUTOUPDATE=1
==================================================================-->
因此,您可能需要复制或重新生成。