0
내 DataGrid에서 ListViewCollection 클래스를 사용하고 있습니다. 기본 컬렉션은 관찰 가능한 컬렉션입니다.ListViewCollection 이동 * 메서드가 없습니다. 변경된 이벤트
ViewModel에있는 컬렉션에서 Move 메서드를 호출 할 때마다 CurrentChanged 이벤트가 실행되지 않습니다.
그러나 UI에서 동일한 메소드를 호출하면 (호출 스택에서 볼 수 있음) 이벤트가 실행됩니다.
this.EmailTemplates = new ListCollectionView(templateVmList);
this.EmailTemplates.CurrentChanging += (o, e) => EmailTemplates_CurrentChanging(o, e);
this.EmailTemplates.CurrentChanged += (o, e) => { this.SelectedEmailTemplate = (EmailTemplateViewModel)this.EmailTemplates.CurrentItem; };
if (this.EmailTemplates.Count > 0)
{
if (!this.EmailTemplates.MoveCurrentToFirst())
throw new ArgumentException("Element not found in collection");
}
누구가 컬렉션을 변경하더라도 이벤트가 실행되도록하려면 코드에서 어떻게해야합니까?