带有Caliburn Micro的AvalonDock 2 [英] AvalonDock 2 with Caliburn Micro

查看:84
本文介绍了带有Caliburn Micro的AvalonDock 2的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有关于在Caliburn Micro MVVM上使用AvalonDock的博客或文章?
谷歌搜索时找不到很多

Are there any blogs or articles about using AvalonDock with Caliburn Micro MVVM? Didn't find much when Googling

http: //avalondock.codeplex.com/

编辑:进行投票,为什么不更新最终解决方案。
完整代码可在此处找到

edit: Got an up vote so why not update with a final solution. Full code can be found here

https: //github.com/AndersMalmgren/FreePIE

与avalon相关的大多数代码都在这里找到

Most of the avalon related code is found here

https://github.com/AndersMalmgren/FreePIE /blob/master/FreePIE.GUI/Shells/MainShellView.xaml

在Sam回答后更新

启用Caliburn所需要做的工作非常非常少。首先实现LayoutItemTemplateSelector

Its very, very little that needs to be done to enable Caliburn. First implement a LayoutItemTemplateSelector

public class AutobinderTemplateSelector : DataTemplateSelector
{
    public DataTemplate Template { get; set; }

    public override DataTemplate SelectTemplate(object item, DependencyObject container)
    {
        return Template;
    }
}

并将其与内容控件和Caliburns View结合使用模型附加机制,例如

And use it together with the content control and Caliburns View.Model attach mechanism like

<xcad:DockingManager.LayoutItemTemplateSelector>
    <avalonDock1:AutobinderTemplateSelector>
        <avalonDock1:AutobinderTemplateSelector.Template>
            <DataTemplate>
                <ContentControl cal:View.Model="{Binding . }" IsTabStop="False" />
            </DataTemplate>
        </avalonDock1:AutobinderTemplateSelector.Template>
    </avalonDock1:AutobinderTemplateSelector>
</xcad:DockingManager.LayoutItemTemplateSelector>


推荐答案

http://caliburnmicro.codeplex.com/discussions/231809

http://caliburnmicro.codeplex.com/discussions/430994 (解决方案)

我相信这是我用来为telerik的 RadDockingManager 创建类似的文档管理器的帖子。该帖子和代码可能会有所帮助。

I believe that is the post I used to create a similar doc manager for telerik's RadDockingManager. That post and this code might help.

这篇关于带有Caliburn Micro的AvalonDock 2的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