6
我可以让Kaxaml使用CLR名称空间加载外部程序集,但这很痛苦,因为需要大量映射来定位程序集中的所有不同名称空间,而自定义组件上的XmlnsDefinition将允许一个人逃脱只有一个或几个。使用自定义XML名称空间引用Kaxaml中的外部DLL
当寻找一个解决方案,我明显看出this question但似乎只覆盖使用CLR的命名空间作为一切答案似乎为自定义命名空间的工作(“无法设置未知成员......”)。
例子:
<Page
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity"
xmlns:is="http://schemas.microsoft.com/expression/2010/interactions">
<!-- ... -->
<Button Content="Test">
<i:Interaction.Triggers>
<i:EventTrigger EventName="Click">
<is:ChangePropertyAction PropertyName="IsOpen"
TargetName="popup"
Value="True" />
</i:EventTrigger>
</i:Interaction.Triggers>
</Button>
这是行不通的,但是如果你使用的CLR它:
<Page
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:i="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity"
xmlns:is="clr-namespace:Microsoft.Expression.Interactions;assembly=Microsoft.Expression.Interactions"
xmlns:isc="clr-namespace:Microsoft.Expression.Interactivity.Core;assembly=Microsoft.Expression.Interactions">
<!-- ... -->
<Button Content="Test">
<i:Interaction.Triggers>
<i:EventTrigger EventName="Click">
<isc:ChangePropertyAction PropertyName="IsOpen"
TargetName="popup"
Value="True" />
</i:EventTrigger>
</i:Interaction.Triggers>
</Button>
的is
命名空间不在这里使用,我不得不添加的子命名空间交互程序集。
如果可以使第一种方法起作用,那将是理想的。