<Style x:Key="S_Top" TargetType="RadioButton"> <Setter Property="Background" Value="{x:Null}"/> <Setter Property="Foreground" Value="{x:Null}"/> <Setter Property="HorizontalContentAlignment" Value="Center"/> <Setter Property="VerticalContentAlignment" Value="Center"/> <Setter Property="Padding" Value="25,0"/> <Setter Property="FontSize" Value="12"/> <Setter Property="Height" Value="29"/> <Setter Property="Cursor" Value="Hand"/> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="RadioButton"> <Grid> <VisualStateManager.VisualStateGroups> <VisualStateGroup x:Name="CheckStates"> <VisualStateGroup.Transitions> <VisualTransition GeneratedDuration="0:0:0.3"> <VisualTransition.GeneratedEasingFunction> <QuarticEase EasingMode="EaseOut"/> </VisualTransition.GeneratedEasingFunction> </VisualTransition> </VisualStateGroup.Transitions> </Grid> </ControlTemplate> </Setter.Value> </Setter> </Style>
rbButton.Style = App.Current.Resources["S_Top"] as Style;