Tag: windowsformshost

与WindowsFormsHost绑定

我正在尝试将项目列表绑定到TabControl。 这些项目看起来像: class SciEditor { private Scintilla editor = null; public System.Windows.Forms.Control Editor { get { return editor; } } private string path = null; public string ShortName { get { return null == path ? “New Script” : Path.GetFileNameWithoutExtension(path); } } …. 在我的主窗口中,List被称为“allScripts”。 这是XAML: 问题是我无法在WindowsFormsHost中设置“Child”,因为 无法在“WindowsFormsHost”类型的“Child”属性上设置“绑定”。 ‘绑定’只能在DependencyObject的DependencyProperty上设置。 如何设置WindowsFormsHost子项? 编辑:忘了提,在主窗口构造函数我有: tabControl1.ItemsSource = allScripts;

动画WindowsFormsHost

我需要为WindowsFormsHost控件设置动画。 问题是我看不到动画,窗口没有刷新。 如果我在动画期间调整WPF窗口的大小,则可以看到过渡。 我尝试将WindowsFormsHost放入网格中,然后为网格设置动画,但结果是相同的。 我把一些其他的东西放到网格中,以确保我正确地编写了动画。 这里有一些简单的应用程序来测试这个: 有什么方法可以解决这个问题吗?

无法绑定到属于C#/ XAML应用程序中的WindowsFormsHost子对象的属性的解决方法?

我有一个C#WPF 4.51应用程序。 据我所知,您不能绑定属于作为WPF WindowsFormsHost控件的子对象的属性。 (如果我在这个假设中错了,请告诉我该怎么做): 与WindowsFormsHost绑定 在我的例子中,我有一个包含WindowsFormsHost控件的页面,其Child对象是ScintillaNET编辑器控件: https://github.com/jacobslusser/ScintillaNET 子控件工作正常。 如果它是一个普通的WPF控件,我会将Scintilla编辑器控件的Text属性绑定到我的ViewModel中的某个字符串属性,这样我只需更新Scintilla编辑器控件的内容即可更新该字符串属性。 但由于我无法绑定属于WindowsFormsHost子对象的属性,我正在寻找一种不完全笨拙或笨拙的策略/解决方案。 有没有人以前遇到过这种情况,并且有一个合理的策略来解决我的绑定/更新问题?

找不到WindowsFormsHost错误IsRedirected?

我正在使用的WPF项目添加WINFORM图表 System.Windows.Forms.Integration.WindowsFormsHost 我正在尝试解决“空域”渲染问题,其中主机始终被渲染为窗口的最顶层元素。 我正在使用集合的解决方法 IsRedireced = “true” 当我将其插入到我的XMAL代码中时: 或者我的代码背后: System.Windows.Forms.Integration.WindowsFormsHost host = new System.Windows.Forms.Integration.WindowsFormsHost(); host.IsRedirected = “true”; 我收到以下错误: “The property ‘IsRedirected’ was not found in type ‘WindowsFormsHost’ 这是一个截图: 错误http://sofzh.miximages.com/c%23/2eal2k7.jpg 任何人都可以帮助解释为什么会这样吗? 我继续需要在我的WINFORM图表上显示一个元素! 谢谢 编辑: 代码取自MSDN网站: http : //msdn.microsoft.com/en-us/library/ms752027.aspx 来自MSDN:“默认情况下,可见的WindowsFormsHost元素总是在其他WPF元素之上绘制,并且它们不受z顺序影响。要启用z-ordering,请将WindowsFormsHost的IsRedirected属性设置为true,将CompositionMode属性设置为Full或OutputOnly。要查看默认的z顺序行为“ “将以下XAML复制到Grid元素中。” Press F5 to build and run the application. The WindowsFormsHost element is painted over the label […]