Binding by Data

Nov 10, 2008 at 12:36 PM
Edited Nov 11, 2008 at 10:45 AM
Hello,
I check aut the Avalon Control.

I'm trying to build something like this:


      public class Document : DocumentContent
    {
        private string fileName;
        private string iD;
        public string FileName
        {
            get { return fileName; }
        }
        public string ID
        {
            get { return iD; }
        }

        public Document(string FileName, string ID)
        {
            this.fileName = FileName;
            this.iD = ID;
        }

    }



ObservableCollection<Document> docList = new ObservableCollection<Document>();
add some files,

<Avalon:DocumentPane x:Name="documentsHost"
                                     ItemsSource="{Binding Path=docList }"
                                     IsSynchronizedWithCurrentItem="True"
                                     >

now i try to add something lilke this:
<Avalon:DocumentPane.ItemTemplate>
<DataTemplate>
 <Avalon:DocumentContent>
            <myControl Text="{Binding Path=FileName}" /><!--Mycontrol is a WindwosFormHost-->
            </Avalon:DocumentContent>
</DataTemplate>
</Avalon:DocumentPane.ItemTemplate>


But i always run into "DocumentPane can contain only DockableContents or DocumentContents!"

Can someone help me?