I am using the xamRibbon in a wpf application version 2013.1. I dynamically great my tabs and show the relevant menu items on each tab when selected this works as expected. The problem I have is when the tab is selected the content does not change accordingly. I need to know if my assumption is correct that this is where this needs to go. see example below:
<igRibbon:RibbonWindowContentHost> <igRibbon:RibbonWindowContentHost.Ribbon> <igRibbon:XamRibbon x:Name="xamRibbon" Theme="Metro" ApplicationMenuMode="Office2010" prism:RegionManager.RegionName="RibbonTabRegion"> <igRibbon:XamRibbon.Resources> <SolidColorBrush x:Key="{x:Static igRibbon:RibbonBrushKeys.RibbonTabControlHeaderPanelBackgroundKey}" Color="AliceBlue"/> </igRibbon:XamRibbon.Resources> <igRibbon:XamRibbon.ApplicationMenu2010> <igRibbon:ApplicationMenu2010 /> </igRibbon:XamRibbon.ApplicationMenu2010> <igRibbon:XamRibbon.QuickAccessToolbar> <igRibbon:QuickAccessToolbar Visibility="Hidden" /> </igRibbon:XamRibbon.QuickAccessToolbar> </igRibbon:XamRibbon> </igRibbon:RibbonWindowContentHost.Ribbon> <igRibbon:RibbonWindowContentHost.Content> <DockPanel LastChildFill="True"> <ContentControl Margin="1,3,3,3" prism:RegionManager.RegionName="ContentRegion"/> </DockPanel> </igRibbon:RibbonWindowContentHost.Content> </igRibbon:RibbonWindowContentHost>
Hello Anne,
Thank you for your post. I have been looking into your concerns and it seems that you are using Prism regions. According to the code that you have provided with I can see that you use XamRibbonWindow. Would you please give me some more details about the changing of the content ?
It would be great, you can attach a sample application with your scenario.
Looking forward to hearing from you.
Hi, I managed to get this working by adding the following to the shell and shellviewmodel, thought I would post it in case anyone else needs it.
-- ViewModel
private IRegionManager _regionManager;
private IRegion contentRegion;
public RelayCommand NavigateCommand { get; set; }
public ShellViewModel(IRegionManager regionManager, IEventAggregator eventAggregator)
{ _regionManager = regionManager;
NavigateCommand = new RelayCommand(param => Navigate(param));
Commands.NavigateCommand.RegisterCommand(NavigateCommand);
}
private void Navigate(object param)
{String navigationPath = param as String;
if (string.IsNullOrWhiteSpace(navigationPath))
return;
if (!String.IsNullOrWhiteSpace(navigationPath))
{ _regionManager.RequestNavigate(
RegionNames.ContentRegion, navigationPath);
-- View code behind
private void xamRibbon_RibbonTabItemSelected(object sender, Infragistics.Windows.Ribbon.Events.RibbonTabItemSelectedEventArgs e)
{
var item = e.NewSelectedRibbonTabItem as IRibbonTabItem;
if (item != null)
Commands.NavigateCommand.Execute(item.DefaultNavigationPath);