Рассмотрим этот код:
public class customlistbox : ListBox
{
public customlistbox()
{
this.itemtemplate = this.gettemplate();
}
private string gettemplate()
{
return ".......<locall:CustomGrid Background='" + Background.Color + "' ParentReference='" + this + "' > "....."
}
}
'ParentReference' - это свойство типа customlistbox.но я даю ParentReference = '"+ this +"', это показывает ошибку.Как я могу дать значение для «ParentReference» в таком случае ??