Change the font size?

2 posts, 0 answers
  1. Ji
    Ji avatar
    1 posts
    Member since:
    Mar 2019

    Posted 22 Mar 2019 Link to this post

    in the Resources i define the text format for TimelineItemTemplate

    <DataTemplate x:Key="ItemWithDurationTemplate">

    <TextBlock  Foreground="Black" FontFamily="Segoe UI" FontSize="12"  Text="{Binding  Path=DataItem.recognitions}">

    </DataTemplate >

    TimelineItemTemplate="{StaticResource ItemWithDurationTemplate}"

    How can I change the font size when the mouse  is scrolling?

    Shoule i use the Radtimeline_MouseWheel event?

  2. Dinko
    Admin
    Dinko avatar
    1078 posts

    Posted 27 Mar 2019 Link to this post

    Hello Ji,

    What comes up to my mind is to first bind the FontSize property of the TextBlock to a custom property from your model. Then you can subscribe to the VisiblePeriodChanged event of the RadTimeLine control. In the event handler, you can create your own logic which changes the FontSize of the TextBlock depending on your conditions. The things here which need to be taking into consideration is that in what scenario to change the size. This event will be fired when the user scroll and zoom as the visible period is changed. 

    Another approach will be to subscribe to the ItemIntervalChanged event. This way you could apply different FontSize depending on the current interval. You can get the new and old interval from the event arguments.

    Hope one of these approaches will work for you.

    Regards,
    Dinko
    Progress Telerik
    Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Back to Top