Hi i have made my own UserControl, its a little windows explorer.
i defined a Property in the Control that sets the Path where the Explorer should start from listing the Directory:
public string SetRootPath
{
get { return rootPath; }
set { rootPath = value; }
}
and im binding the TreeView that i have with a method "listDirectory"
public UserControl1()
{
InitializeComponent();
this.DokumentBrowser.ItemsSource = listDirectory(SetRootPath);
}
when im calling it and i try to set the SetRootPath Property to a local path
<mycontrol:UserControl1 SetRootPath="c:\\temp" />
the Variabel SetRootPath is everytime null and i get an Exception because nothing is assigned. So why is the Property never setted with the value that i assign?
regards