TabItem Header + Prism

2 posts, 0 answers
  1. Steve
    Steve avatar
    5 posts
    Member since:
    Jul 2015

    Posted 08 Jul 2015 Link to this post

    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!

     

  2. Kiril Vandov
    Admin
    Kiril Vandov avatar
    324 posts

    Posted 13 Jul 2015 Link to this post

    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
  3. UI for WPF is Visual Studio 2017 Ready
Back to Top