Steps to reproduce in the DockXamlSample example in this repository:
Modification in view ItemsSourceExample.axaml:
<StackPanel DataContext="{Binding Context}">
<StackPanel x:DataType="local:MyDocumentModel">
<!-- insert ContentControl pointing to MyButton -->
<ContentControl Content="{Binding MyButton}"/>
<!-- ... -->
</StackPanel>
</StackPanel>
Modification in view model MyDocumentModel.cs:
public class MyDocumentModel : INotifyPropertyChanged
{
// insert MyButton as instance of Button (or another control)
public Button MyButton { get; } = new() { Content = "CLICK ME" };
}
Start DockXamlSample, open "ItemsSource Example", and rearrange docking tabs:
System.InvalidOperationException: 'The control XXX already has a visual parent ContentPresenter (Name = PART_ContentPresenter, Host = ContentControl) while trying to add it as a child of ContentPresenter (Name = PART_ContentPresenter, Host = ContentControl).'
Dock version v12.0.0.2. Was not an issue in previous Dock version 11.
See also:
Steps to reproduce in the
DockXamlSampleexample in this repository:Modification in view
ItemsSourceExample.axaml:Modification in view model
MyDocumentModel.cs:Start
DockXamlSample, open "ItemsSource Example", and rearrange docking tabs:Dock version v12.0.0.2. Was not an issue in previous Dock version 11.
See also: