我需要将我的 WPFUSerControl
插入到Windows.Form
. 这是我的控制:
<UserControl x:Class="WpfControlLibrary1.UserControl1"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Background="Transparent">
<InkCanvas x:Name="Ink" Background="Transparent" />
</UserControl>
为了承载这个控件,我使用一个ElementHost
对象作为我的表单的唯一一个控件。我需要有可能做到以下几点:当我将表单的不透明度设置为0时,为了使其不可见,我需要继续将所有Children
和Strokes
我的不透明度设置InkCanvas
为1(这样我可以看到他们)。
我尝试使用该TransparencyKey
属性,但它似乎不适用于ElementHost
. 我该如何解决这个问题,如何在我的 Form 和我的 UserControl 之间设置不同的不透明度?