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

Prism - drag pane out of region

2 Answers 86 Views
Docking
This is a migrated thread and some comments may be shown as answers.
Charles
Top achievements
Rank 1
Charles asked on 26 May 2013, 07:11 AM
HI

I've cobbled together a custom region adapter from reading lots of threads on here, and everything works fine.

However, I've come up against a problem that I'm sure someone must've seen.

The regions are set on a RadPaneGroup level.  You add your view to a specific region and everything's great.

If the user then drags this pane out of that group, then the view is no longer in that region.  If they make the view floating, then it's no longer in any defined region - so how so I remove it using the RegionManager?

Any thoughs appreciated!

Charlie

2 Answers, 1 is accepted

Sort by
0
Charles
Top achievements
Rank 1
answered on 26 May 2013, 10:03 AM
Sort of answering my own question - I looked again at the region adapters others had come up with, and mine is a bit different.

Mine's based loosely on the standard Prism 'SelectorItemsSourceSyncBehavior', which would be used for, say, a tab control - which is what a RadPaneGroup is.

Where this falls down is that this approach syncs both ways - Region.Views to RadPaneGroup.Items and back again.  So when a user drags an item out of the group, it's removed from the region. This sort of makes sense, but causes the issue I commented on above.

The route the other adapters take is to only sync one way - Region.Views to RadPaneGroup.Items.  If panes are removed from the RadPaneGroup, they remain in the region until such time as they are removed - unless the pane is closed and removed from RadDocking completely.   When they are removed from Region.Views, they are found wherever they might be in RadDocking and removed.

I think the whole Prism Regions approach doesn't quite sit right with RadDocking and the ability to move stuff around, but I think the second approach outlined above is about as workable as we're going to get.
0
Guillaume
Top achievements
Rank 1
answered on 27 May 2013, 07:58 AM
Hi Charles,

I think we have the same problem, could you please check my thread : http://www.telerik.com/community/forums/wpf/docking/prism-load-view-in-documenthost-region-problem.aspx ?

I expose my issue with code examples. Maybe you have an idea to help ?

Regards,
Guillaume
Tags
Docking
Asked by
Charles
Top achievements
Rank 1
Answers by
Charles
Top achievements
Rank 1
Guillaume
Top achievements
Rank 1
Share this question
or