我想访问嵌套在样式的控件模板中的属性。我知道您可以在代码隐藏中执行此操作:
GradientStop stop = (GradientStop)progressBar1.Template.FindName("gradStop", progressBar1);
stop.Color = Colors.Black;
是否可以做同样的事情,但在 XAML 中?例如:
<ProgressBar Style="{StaticResource CustomProgressBar}" [???].Color="FF000000"/>