Q1 2013 bug: Radbutton Content disappears when data binding the FontSize property in a Style

3 posts, 0 answers
  1. hwsoderlund
    hwsoderlund avatar
    419 posts
    Member since:
    Aug 2006

    Posted 21 Feb 2013 Link to this post

    If I data bind the FontSize property in the inline markup everything works fine, but when I set the same data binding in a Style, the entire Content of the RadButton disappears. I am using the Windows8 theme. When using the default theme everything works fine. I have not tried the other themes. This was never an issue in the previous RadControls version (the one I used was RadControls_for_Silverlight_5_2012_3_1411_DEV_hotfix). To reproduce, please see the code below. I am also attaching two screen shots so you can see the actual behaviour vs the expected behaviour.

    <UserControl x:Class="SilverlightApplication1.MainPage03"
            <local:DataContainer x:Key="DataContainer">
            <Style x:Name="Style_DataBoundFontSize"
                <Setter Property="FontSize"
                        Value="{Binding TheFontSize,
                                        Source={StaticResource DataContainer}}" />
        <Grid x:Name="LayoutRoot"
            <StackPanel Width="400"
                        Margin="0 50 0 0">
                <TextBlock Margin="5">Font size data binding inline:</TextBlock>
                <telerik:RadButton Height="40"
                                   Margin="5 5 0 10"
                                   Content="Some Button Text"
                                   FontSize="{Binding TheFontSize,
                                                      Source={StaticResource DataContainer}}">
                <TextBlock Margin="5"
                    Font size data binding set on the Style (content disappears in Q1 2013 but works in previous version):
                <telerik:RadButton Height="40"
                                   Margin="5 5 0 10"
                                   Content="Some Button Text"
                                   Style="{StaticResource Style_DataBoundFontSize}">

    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Linq;
    using System.Net;
    using System.Windows;
    using System.Windows.Controls;
    using System.Windows.Documents;
    using System.Windows.Input;
    using System.Windows.Media;
    using System.Windows.Media.Animation;
    using System.Windows.Shapes;
    using Telerik.Windows.Controls;
    namespace SilverlightApplication1
        public partial class MainPage03 : UserControl
            public MainPage03()
                StyleManager.ApplicationTheme = new Windows8Theme();
        public class DataContainer : INotifyPropertyChanged
            public event PropertyChangedEventHandler PropertyChanged;
            private double _TheFontSize = 22.0;
            public double TheFontSize
                    return _TheFontSize;
                    _TheFontSize = value;
            protected virtual void OnPropertyChanged(string propertyName)
                if (PropertyChanged != null)
                    PropertyChanged(this, new PropertyChangedEventArgs(propertyName));

  2. Christian
    Christian avatar
    7 posts
    Member since:
    Sep 2010

    Posted 25 Feb 2013 Link to this post

    Same problem here! What happen on 2013 Q1. RadButton Content is empty, always. Only works with images.

    Anyone from Telerik?
  3. Pavel R. Pavlov
    Pavel R. Pavlov avatar
    1251 posts

    Posted 26 Feb 2013 Link to this post

    Hello Christian,

    Thank you for bringing this issue to our attention. In the last queue we worked on improving our Win8 and Win8Touch styles, specifically to better work with FontSizes that are changed dynamically.
    Unfortunately, setting an Application theme via StyleManager breaks the binding of the Fontsize via Style. This has to do with an existing Silverlight Framework issue. We know this used to work before but our styles were not ready to work with dynamical FontSize change. We hope you will understand that this breaking change is in a right direction.

    However, In order to overcome this issue you can use ImplicitStyles and NoXaml dlls. For more information you can refer to this article. Also, for your convenience I implemented the described approach in the attached solution. Please take a look at it and let me know if it works for you.

    Please accept our apologies for the inconvenience caused.

    All the best,
    Pavel R. Pavlov
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Back to Top