This is a migrated thread and some comments may be shown as answers.

Faced with RadDocking problem after upgrading to RadControls_for_WPF40_2011_2_0712_Dev.

16 Answers 175 Views
Docking
This is a migrated thread and some comments may be shown as answers.
Julian
Top achievements
Rank 1
Julian asked on 25 Aug 2011, 12:00 PM
Hi,

We faced with a problem after updateting the controls to heigher version, namely: RadControls_for_WPF40_2011_2_0712_Dev.

Our Floating Panes doesn't works as previousely.

We have the following code:
// pop-up window.
var toolWindow = VisualUtils.FindParentOfType<ToolWindow>(sender as DependencyObject);
toolWindow.VerticalOffset = VerticalOffset;
toolWindow.HorizontalOffset = HorisontalOffset;
toolWindow.Width = PopupWidth;
-toolWindow is null.
-the properties VerticalOffset and HorisontalOffset doesn't exists anymore in class ToolWindow. 
1) I assume that now I have to use RadPaneGroup (as container for floating windows ??) instead of ToolWindow. If so, than provide me please wich proeprties or whatever I have to use to have the oldest behaviour of my float windows (popups). 2) When I use RadPaneGroup it works but the popup is not appears like previousely, it is pinned. The method MakeFloatingOnly() doesnt works for us anymore. Need your help ASAP. ---Julian

16 Answers, 1 is accepted

Sort by
0
Julian
Top achievements
Rank 1
answered on 25 Aug 2011, 12:11 PM
BTW when I use the property of RadPane with false value:  IsPinned = false; The application is going to b crashed.
0
Mariusz
Top achievements
Rank 1
answered on 29 Aug 2011, 12:56 PM
We have the same problem. How to resolve it?
0
Julian
Top achievements
Rank 1
answered on 29 Aug 2011, 01:03 PM
Good or not but we are not alone :)
+1000 ??? :)))

Seriously, would you please give us answer as soon as possible, because this is show-stopper for us.

Thank you in advance,
Julian
0
Julian
Top achievements
Rank 1
answered on 30 Aug 2011, 09:48 AM
Hi Guys,

Let me start with the answer from one of your colleague from the thread RadDocking Q2 2011 pre-beta is here!
in case that I would like to receive the answer/solution/fix of the issue as soon as it is possible
:

"
Hello Julian,

I tried your scenario without PRISM and Unitiy (which should be the problem) and the floating only pane appears correctly. I'm attaching the sample project I used. Could you please take a look at it and let me know if I'm missing something? As we are making this thread read-only I would ask you to open a new one for your response.


All the best,

Miroslav Nedyalkov
the Telerik team
"


@Miroslav sad:
I tried your scenario without PRISM and Unitiy (which should be the problem) and the floating only pane appears correctly.

Well, guys let's take a look on this issue chronologically. Before the new version of Telerik controls it was working PERFECTLY without any kind of issues and we were using PRISM and UNITY. With new version - it doesn't works as previously. It means that the issue is not of PRISM and Unitiy for sure.

Need your help ASAP.

Julian




0
Julian
Top achievements
Rank 1
answered on 30 Aug 2011, 09:50 AM
BTW. IsPinned property works correctly, sorry for disappointing you.
0
Miroslav Nedyalkov
Telerik team
answered on 30 Aug 2011, 01:16 PM
Hi Everybody,

 As I tried to reproduce the problem and I couldn't, could you please provide a sample project that reproduces the problem? Without such we will not be able to reproduce the problem and find a solution for you.

All the best,
Miroslav Nedyalkov
the Telerik team

Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>

0
Julian
Top achievements
Rank 1
answered on 30 Aug 2011, 01:37 PM
Will be ready - shortly.
0
Julian
Top achievements
Rank 1
answered on 31 Aug 2011, 10:32 AM
Hi,

I made two projects. First one  RichTextBoxTest - Telerik New Version (do not pay attention on the name of the projects) where the issue appearance and the second one RichTextBoxTest - Telerik Old Version (do not forget to add old dlls instead of new) where no issues at all.

There is only one difference between both projects in ShellController.cs:

With old version:
        private void PopUpLoaded(object sender, RoutedEventArgs e)
        {
            // pop-up window which hosts some information.
            var floatingWindow = FindParentOfType<ToolWindow>(sender as DependencyObject);
            if (floatingWindow != null)
            {
                floatingWindow.Top = 302;
                floatingWindow.Left = 368;

                floatingWindow.Width = 350;
            }
        }
