This is a migrated thread and some comments may be shown as answers.

Toobar Button Properties are not being set in Q1 2013 release

5 Answers 76 Views
ToolBar
This is a migrated thread and some comments may be shown as answers.
Timothy
Top achievements
Rank 1
Timothy asked on 04 Mar 2013, 03:13 PM
If you have a RadButton in a RadToolbar and the button properties are set in a style, those properties do not get applied at runtime.  If you set the properties directly on the button itself, then they do get set.  This was working before and broke in the latest release.

Example: 
<telerik:RadToolBar x:Class="ToolBarTest.View.ToolBars.StandardToolbarView"
                     xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                     xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                     xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
                     xmlns:Controls="clr-namespace:ToolBarTest.Controls"
                     >
    <telerik:RadToolBar.Resources>
        <Style x:Key="Refresh" TargetType="telerik:RadButton">
            <Setter Property="ToolTip" Value="Refresh Set Via Property"/>
        </Style>
    </telerik:RadToolBar.Resources>
        
    <telerik:RadButton x:Name="Refresh" 
                       Style="{StaticResource Refresh}" 
                       Controls:ImageContentSetter.Source="/ToolBarTest;component/Images/document_refresh.png"
                       />
</telerik:RadToolBar>

With the above XAML, the Tooltip is NOT SET on the button.

While here:
<telerik:RadToolBar x:Class="ToolBarTest.View.ToolBars.StandardToolbarView"
                     xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                     xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                     xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
                     xmlns:Controls="clr-namespace:ToolBarTest.Controls"
                     >
    <telerik:RadToolBar.Resources>
        <Style x:Key="Refresh" TargetType="telerik:RadButton">
        </Style>
    </telerik:RadToolBar.Resources>
        
    <telerik:RadButton x:Name="Refresh" 
                       Style="{StaticResource Refresh}" 
                       Controls:ImageContentSetter.Source="/ToolBarTest;component/Images/document_refresh.png"
                       ToolTip="Refresh"
                       />
</telerik:RadToolBar>

The tooltip IS SET on the button.

This might seem like a minor thing, but we have MANY buttons in our application and they all take advantage of property setting via styles.  There's NO WAY we are going to go change all of our XAML to work around this.  We cannot upgrade to the Q1 2013 release until this is fixed.

5 Answers, 1 is accepted

Sort by
0
Petar Mladenov
Telerik team
answered on 05 Mar 2013, 07:14 AM
Hi Timothy,

 Indeed, this is a bug in the RadToolBar we have introduced in Q1 2013. We logged it in our PITS where you can track its status. We will do our best to have it fixed for the upcoming internal builds or the SP in the beginning of April the latest. 
Please excuse us for the inconvenience caused.

Kind regards,
Petar Mladenov
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

0
Rajaram
Top achievements
Rank 1
answered on 16 Jun 2017, 09:50 AM

Can you please let me know if this issue is fixed in the latest version of Telerik? If yes please guide in using style property for my radbutton.

Thanks

0
Petar Mladenov
Telerik team
answered on 20 Jun 2017, 01:29 PM
Hi Rajaram,

We have prepared sample SDK project for such scenarios. Please check it out - it contains readme file and comments in XAML describing the approach and the resources used. Let us know if you need further assistance.

RadToolBar: CustomStyleElements SDK Sample GitHub


Regards,
Petar Mladenov
Progress Telerik
Want to extend the target reach of your WPF applications, leveraging iOS, Android, and UWP? Try UI for Xamarin, a suite of polished and feature-rich components for the Xamarin framework, which allow you to write beautiful native mobile apps using a single shared C# codebase.
0
Rajaram
Top achievements
Rank 1
answered on 09 Jan 2018, 02:08 PM

Thanks for the reply. We are using a custom toolbar class in our application. This custom toolbar inherits Radtoolbar. And we are creating all our toolbars dynamically using this custom toolbar class. The styling used to work fine before but after using the new version of the toolbar the styling doesnt seem to work. Do you have any example to show how to make the styling work in case of dynamically created custom toolbars.

 

For example if I have a Custom toolbar class called AbcToobar

Then I am using it as something like below in my xaml

<controls:AbcToolBar>

<controls:AbcToolBar.Resources>

<Style x:Key="abcStyle" TargetType="telerik:RadButton">
             <Setter Property="cal:Message.Attach" Value="ExecuteCommand"/>...
                  </Style>

</controls:AbcToolBar.Resources>

<telerik:RadButton x:Name="abcbutton" Style="{StaticResource abcStyle}"/>

</controls:AbcToolBar>

 

 

 

 

 

 

0
Petar Mladenov
Telerik team
answered on 12 Jan 2018, 09:07 AM
Hello Raj,

Your approach might have worked in R1 2013 but runtime theme change would fail and other styling issues made us change the normal way of applying styles to elements in RadToolBar.
Please use the approach described in the following SDK, it contains useful ReadMe and XAML comments to guide you through the styling approach in RadToolBar:

ToolBarCustomStyledElements SDK

Regards,
Petar Mladenov
Progress Telerik
Want to extend the target reach of your WPF applications, leveraging iOS, Android, and UWP? Try UI for Xamarin, a suite of polished and feature-rich components for the Xamarin framework, which allow you to write beautiful native mobile apps using a single shared C# codebase.
Tags
ToolBar
Asked by
Timothy
Top achievements
Rank 1
Answers by
Petar Mladenov
Telerik team
Rajaram
Top achievements
Rank 1
Rajaram
Top achievements
Rank 1
Share this question
or