Custom RadioButton Style code:
<windows. Resources>
<lineargradientbrush x:key= "Checkradiofillnormal" >
<gradientstop color= "#FFD2D4D2" offset= "0"/>
<gradientstop color= "#FFFFFFFF" offset= "1"/>
</LinearGradientBrush>
<lineargradientbrush x:key= "Checkradiostrokenormal" >
<gradientstop color= "#FF004C94" offset= "0"/>
<gradientstop color= "#FF003C74" offset= "1"/>
</LinearGradientBrush>
<style x:key= "Checkradiofocusvisual" >
<setter property= "Control.template" >
<Setter.Value>
<ControlTemplate>
<rectangle margin= "14,0,0,0" snapstodevicepixels= "true" stroke= "{DynamicResource {x:static Systemcolors.controltextbrushkey}} "strokethickness=" 1 "strokedasharray=" 1 2 "/>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<style x:key= "Radiobuttoncolorstyle" targettype= "{x:type RadioButton}" >
<setter property= "Foreground" value= "{dynamicresource {x:static Systemcolors.controltextbrushkey}}"/>
<setter property= "Background" value= "{StaticResource checkradiofillnormal}"/>
<setter property= "BorderBrush" value= "{StaticResource checkradiostrokenormal}"/>
<setter property= "BorderThickness" value= "1"/>
<setter property= "Template" >
<Setter.Value>
<controltemplate targettype= "{x:type RadioButton}" >
<Grid>
<!--background color transparency border radians--
<rectangle x:name= "Rectangle" fill= "Lightgray" stroke= "Black" opacity= "1" radiusx= "0" radiusy= "0" strokethickness= "0"/>
<!--font color, font size--
<textblock x:name= "TextBlock" margin= "8,0" textwrapping= "Wrap" text= "{TemplateBinding Content}" Horizontalalignment= "Center" verticalalignment= "center" height= "27.137" fontsize= "18.667" foreground= "Black"/>
</Grid>
<ControlTemplate.Triggers>
<trigger property= "GroupName" value= ""/>
<trigger property= "GroupName" value= ""/>
<!--mouse click Trigger, background Color--
<trigger property= "IsChecked" value= "True" >
<setter property= "Fill" targetname= "Rectangle" value= "#8B0000"/>
<setter property= "Opacity" targetname= "Rectangle" value= "1"/>
<setter property= "Foreground" targetname= "TextBlock" >
<Setter.Value>
<LinearGradientBrush>
<!--mouse click Trigger, modify font Color--
<gradientstop color= "#FFFFFF" offset= "0"/>
<gradientstop color= "#FFFFFF" offset= "1"/>
</LinearGradientBrush>
</Setter.Value>
</Setter>
</Trigger>
<!--mouse Move-out trigger--
<trigger property= "IsMouseOver" value= "True" >
<setter property= "Effect" targetname= "Rectangle" value= "{x:null}"/>
<setter property= "Fill" targetname= "Rectangle" value= "#AAAAAA"/>
</Trigger>
<trigger property= "Hascontent" value= "true" >
<setter property= "FocusVisualStyle" value= "{StaticResource checkradiofocusvisual}"/>
<setter property= "Padding" value= "2,0,0,0"/>
</Trigger>
<trigger property= "IsEnabled" value= "false" >
<setter property= "Foreground" value= "{dynamicresource {x:static Systemcolors.graytextbrushkey}}"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</windows. Resources>
Calling the RadioButton style code
<radiobutton content= "User Management" Name= "Usermanager" fontsize= "+" verticalcontentalignment= "Center" Horizontalalignment= "Stretch" grid.row= "4" verticalalignment= "Stretch" margin= "0,0,0,0" checked= "Rbusermanager_ Checked " style=" {DynamicResource radiobuttoncolorstyle} "/>
WPF Radiobuttong go to the front dot, custom radiobutton style