With new version:
        private void PopUpLoaded(object sender, RoutedEventArgs e)
        {
            // pop-up window which hosts some information.
            var floatingWindow = FindParentOfType<RadPaneGroup>(sender as DependencyObject);
            if (floatingWindow != null)
            {
                floatingWindow.Width = 350;
            }
        }


BTW. How we can set those things in new version:
                floatingWindow.Top = 302;
                floatingWindow.Left = 368;

Regards,
Julian
0
Julian
Top achievements
Rank 1
answered on 31 Aug 2011, 10:43 AM
I posted those projects by submitting a support ticket number 459476.

Please find those project there.

Julian
0
Miroslav Nedyalkov
Telerik team
answered on 01 Sep 2011, 11:11 AM
Hi Julian,

I answered the support thread you posted - thank you for the project you sent. The problem was that we changed the MakeFloatingOnly method to search for the Docking control and in the project you attached there were two regions with the same name the group was added in a wrong place, so we couldn't find the Docking control and because of this the MakeFloatingOnly didn't work. I sent you the fixed project in the support thread..

Regards,
Miroslav Nedyalkov
the Telerik team

Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>

0
Julian
Top achievements
Rank 1
answered on 01 Sep 2011, 11:18 AM
Hi again,

Thanks for fixed project.

I have additional question.

I set the property of InitialPosition to FloatingOnly of RadSplitContainer. Everything works, but I can see how the rad pane initialPosition starts from  from the main container where all regions included. It is visible how it going to be unpined from pined state. How can we solve this issue ?
Julian


0
Julian
Top achievements
Rank 1
answered on 01 Sep 2011, 01:01 PM
Hi Miroslav,

One more issue. We have a logic that opens many popups in one region. So, with your approach we are not able to open as many popups as we want to.

Need a help.

Julian
0
Miroslav Nedyalkov
Telerik team
answered on 02 Sep 2011, 12:16 PM
Hello Julian,

 We have no fix for the first problem you are experiencing yet. About the second question - I would suggest you to pop just one pane after that to add all the others. Another approach could be to add SplitContainers directly to the Docking control with their InitialPosition set to FloatingDockable. This way the Docking control will take care to pop the whole container in a ToolWindow. 

Hope this helps.

Best wishes,
Miroslav Nedyalkov
the Telerik team

Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>

0
Mariusz
Top achievements
Rank 1
answered on 04 Sep 2011, 10:50 AM
We have also problem with using RadDocking in XBAP application. When we try Drag&Drop method on pane, the pane is hidding. Simply floating panes doesn't work in XBAP, or we are doing soemething wrong. In previous 419 version, everything was ok. Sample project was submited in ticket 460693.

0
Julian
Top achievements
Rank 1
answered on 05 Sep 2011, 08:40 AM
Good Morning Miroslav,

1. Regarding the first issue (splash visibility of pin-unpin of radpane) I'd like to know when we could expect the fix for this issue.
2. Regarding the second problem:
    "I would suggest you to pop just one pane after that to add all the others".
    Before the new version of RadControls we have implemented our logic of showing popups in the same way as you mentioned.
We have a tree list view when you select any item in the list and double click on it the popup will appears in separate/independent/unpinned popup window(rad pane if you will). At this moment we are not able to emulate the same behavior with new controls.
Please note, that each window starts with its own coordinates.

Would you please so kind to provide us with kind of solution that help us to close this issue that is show-stopper for us. Next week we have planed workshop with our clients. And it would be really helpful if we could show them those popups functionality.

---
Thank you in advance,
Julian
      
0
Miroslav Nedyalkov
Telerik team
answered on 07 Sep 2011, 09:36 AM
Hi Everybody,

 Julian, I modified your project and made the Docking control a region. This way I was able to add Initially floated SplitContainers in it using the InitialPosition property of the RadSplitContainer. Please notice that this works only when the SplitContianers are direct children of the RadDocking control. To make the Docking control a region and to keep the inner regions working, I created a custom RegionAdapter called OnlyAddItemsItemsControlRegionAdapter, which generally just adds views. This might need some tuning if you need to remove the views from the region, but the default behavior prevents nesting of regions in ItemsControl. Here is the code:

public class OnlyAddItemsItemsControlRegionAdapter : RegionAdapterBase<ItemsControl>
{
    /// <summary>
    /// Initializes a new instance of the <see cref="RadPaneGroupRegionAdapter"/> class.
    /// </summary>
    /// <param name="regionBehaviorFactory">The region behavior factory.</param>
    public OnlyAddItemsItemsControlRegionAdapter(IRegionBehaviorFactory regionBehaviorFactory)
        : base(regionBehaviorFactory)
    {
    }
 
