You cannot create a ControlTemplate in Silverlight in C # only. Unlike WPF (where you can set the VisualTree property, there is no property you can set that indicates the "contents" of the ControlTemplate.
You can define your XAML as a string, and then dynamically load it in C #, as described in this post.
The code comes down to the following:
var template = (ControlTemplate)XamlReader.Load("<ControlTemplate " + " xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\"" + " xmlns:x=\"http://schemas.microsoft.com/winfx/2006/xaml\">" + " content here " + "</ControlTemplate>");
source share