Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
235
Add Custom User Control to XamTabControl Sample
posted

Hi,

I need to create Tabs inside a tab control dynamically. Each Tab is a usercontrol with respective data. I guess it is simple if we use ItemTemplates. But I am not able to figure out how to make it work. Can anyone provide me with a simple sample application which does it.

If anyone can explain it using the Prism that would be great.

Thanks

Parents
  • 69686
    Verified Answer
    posted

    Hello,

    You do not actually need the ItemTemplate. The ItemTemplate is used to apply a DataTemplate to the items of the items control - in this case it will be the tab items. As your requirement is to template the content of the selected tab as another XamTabControl, you need the ContentTemplate of the XamTabControl. Below you can find a simple code snippet of this :

    <igWindows:XamTabControl ItemsSource="{Binding}" >

                <igWindows:XamTabControl.ContentTemplate>

                    <DataTemplate>

                        <igWindows:XamTabControl ItemsSource="{Binding Interests}"/>

                    </DataTemplate>

                </igWindows:XamTabControl.ContentTemplate>

            </igWindows:XamTabControl>

Reply Children