i have a controltemplate in xaml and the target is ToogleButton with x:Key = "NewBtn"
please help me create a toogle button in C# code using template from the Control Template if in xaml code this is the code:
<ToggleButton Template="{DynamicResource NewBtn}"
Margin="12,21,0,0" HorizontalAlignment="Left" Width="151" Height="29" VerticalAlignment="Top"
x:Name="newBtn"
Checked = newBtn_Checked Unchekcked = newBtn_Unchecked
/>
please help me how to create it in c#