CLR 名前空間を使用して Kaxaml に外部アセンブリをロードさせることはできますが、アセンブリのカスタム XmlnsDefinition では 1 つだけで済むのに対し、アセンブリ内のすべての異なる名前空間をターゲットにするために多くのマッピングが必要になるため、これは面倒です。またはいくつか。
解決策を探しているとき、私は明らかにこの質問を見つけましたが、カスタム名前空間ではどの回答も機能しないように見えたため、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
空間はここでは使用されていないため、相互作用アセンブリのサブ名前空間を追加する必要がありました。
最初の方法を機能させることができれば理想的です。