I'm having trouble finding an animation storyboard type that allows me to animate th开发者_如何学Ce FontWeight property of a label from "Normal" to "Bold". Does anyone have any experience with this?
Suppose initial your FontWeight of a label is Normal, like the below :
<Label x:Name="label" Content="Label" HorizontalAlignment="Left" FontWeight="Normal" VerticalAlignment="Top"/>
You can have the below storyboard to make the FontWeight of a label to Bold :
<Storyboard>
     <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(TextElement.FontWeight)" Storyboard.TargetName="label">
        <DiscreteObjectKeyFrame KeyTime="0">
            <DiscreteObjectKeyFrame.Value>
                <FontWeight>Bold</FontWeight>
            </DiscreteObjectKeyFrame.Value>
        </DiscreteObjectKeyFrame>
    </ObjectAnimationUsingKeyFrames>
</Storyboard>
you could use a converter that converts a double to FontWeight (if the animated value is above a certain threshold switch to bold) but I don't think you can achieve a very smooth animation between these two states.
 
         
                                         
                                         
                                         
                                        ![Interactive visualization of a graph in python [closed]](https://www.devze.com/res/2023/04-10/09/92d32fe8c0d22fb96bd6f6e8b7d1f457.gif) 
                                         
                                         
                                         
                                         加载中,请稍侯......
 加载中,请稍侯......
      
精彩评论