リストボックスのItemSoureをCellectionViewSourceのViewプロパティにバインドするときに、SelectionChangedイベントが自動的にトリガーされる理由を誰かが知っていますか?どうすればこれを停止できますか?以下のコードに感謝します:
<ListBox ItemTemplate="{StaticResource ListboxDataTemplate}" x:Name="AllListBox" SelectedItem=" Binding Master.SelectedTask,Mode=TwoWay}" ItemsSource="{Binding Master.ViewSource.View}" />
//Code-behind
CollectionViewSource ViewSource = new CollectionViewSource();
ViewSource.Source = Tasks;
ViewSource.SortDescriptions.Add(new SortDescription("Model.t_state", ListSortDirection.Ascending));
ViewSource.SortDescriptions.Add(new SortDescription("Model.t_createtime", ListSortDirection.Descending));
ViewSource.SortDescriptions.Add(new SortDescription("Model.t_importance", ListSortDirection.Descending));
ViewSource.SortDescriptions.Add(new SortDescription("Model.t_nam", ListSortDirection.Ascending));