This is a migrated thread and some comments may be shown as answers.

TabItem Header + Prism

1 Answer 364 Views
TabControl
This is a migrated thread and some comments may be shown as answers.
Steve
Top achievements
Rank 1
Steve asked on 08 Jul 2015, 08:59 PM

I'm using your TabControl as a region for Prism.  It is working fine in most respects, but I can't figure out how to set the header.  I've seen some related posts on this, but can't quite work it out.  I've associated the tab control with a region "Main" and host a view in it thusly:

            var mainRegion = _regionManager.Regions[RegionNames.Main];
            var workView = _container.Resolve<MultiWorkspaceView>();
            mainRegion.Add(workView);
            mainRegion.Activate(workView);

I added a property to MultiWorkspaceView called Title.  It seems to me that the context of the tab would be the view that is being hosted, but it seems not.  This doesn't work:

        <telerik:RadTabControl Grid.Row="1"
                               x:Name="MainTabControl"
                               prism:RegionManager.RegionName="{x:Static inf:RegionNames.Main}">
            <telerik:RadTabControl.ItemTemplate>
                <DataTemplate>
                    <StackPanel>
                        <TextBlock Text="{Binding Title, diag:PresentationTraceSources.TraceLevel=High}"></TextBlock>
                        <TextBlock Text="Workspace"></TextBlock>
                    </StackPanel>
                </DataTemplate>
            </telerik:RadTabControl.ItemTemplate>
        </telerik:RadTabControl>

I can see the Workspace text, but the binding is empty.  Any ideas?  Thanks!

 

1 Answer, 1 is accepted

Sort by
0
Kiril Vandov
Telerik team
answered on 13 Jul 2015, 01:02 PM
Hello Steve,

Based on the code-snippet we are not sure the exact way you are setting the DataContext to the TabControl or to the Window itself, as the way you are binding the ItemsSource. That is why I would like to ask you to provide us with more information about your scenario. Also if you could send us an isolated project reproducing the issue will help us better understand your scenario and provide you with the best possible solution.

Kind regards,
Kiril Vandov
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
TabControl
Asked by
Steve
Top achievements
Rank 1
Answers by
Kiril Vandov
Telerik team
Share this question
or