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

Pane with PRISM region

1 Answer 211 Views
Docking
This is a migrated thread and some comments may be shown as answers.
Gyula
Top achievements
Rank 1
Gyula asked on 01 Feb 2011, 02:21 PM
Hi,

i have the following scenario (RadDocking with three panes and on the third pane is a PRISM region) :

<Grid HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
    <Telerik:RadDocking Name="Docking" UI:PaRadDockingExtensions.IsEnabled="True"
                        ItemContainerStyle="{DynamicResource PaNewRadDockPaneStyle}" AllowUnsafeMode="True" >
            <Telerik:RadDocking.DocumentHost >
            <Telerik:RadSplitContainer Orientation="Vertical">
                <Telerik:RadPaneGroup Name="MapGroup">
                    <Telerik:RadPane Header="Pane1" Telerik:RadDocking.SerializationTag="C1">
                            <AlapModul:CikkInputView DataContext="{Binding}" />
                        </Telerik:RadPane>
                    <Telerik:RadPane Header="Pane2" Telerik:RadDocking.SerializationTag="C2" >
                        <AlapModul:CikkKiegeszitoInputView DataContext="{Binding}" />
                        </Telerik:RadPane>
                    <Telerik:RadPane Header="Pane3" Telerik:RadDocking.SerializationTag="C3" >
                        <ContentControl cal:RegionManager.RegionName="{Binding MERegionName}" DataContext="{Binding}"/>
                    </Telerik:RadPane>
                </Telerik:RadPaneGroup>
            </Telerik:RadSplitContainer>
        </Telerik:RadDocking.DocumentHost>
    </Telerik:RadDocking>

At runtime, when I begin drag the pane with the PRISM region, I got the following error:

An exception occurred while creating a region with name 'cc4ebccf-36cf-410c-b390-318f6e905d1b'. The exception was: System.InvalidOperationException: ContentControl's Content property is not empty.
    This control is being associated with a region, but the control is already bound to something else.
    If you did not explicitly set the control's Content property,
    this exception may be caused by a change in the value of the inherited RegionManager attached property.
   at Microsoft.Practices.Composite.Presentation.Regions.ContentControlRegionAdapter.Adapt(IRegion region, ContentControl regionTarget) in E:\Projects\PrismLib\Source\Main\CAB\Composite.Presentation\Regions\ContentControlRegionAdapter.cs:line 58
   at Microsoft.Practices.Composite.Presentation.Regions.RegionAdapterBase`1.Initialize(T regionTarget, String regionName) in E:\Projects\PrismLib\Source\Main\CAB\Composite.Presentation\Regions\RegionAdapterBase.cs:line 65
   at Microsoft.Practices.Composite.Presentation.Regions.RegionAdapterBase`1.Microsoft.Practices.Composite.Regions.IRegionAdapter.Initialize(Object regionTarget, String regionName) in E:\Projects\PrismLib\Source\Main\CAB\Composite.Presentation\Regions\RegionAdapterBase.cs:line 82
   at Microsoft.Practices.Composite.Presentation.Regions.Behaviors.DelayedRegionCreationBehavior.CreateRegion(DependencyObject targetElement, String regionName) in E:\Projects\PrismLib\Source\Main\CAB\Composite.Presentation\Regions\Behaviors\DelayedRegionCreationBehavior.cs:line 137.

Any idea what I do wrong?

Thanks,

Balazs

1 Answer, 1 is accepted

Sort by
0
George
Telerik team
answered on 04 Feb 2011, 02:22 PM
Hi Balázs,

 
Thank you for contacting us.

I would suggest you to refer to the following Miroslav Nedyalkov's blog post about implementing RadDocking with PRISM - http://blogs.telerik.com/miroslavnedyalkov/posts/09-08-31/using_the_raddocking_control_with_prism.aspx

Best wishes,
George
the Telerik team
Let us know about your Windows Phone 7 application built with RadControls and we will help you promote it. Learn more>>
Tags
Docking
Asked by
Gyula
Top achievements
Rank 1
Answers by
George
Telerik team
Share this question
or