I have a "masterpage" custom control which holds two ContentControl elements (one used for "header content" and one for "main content"). Until now it has only been used in static scenarios but now I want to be able to change the datatemplate
used in the main content area dynamically according to some kind of MainContentType property. My first thought is to use ContentTemplateSelector as shown in the code below. My problem is that when running the code the MainContentSelector.SelectTemplate
is entered but the input parameter "item" is null. What do I have to do to have the item holding information of wich datatemplate to return.
Here follows the code of the masterpage custom control.
public class MasterPageControl : Control
public static DependencyProperty MainContentProperty =
View Complete Post