Reputation: 370
<ad:DockingManager>
<ad:LayoutRoot>
<ad:LayoutPanel Orientation="Horizontal">
<ad:LayoutPanel>
<ad:LayoutDocumentPaneGroup>
<ad:LayoutDocumentPane >
<ad:LayoutDocument>
<RichTextBox>Here is Error!!!</RichTextBox>
</ad:LayoutDocument>
</ad:LayoutDocumentPane>
</ad:LayoutDocumentPaneGroup>
</ad:LayoutPanel>
<ad:LayoutPanel>
<ad:LayoutAnchorablePaneGroup>
<ad:LayoutAnchorablePane>
<ad:LayoutAnchorable>
<RichTextBox x:Name="achorRichText"></RichTextBox>
</ad:LayoutAnchorable>
</ad:LayoutAnchorablePane>
</ad:LayoutAnchorablePaneGroup>
</ad:LayoutPanel>
</ad:LayoutPanel>
</ad:LayoutRoot>
</ad:DockingManager>
I am learning C# using Visual Studio. I am trying to use Xceed Avalondoc. I used a RichTextBox in a LayoutDocument tag. It give this error
System.InvalidCastException: 'Unable to cast object of type 'System.Windows.Documents.FlowDocument' to type 'System.Windows.Media.Visual'.'
when I click in the RichTextBox after program runs.
Can you help me remove this error. Thanks
Upvotes: 0
Views: 1360
Reputation: 370
So long story short I found the reason and the solution to this strange problem.
Actually I was using the latest version of Xceed AvalonDock in my new project and It has a bug. I found an old version 2.0.0 of AvalonDock & it worked. I have following specifications in my Project.
Thanks
Upvotes: 1