Highlight tab

2 posts, 0 answers
  1. Andriy
    Andriy avatar
    1 posts
    Member since:
    Sep 2016

    Posted 06 Sep 2016 Link to this post


    I have few tabs in TabControls. Application has ability to switch themes in runtime.

    I need highlight some tabs due to some actions (e.g. new message received in the system and messages tab will be highlighted) in runtime. This might be blinking tab header but it should be in the current theme colors, for example if I set blue color for tab header - in some cases it will be ok, but if selected theme who has blue tabs by default - highlighted tab will be not visible. 

    How this can be implemented using viewmodel property binding or something like this. Do you have any examples or article?

    Thank you

  2. Evgenia
    Evgenia avatar
    1437 posts

    Posted 08 Sep 2016 Link to this post

    Hi Andriy,

    I attached a sample project demonstarting your requirement. Some notes about it -- please add reference to NoXAML assemblies to be able to run it (from Binaries.NoXAML folder under your controls local installation path) as the test project is made with the use of our implicit styles theming mechanism. When it comes to custom styles where you don't practically change the control template (as in this case) and you want to support theme change runtime, we highly recommend the implicit styles theming mechanism. You mind find more details about it in our documentation here.
    About the project -- I added a custom attached boolean property to the RadTabItem and it triggers an animation that changes the background color of the TabItem. The boolean property won't turn on for the first tab item if it is selected. If you just switch to the next tab, the first one won't get highlighted as well. However on timer tick which is set to 3 sec when we update a sample collection of list items the attached boolean property turns on and the "highlight" tab animation kicks in.

    Feel free to modify the attached project per your own needs.

    Telerik by Progress
    Do you need help with upgrading your AJAX, WPF or WinForms project? Check the Telerik API Analyzer and share your thoughts.
Back to Top