1
私が作業したMVVM Windows Phoneプロジェクトを再訪していますが、リストボックスにトリガーを追加する際に問題が発生しています。プロジェクトを7.1にアップグレードしました。次のようにListBoxに対してトリガーを設定すると例外が発生します
しかし <ListBox x:Name="MainListBox"
ItemsSource="{Binding MyItems}"
Grid.Row="1"
Margin="12"
ItemContainerStyle="{StaticResource MyListItemStyle1}"
SelectedIndex="{Binding CurrentSelectedIndex, Mode=TwoWay}"
ScrollViewer.HorizontalScrollBarVisibility="Disabled"
i:Interaction.Triggers="{StaticResource PerformSelectionChangedEventTrigger}" />
私は今、例外を受け付けております: - - :次のように私は、以前のコードを持っていた
設定できない読み取り専用のプロパティ「をSystem.Windows.Interactivity.Interaction.Triggersを
以下の変更を行うことは、問題を解決しているようだ: -
<ListBox x:Name="MainListBox"
ItemsSource="{Binding MyListItems}"
Grid.Row="1"
Margin="12"
ItemContainerStyle="{StaticResource MyListItemStyle1}"
SelectedIndex="{Binding CurrentSelectedIndex, Mode=TwoWay}"
ScrollViewer.HorizontalScrollBarVisibility="Disabled">
<i:Interaction.Triggers>
<i:EventTrigger EventName="SelectionChanged">
<cmdextras:EventToCommand Command="{Binding Path=PerformSelectionChanged}"
PassEventArgsToCommand="True" />
</i:EventTrigger>
</i:Interaction.Triggers>
</ListBox>
私は例外メッセージで検索しました「インライン」トリガーはワットに使用を設定する理由しかし、私はわかりませんよork、もう動作しません。
誰かがこれについていくつか光を当てることができるでしょうか?