telerik RadDocking vs. Prism problems
The telerik RadDocking vs. Prism problems are a “show stopper”. I have invested over fifty hours and cannot get Prism ViewInjection (regionManager.RequestNavigate) to work with telerik RadPanes.
Injected telerik RadPane views appear when they are first injected, but the Prism ConfirmNavigationRequest methods are only ever called on the first Injected View. The same methods on the other ones never fire, and no existing view ever becomes the top view when navigating back. The top view is ALWAYS the last view injected. I tried getting a reference from the view model to the view to force the view to the top layer (Bad developer - I know!), but I cannot get a handle to the telerik RadPane views from my view models because they are registered without a Name as a result of using MEF and Prism RequestNavigate.
I expected telerik to give me productivity gains, but right now telerik has been a huge drain on my productivity. In a few more hours I am going to tell my client I cannot get the product built using telerik RadDocking.
We are using VS2010 SP1, .NET 4, WPF, telerik Apr 19, 2011 Q1 2011 SP1 (version 2011.1.0419), Prism 4.
Sincerely, Joe
ShellView.xaml:
<telerik:RadDocking Padding="0">
<!-- NavigationRegion -->
<telerik:RadSplitContainer InitialPosition="DockedLeft">
<telerik:RadPaneGroup prism:RegionManager.RegionName="{x:Static inf:RegionNames.NavigationRegion}"
IsManipulationEnabled="False"/>
</telerik:RadSplitContainer>
<!-- ActionsPaneRegion -->
<telerik:RadSplitContainer InitialPosition="DockedRight">
<telerik:RadPaneGroup prism:RegionManager.RegionName="{x:Static inf:RegionNames.ActionsPaneRegion}"/>
</telerik:RadSplitContainer>
<!-- WorkAreaRegion -->
<telerik:RadSplitContainer InitialPosition="DockedTop" telerik:DockingPanel.InitialSize="556,717">
<telerik:RadPaneGroup prism:RegionManager.RegionName="{x:Static inf:RegionNames.WorkAreaRegion}"
IsManipulationEnabled="False"/>
</telerik:RadSplitContainer>
</telerik:RadDocking>
NavigationViewModel.cs:
workAreaRegion.Context = selectedTreeViewItem;
UriQuery query = new UriQuery();
query.Add("Action", "Edit Level");
regionManager.RequestNavigate
(
RegionNames.WorkAreaRegion,
new Uri(ViewNames.MarketPropertiesView + query.ToString(), UriKind.Relative),
a => { }
);
WorkAreaViewModel.cs:
#region ConfirmNavigationRequest
public void ConfirmNavigationRequest(Microsoft.Practices.Prism.Regions.NavigationContext navigationContext,
System.Action<bool> continuationCallback)
{
// Use this interface if you want to prevent the user from navigating
// away from a view before the view is completed.
continuationCallback(true);
}
public bool IsNavigationTarget(Microsoft.Practices.Prism.Regions.NavigationContext navigationContext)
{
// A value of true indicates that this View/ViewModel is the one to handle this navigation request.
return true;
}
public void OnNavigatedFrom(Microsoft.Practices.Prism.Regions.NavigationContext navigationContext)
{
// Use this event for logic BEFORE navigation leaves this View/ViewModel
// For example, record which UI control has focus so that when the view is navigated back to,
// focus can be restored to the UI control that previously had focus.
return;
}
public void OnNavigatedTo(Microsoft.Practices.Prism.Regions.NavigationContext navigationContext)
{
// Use this event to initialize/refresh this View/ViewModel.
// Use this method to initiate loading of data and to restore focus to the
// UI Control that had focus when the object was navigated away from.
if (isFirstTime == true)
isFirstTime = false;
// Get passed NavigationContext URI parameters.
if (navigationContext != null)
Action = navigationContext.Parameters["Action"];
return;
}
#endregion ConfirmNavigationRequest