[英]UserControl in Caliburn.Micro
In my application I use Caliburn.Micro to bind between View and ViewModel. 在我的应用程序中,我使用Caliburn.Micro绑定View和ViewModel。 In one of my view I want use CrystalReportsViewer user control but I dont know how to do it.
在我的一种观点中,我想使用CrystalReportsViewer用户控件,但我不知道该怎么做。 First I try something like this (cr is allias for SAPBusinessObjects.WPF.Viewer)
首先,我尝试类似的事情(cr是SAPBusinessObjects.WPF.Viewer的同盟)
<Grid>
<cr:CrystalReportsViewer x:Name="Viewer" />
</Grid>
My View display Viewer, but how to bind this control to my ViewModel? 我的视图显示查看器,但是如何将此控件绑定到我的ViewModel? I want access to my viewer from my viewmodel to display report.
我想从我的视图模型访问查看器以显示报告。 I use property but that not working(and have no sense).
我使用属性,但是不起作用(也没有意义)。 So my next idea was using ContentControl
所以我的下一个想法是使用ContentControl
<Grid>
<ContentControl x:Name="Viewer" />
</Grid>
but now Caliburn search for ViewModel. 但是现在Caliburn搜索ViewModel。 I allways may use CodeBehind but I dont want.
我一直都可以使用CodeBehind,但我不想要。 Maybe someone who has experiance with caliburn.Micro and usercontrol can help.
也许有caliburn经验的人。Micro和用户控制可以提供帮助。
我使用Message cal:Message.Attach =“ [已加载事件] = [Action LoadReport($ this)]”,这就是我所需要的
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.