Telerik Custom Style не отражается при применении к RadButton - PullRequest
0 голосов
/ 11 октября 2019

мы используем telerik control в нашем приложении WPF. Я применяю собственный стиль для управления telerik, но он не работает.

    <Style x:Key="RadButtonStyle" TargetType="telerik:RadButton">
    <Setter Property="Cursor" Value="Hand"/>
    <Setter Property="Width" Value="60"/>
    <Setter Property="Height" Value="22"/>
    <Setter Property="Margin" Value="3,3,5,3"/>
    </Style>

   <telerik:RadButton Style="{StaticResource RadButtonStyle}"
                                                       Content="Login"
                                                       Margin="5"
                                                       cmd:Click.Command=" 
   {Binding LoginCommand}" />

, но стиль не применяется. на самом деле она скрывает кнопку ...

Что я сделал: я скачал NugetPackage для Telerik Theme и добавил ссылку

     <ResourceDictionary Source="/Telerik.Windows.Themes.Office_Black;component/Themes/System.Windows.xaml"/>
        <ResourceDictionary   Source="/Telerik.Windows.Themes.Office_Black;component/Themes/Telerik.Windows.Controls.xaml"/>
        <ResourceDictionary   Source="/Telerik.Windows.Themes.Office_Black;component/Themes/Telerik.Windows.Controls.Input.xaml"/>
        <ResourceDictionary   Source="/Telerik.Windows.Themes.Office_Black;component/Themes/Telerik.Windows.Controls.GridView.xaml"/>

1 Ответ

1 голос
/ 11 октября 2019

Попробуйте основать Style на неявном, используя свойство BasedOn:

<Style x:Key="RadButtonStyle" TargetType="telerik:RadButton"
       BasedOn="{StaticResource {x:Type telerik:RadButton}}">
    <Setter Property="Cursor" Value="Hand"/>
    <Setter Property="Width" Value="60"/>
    <Setter Property="Height" Value="22"/>
    <Setter Property="Margin" Value="3,3,5,3"/>
</Style>
Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...