    /// <summary>
    /// Its job is to initialize the relationship between the targeted control (RadPaneGroup in our case)
    /// and the region. In the default implementation for the ItemsControl this method is implemented in
    /// the following way – it just checks is the Items collection or the ItemsSource property of the
    /// ItemsControl already used and if not, it sets the ItemsSource to be the the Views collection of
    /// the region. We cannot do that with the RadPaneGroup, because the Docking control uses its Items
    /// collection. Firs of all we need to allow the views to be only of type RadPane and we will keep
    /// synchronized the views that are currently in the Views collection of the region with the panes
    /// currently added to the Docking control. This means that when a pane is added we will add it to the
    /// Items collection of the PaneGroup, If a pane is removed we will call its RemoveFromParent method
    /// (if the pane was moved out of its original pane group or it is unpinned it won’t be in the Items
    /// collection of its targeted control). When a pane is replaced we find the current parent of the
    /// pane and replace the pane in its parent’s Items collection.
    /// </summary>
    /// <param name="region">The region.</param>
    /// <param name="regionTarget">The region target.</param>
    protected override void Adapt(IRegion region, ItemsControl regionTarget)
    {
        region.Views.CollectionChanged += (s, e) =>
        {
            switch (e.Action)
            {
                case NotifyCollectionChangedAction.Add:
                    foreach (var item in e.NewItems)
                    {
                        regionTarget.Items.Add(item);
                    }
 
                    break;
                case NotifyCollectionChangedAction.Remove:
                    // Do nothing in this case
                    break;
                case NotifyCollectionChangedAction.Replace:
                    foreach (var item in e.NewItems)
                    {
                        regionTarget.Items.Add(item);
                    }
                    // Just add the new items. Leave the old ones.
                    break;
                case NotifyCollectionChangedAction.Reset:
                    // Do nothing in this case
                    break;
                default:
                    break;
            }
        };
 
        foreach (var view in region.Views)
        {
            regionTarget.Items.Add(view);
        }
    }
 
    /// <summary>
    /// Create new instance of a class that implements IRegion interface
    /// </summary>
    /// <returns>All regions</returns>
    protected override IRegion CreateRegion()
    {
        return new AllActiveRegion();
    }
}
And the XAML:
<telerik:RadDocking x:Name="DockingControl" HasDocumentHost="False" Height="500" Width="500"
        prismrgn:RegionManager.RegionName="{x:Static Common:RegionNames.DockRegion}">
    <telerik:RadSplitContainer prismrgn:RegionManager.RegionName="{x:Static Common:RegionNames.MainRegion}">
        </telerik:RadSplitContainer>
    <telerik:RadSplitContainer>
        <telerik:RadPaneGroup prismrgn:RegionManager.RegionName="{x:Static Common:RegionNames.MainRegionGroup}"
                PropagateItemDataContextToContent="False" />
    </telerik:RadSplitContainer>
</telerik:RadDocking>

And the code for popping up a SplitContainer:
public void ShowTurbineInfo(ShellViewModel info, Style popupStyle)
{
    var popUp = container.Resolve<RadPane>();
    var group = container.Resolve<RadPaneGroup>();
    var sc = container.Resolve<RadSplitContainer>();
 
    sc.InitialPosition = DockState.FloatingDockable;
 
    sc.Items.Add(group);
    group.Items.Add(popUp);
 
    popUp.Style = popupStyle;
    popUp.Loaded += this.PopUpLoaded;
    popUp.Content = info;
    regionManager.AddToRegion(RegionNames.DockRegion, sc);
}
 
private void PopUpLoaded(object sender, RoutedEventArgs e)
{
    var popUp = sender as RadPane;
 
    if (popUp != null)
    {
        popUp.Loaded -= this.PopUpLoaded;
        var floatingWindow = popUp.GetParentToolWindow();
        if (floatingWindow != null)
        {
            floatingWindow.Top = 302;
            floatingWindow.Left = 368;
        }
    }
}
And I added this line to the Bootstrapper's method ConfigureRegionAdapterMappings method:
mappings.RegisterMapping(typeof(RadDocking), this.Container.Resolve<OnlyAddItemsItemsControlRegionAdapter>());
Please find the modified project attached to the support thread you opened.

Hope this helps.

Mariusz, we answered your support thread. We will continue communication about this matter there as it is not connected to the topic of this forum thread.

Greetings,
Miroslav Nedyalkov
the Telerik team

Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>

Tags
Docking
Asked by
Julian
Top achievements
Rank 1
Answers by
Julian
Top achievements
Rank 1
Mariusz
Top achievements
Rank 1
Miroslav Nedyalkov
Telerik team
Share this question
or