恢复布局不会恢复模块内容
我正在将 prism 与 AvalonDoc 一起使用。
当我尝试恢复布局(在菜单按钮“RestoreLayout”的事件处理程序上)
dockManager.RestoreLayout(FileName);
我确实获得了正确的布局结构,但每个区域的内容是现在是空的。我需要重新加载到模块或类似的东西吗?
我的 xaml 代码是这样的:
<ad:ResizingPanel ad:ResizingPanel.ResizeWidth="*" Orientation="Vertical" VerticalAlignment="Top">
<ad:DockablePane ad:ResizingPanel.ResizeHeight="150" prism:RegionManager.RegionName="RegionDocPane1">
<ad:DockableContent Name="DocContent1" HorizontalAlignment="Left"/>
</ad:DockablePane>
</ad:ResizingPanel>
<ad:DockableContent Name="DocContent2" HorizontalAlignment="Right"/>
</ad:ResizingPanel>
</ad:DockingManager>
i"m using prism with AvalonDoc.
when i try to restore the layout (on the event handler of the menu button "RestoreLayout")
dockManager.RestoreLayout(FileName);
i do get the correct layout structure, but the content of every region is now empty. do i need to reload to modules or something like that ?
the avalondoc code im my xaml code is something like that:
<ad:ResizingPanel ad:ResizingPanel.ResizeWidth="*" Orientation="Vertical" VerticalAlignment="Top">
<ad:DockablePane ad:ResizingPanel.ResizeHeight="150" prism:RegionManager.RegionName="RegionDocPane1">
<ad:DockableContent Name="DocContent1" HorizontalAlignment="Left"/>
</ad:DockablePane>
</ad:ResizingPanel>
<ad:DockableContent Name="DocContent2" HorizontalAlignment="Right"/>
</ad:ResizingPanel>
</ad:DockingManager>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
它不会恢复您的内容,因为 Avalon 对接(以及大多数对接机制)不会也无法存储您的用户控件状态。您需要手动执行此操作。
It won't restore your content because Avalon dock (and most docking mechanisms) don't and can't store your user-controls state. You need to do this manually.