telerik RadDocking vs. Prism problems

5 posts, 0 answers
  1. Joe
    Joe avatar
    15 posts
    Member since:
    Apr 2011

    Posted 31 May 2011 Link to this post

    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

     

  2. Joe
    Joe avatar
    15 posts
    Member since:
    Apr 2011

    Posted 31 May 2011 Link to this post

    By the way, I tried the 262639_PRISM-MEF-WPF solution.
    It includes the infamous RadPaneGroupRegionAdapter.  Funny though, the software never calls the RadPaneGroupRegionAdapter.  The RadPaneGroupRegionAdapter does have an [Export], but there is no matching [Import] anywhere in the solution.  Breakpoints in the RadPaneGroupRegionAdapter never are hit.  And the sample does not use RequestNavigate, so it is overly simple and did nothing to resolve the Prism ViewInjection problems.

    Laughably, the PRISM-MEF-WPF solution also uses Unity to register the RadPaneGroupRegionAdapter.  I rewrote the offending line of code, but the adapter is never called and my application behavior is never changed.

    protected override RegionAdapterMappings ConfigureRegionAdapterMappings() 
    { 
      var mappings = base.ConfigureRegionAdapterMappings();
      RadPaneGroupRegionAdapter radPaneGroupRegionAdapter =
        this.Container.GetExportedValue<RadPaneGroupRegionAdapter>("xxxx.Shell.Behaviors.RadPaneGroupRegionAdapter");
      mappings.RegisterMapping(typeof(RadPaneGroup), radPaneGroupRegionAdapter);
      return mappings; 
    }
    
    What I would really really like is an example of RadDocking using Prism, MEF and View Injection (RegionManager.RequestNavigate) with multiple injected views coming and going as the user navigates from another view.  It is actually a very common UI scenario.  Even if this is not a telerik issue, your telerik users will get a productivity boost if you can show them how to use your RadDocking to build out this common scenario.

    Joe
  3. UI for WPF is Visual Studio 2017 Ready
  4. George
    Admin
    George avatar
    1332 posts

    Posted 07 Jun 2011 Link to this post

    Hello Joe,

    Please, refer to the following forum thread where I just replied - http://www.telerik.com/community/forums/wpf/docking/raddocking-with-prism-4-mvvm-mefbootstrapper.aspx


    Best wishes,
    George
    the Telerik team
    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 Public Issue Tracking system and vote to affect the priority of the items
  5. Yu
    Yu avatar
    17 posts
    Member since:
    Jul 2012

    Posted 14 Jan 2013 Link to this post

    Hi George,

    Has the problem been solved with the using Prism 4 + MVVM + Raddocking control?

    We ran into the the same scenario now with using the View Injection approach.

    We can create the different view for the first time, and when we try to create the view second time with the same view name using

    region.Activate(currentView), the view of RadnPany type is not bring to the front.

    We already set the region manager manually to the RadPanGroup.

    Any ideas?


  6. George
    Admin
    George avatar
    1332 posts

    Posted 18 Jan 2013 Link to this post

    Hello,

    In order to activate a pane in the RadDocking control, I would suggest setting the RadDocking.ActivePane property. You could find attached a sample project that demonstrates the given scenario. Please, refer to it and let me know if this helps.

    Kind regards,
    George
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Back to Top
UI for WPF is Visual Studio 2017 Ready