Need to add image control & text control in header of childwindow control.Tried to create subclass as shown below:
```
public class CustomChildWindow : ChildWindow
{
public override void OnApplyTemplate()
{
base.OnApplyTemplate();
var windowRoot = GetTemplateChild("PART_WindowRoot") as Grid;
if (NormalImage != null)
{
base.OnApplyTemplate();
Grid g = this.GetTemplateChild("Root") as Grid;
if(g!=null)
img.Source = this.NormalImage;
}
}
}
```
But line "base.OnApplyTemplate()" gives null exception.Please suggest any alternate to add image control in header of ChildWindow.
Thanks in advance.
```
public class CustomChildWindow : ChildWindow
{
public override void OnApplyTemplate()
{
base.OnApplyTemplate();
var windowRoot = GetTemplateChild("PART_WindowRoot") as Grid;
if (NormalImage != null)
{
base.OnApplyTemplate();
Grid g = this.GetTemplateChild("Root") as Grid;
if(g!=null)
img.Source = this.NormalImage;
}
}
}
```
But line "base.OnApplyTemplate()" gives null exception.Please suggest any alternate to add image control in header of ChildWindow.
Thanks in advance.