在我的 WPF 应用程序中,我在整个应用程序上都应用了一些购买的网格主题,需要一个 CR 才能修改每个模块/屏幕的这个主题,修改范围将是画笔、颜色和样式“使用 BasedOn”...因此,如果我在某些模板内部定义/使用了画笔,如何在本地模块 xaml 中覆盖它,而无需再次复制整个模板以及关于画笔和颜色是否足以在本地 xaml 中使用相同的键再次重新定义它们
这是我要修改的带有画笔的控制模板:
<ControlTemplate x:Key="tableViewColumnManagerRowTemplate"
TargetType="xcdg:ColumnManagerRow">
<ControlTemplate.Resources>
<xcdg:ThicknessConverter x:Key="thicknessConverter"
InverseValue="True"/>
</ControlTemplate.Resources>
<Grid>
<Grid.ColumnDefinitions>
<!-- HierarchicalGroupLevelIndicatorPane -->
<ColumnDefinition Width="Auto" />
<!-- GroupLevelIndicatorPane -->
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
<!-- CellsHost panel -->
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<!-- GroupLevelIndicatorPane is a placeholder for individual GroupLevelIndicator elements that are added
whenever this Row is part of a group. -->
<xcdg:HierarchicalGroupLevelIndicatorPane Visibility="Collapsed" Grid.Column="0" />
<xcdg:GroupLevelIndicatorPane x:Name="groupLevelIndicatorPane"
Grid.Column="1" />
<Grid Height="{TemplateBinding Height}"
Grid.ColumnSpan="3"
Grid.Column="1"
xcdg:TableView.CanScrollHorizontally="False">
<Grid.RowDefinitions>
<RowDefinition Height="17*" />
<RowDefinition Height="8*" />
<RowDefinition Height="10*" />
</Grid.RowDefinitions>
<Border x:Name="Border1"
Background="#121212"
Grid.RowSpan="4"/>
<!--Bottom Gradient-->
<Border x:Name="grpManborderBottomGradient"
Grid.Row="2">
<Border.Background>
<LinearGradientBrush
StartPoint="0.125,1"
EndPoint="0.125,0.0142">
<GradientStop Color="#445282" // This to be overridden
Offset="0" />
<GradientStop Color="#29314D"// This to be overridden
Offset="0.53" />
<GradientStop Color="#12131D"// This to be overridden
Offset="0.95" />
</LinearGradientBrush>
</Border.Background>
</Border>
<!--Top Gradient-->
<Border x:Name="topGradientBorder"
VerticalAlignment="Stretch"
Opacity="0.8"
Grid.Row="0">
<Border.Background>
<LinearGradientBrush StartPoint="0.5,1"
EndPoint="0.5,0">
<GradientStop Color="#393F4D" // This to be overridden
Offset="0" />
<GradientStop Color="#4A5367" // This to be overridden
Offset="0.33" />
<GradientStop Color="#626C88" // This to be overridden
Offset="1" />
<GradientStop Color="#FF5F6A87"// This to be overridden
Offset="0.988" />
</LinearGradientBrush>
</Border.Background>
</Border>
<!--internal border, needs to be last to be over other gradients-->
<Border x:Name="Border2"
BorderThickness="1"
BorderBrush="#9CA3B5"
Margin="0,0,0,0"
Grid.RowSpan="3"/>
</Grid>
-->Template to be continued...