这是我的代码:
<ControlTemplate TargetType="{x:Type ToggleButton}">
<Border x:Name="Chrome">
<Grid x:Name="Arrow">
<Grid.Background>
<DrawingBrush Viewport="0,0,4,4" Viewbox="0,-0.4,16,16" ViewboxUnits="Absolute">
<DrawingBrush.Drawing>
<GeometryDrawing x:Name="ArrowDrawing">
<GeometryDrawing.Geometry>
<PathGeometry>
<PathFigure StartPoint="1,1" IsClosed="True">
<LineSegment Point="2,2.45"/>
<LineSegment Point="3,1"/>
<LineSegment Point="2,1.75"/>
</PathFigure>
</PathGeometry>
</GeometryDrawing.Geometry>
</GeometryDrawing>
</DrawingBrush.Drawing>
</DrawingBrush>
</Grid.Background>
</Grid>
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsEnabled" Value="False">
<Setter Property="Brush" TargetName="ArrowDrawing" Value="{StaticResource DisabledForecolor}"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
因此,当触发器触发时(编译时),我收到错误:
Cannot find the Trigger target 'ArrowDrawing'. (The target must appear before any Setters, Triggers, or Conditions that use it.)
如何从触发器实际访问名为GeometryDrawing
的{{1}}?