in a prism 6 based application, this is a part of my shell, and QuickAccessToolBar region defined like this:
<telerik:RadRibbonView>
<telerik:RadRibbonView.QuickAccessToolBar>
<telerik:QuickAccessToolBar prism:RegionManager.RegionName="{x:Static inf:RegionNames.QuickAccessToolBarRegion}"/>
</telerik:RadRibbonView.QuickAccessToolBar>
The RegionManger will not be loads the region,
and when will replace the definition above(just for demo purposes) by this :
<telerik:RadRibbonView >
<ContentControl prism:RegionManager.RegionName="{x:Static inf:RegionNames.QuickAccessToolBarRegion}"/>
The RegionManager loads the region!
my question is:
what's Wrong in my XAML ? my be the region was defined inside a complex property?
Can you guide me,
thanks in advance.
best regards.
Solution :
Very good answer Brian, it works like a charm, as Brian said:
- first of all we name the targeted element:
<telerik:RadRibbonView.QuickAccessToolBar>
<telerik:QuickAccessToolBar x:Name="QuickAccessToolBar"/>
</telerik:RadRibbonView.QuickAccessToolBar>
- in the code behind (the Shell in my case) :
public Shell(ShellViewModel viewModel, IRegionManager regionManager)
{
InitializeComponent();
DataContext = viewModel;
RegionManager.SetRegionName(QuickAccessToolBar,RegionNames.QuickAccessToolBarRegion);
RegionManager.SetRegionManager(QuickAccessToolBar, regionManager);
}
Where RegionNames.QuickAccessToolBarRegion ="QuickAccessToolBarRegion" and regionManager is the RegionManager resolved by unity container
Thank you very much Brian, good night :)