2
뷰 모델에서 내 뷰의 Page_Loaded 이벤트 (PhoneApplicationPage
)를 처리하려고합니다. 이것은 다음에 의해 달성 될하는 데 사용 :WP7.1에서 뷰 모델의 메서드에로드 된 이벤트를 바인딩하는 방법
<i:Interaction.Triggers>
<i:EventTrigger EventName="Loaded">
<Command:EventToCommand Command="{Binding LoadedCommand}" />
</i:EventTrigger>
</i:Interaction.Triggers>
이 방법 MVVM 빛 EventToCommand
를 사용합니다.
그러나 그의 접근 방식은 더 이상 작동하지 않고 다음과 같은 오류 제공 : WP7.1에서
A value of type 'EventToCommand' cannot be added to a collection or dictionary of type 'TriggerActionCollection'.
, 뷰 모델의 방법으로 뷰의 이벤트를 결합 할 수있는 올바른 MVVM의 방법은 무엇입니까?
네, 잘 작동합니다. 감사! –
도와 줘서 기쁩니다;) –