<Grid VerticalAlignment="Bottom" Margin="0">
<!--{TemplateBinding MusicBackground} {TemplateBinding MusicHeight} -->
<!--Background="{Binding MusicBackground1,RelativeSource={RelativeSource AncestorType={x:Type local:MusicSlider}}}"-->
<Grid Height="{Binding MusicHeight,RelativeSource={RelativeSource AncestorType={x:Type local:MusicSlider}}}" Margin="0" VerticalAlignment="Bottom">
<Grid.Background>
<LinearGradientBrush StartPoint="0,1" EndPoint="0,1">
<GradientStop Color="{Binding MusicBackground1,RelativeSource={RelativeSource AncestorType={x:Type local:MusicSlider}}}" Offset="0.1"/>
<GradientStop Color="{Binding MusicBackground2,RelativeSource={RelativeSource AncestorType={x:Type local:MusicSlider}}}" Offset="0.5"/>
<GradientStop Color="{Binding MusicBackground3,RelativeSource={RelativeSource AncestorType={x:Type local:MusicSlider}}}" Offset="1.0"/>
</LinearGradientBrush>
</Grid.Background>
<Canvas Margin="-1,-6" >
<Rectangle x:Name="PART_SelectionRange" Fill="{DynamicResource {x:Static SystemColors.HighlightBrushKey}}" Visibility="Hidden" Width="4.0">
</Rectangle>
</Canvas>
</Grid>
</Grid>
但是如把颜色的值写死也是有效的
但是直接这样写成绑定也是有效的
```xml
<Grid VerticalAlignment="Bottom" Margin="0">
<!--{TemplateBinding MusicBackground} {TemplateBinding MusicHeight} -->
<!--Background="{Binding MusicBackground1,RelativeSource={RelativeSource AncestorType={x:Type local:MusicSlider}}}"-->
<Grid Background="{Binding MusicBackground1,RelativeSource={RelativeSource AncestorType={x:Type local:MusicSlider}}}" Height="{Binding MusicHeight,RelativeSource={RelativeSource AncestorType={x:Type local:MusicSlider}}}" Margin="0" VerticalAlignment="Bottom">
<Canvas Margin="-1,-6" >
<Rectangle x:Name="PART_SelectionRange" Fill="{DynamicResource {x:Static SystemColors.HighlightBrushKey}}" Visibility="Hidden" Width="4.0">
</Rectangle>
</Canvas>
</Grid>
</Grid>
```