Changing the content of a ToggleButton when checked

2 posts, 0 answers
  1. Maksym
    Maksym avatar
    1 posts
    Member since:
    Dec 2010

    Posted 10 Jan 2011 Link to this post

    Hi! I'm trying to add toggle button to telerik toolbar with ability to change image on different states (IsChecked = true or false).
    Here is the code sample:

    <telerik:RadToolBar Height="43" HorizontalAlignment="Left" Name="RadToolBar1" VerticalAlignment="Top" Width="509" Background="#FF6A6A6A" GripVisibility="Collapsed" OverflowButtonVisibility="Collapsed" Grid.Row="1" Margin="0,2,0,0" Grid.RowSpan="2">
    <ToggleButton  x:Name="BtnRec" ToolTip="Start record" Width="32">
          <Style TargetType="ToggleButton">
                <Trigger Property="IsChecked" Value="false">
                    <Setter Property="Content">
                            <Image Source="/3DSuit_01;component/Images/Rec_Mode.png"></Image>
               <Trigger Property="IsChecked" Value="true">
                   <Setter Property="Content">
                             <Image Source="/3DSuit_01;component/Images/Play.png"></Image>

    The problem is that there is no image shown on the button and button appears like tiny smooth on toolbar. The same code works fine with the standard (non telerik) toolbar, or without toolbar. Please help.
    Thank You!
  2. Petar Mladenov
    Petar Mladenov avatar
    2991 posts

    Posted 13 Jan 2011 Link to this post

    Hello Maksym,

    This appears to be a bug in the RadToolBar . We logged in our PITS ( ToolBar: Image does not show when it is set via triggers in the style of a RadToggleButton in the ToolBar ) and updated your telerik points. Soon ( in the next 24 hours) you will be able to vote for it. Please accept our apologies for the inconvenience caused.

    All the best,
    Petar Mladenov
    the Telerik team
    Let us know about your Windows Phone 7 application built with RadControls and we will help you promote it. Learn more>>
Back to Top