please I am getting out of my mind trying to understand something, I really need some direction, because I am lost.
I have a UserControl I created called TerminalControl which have a view which wraps a TextBox bounded to a Text property in the view model, which is updated in real time through RS232 connected to an embedded system. So the flow is data arrives to RS232 (updates) ==> VM.Text ==> (data binding) ==> TerminalView.TextBox.Text
All I want is to add this user control to an AvalonDock 2.0 through data binding.
I created a data template in the window holding the Docking Manager
<avalonDock:DockingManager x:Name="dockManager"
DocumentsSource="{Binding ???}"
Grid.Row="1">
<avalonDock:DockingManager.LayoutItemTemplateSelector>
<vm:PanesTemaplateSelector>
<vm:PanesTemaplateSelector.SessiomDataTemplate >
<DataTemplate>
<Terminal:TerminalEditorView/>
</DataTemplate>
</vm:PanesTemaplateSelector.SessiomDataTemplate>
</vm:PanesTemaplateSelector>
</avalonDock:DockingManager.LayoutItemTemplateSelector>
and created the documents inside the docking
<avalonDock:LayoutRoot>
<avalonDock:LayoutPanel Orientation="Vertical">
<avalonDock:LayoutDocumentPane/>
<avalonDock:LayoutAnchorablePane Name="ToolsPane" DockHeight="150">
</avalonDock:LayoutAnchorablePane>
</avalonDock:LayoutPanel>
</avalonDock:LayoutRoot>
</avalonDock:DockingManager>
I have a modul that creates a TerminalControl and returns the viewModel to the MainWin view model. My problem is that I dont know to what I should bind the DocumentSource of the AvalonDock, as you can see above.
What am I doing wrong? Is there something wrong in my architecture?
Guys, any help will be highly appriciated because I am running out of ideas.
Thanks
Ok, since there is no answer to my questiuon, here is the solution I am going on:
This is the best solution I could find, if anyone has any opinions/remarks/suggestions I will be glad to hear.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.