I’ve got this piece of XAML in WPF, and I’d like to translate it to C# but I cannot find any way of doing it.
<Style x:Key="OptionsStyle" TargetType="{x:Type UserControl}">
<Style.Resources>
<ResourceDictionary Source="/Resources;component/BorderStyle.xaml" />
</Style.Resources>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type UserControl}">
<ContentPresenter Content="{StaticResource FormBorderStyle}" />
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
Here is what I tried
public class MyUserControl : UserControl
{
public MyUserControl()
{
Template = new ControlTemplate(typeof(UserControl))
{
SOMETHING (there is not big choice here :( ) = new ContentPresenter() { Content = FindResource("FormBorderStyle") }
};
}
}
I just can’t find a way to put that ContentPresenter into that ControlTemplate, or maybe it should be something else instead of ControlTemplate?
Kind Regards