Hi Anish.... this demo code extends TextBlock and builds a new TextBlock from a string (no code file needed):
public class TextoRecurso : TextBlock
{
public string Recurso
{
set
{
Inlines.Clear();
Text = null;
if (value == null) return;
StringBuilder SB = new StringBuilder();
SB.Append("<textblock xmlns="\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\"">");
SB.Append(value);
SB.Append("</textblock>");
var TB =
XamlReader.Load(new System.Xml.XmlTextReader(
new System.IO.StringReader(SB.ToString()))) as TextBlock;
var Lista = TB.Inlines.ToArray();
}
}
}