0

リストボックスの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));
4

1 に答える 1

0

コードビハインドの任意の時点で SelectedItem または SelectedIndex を変更していますか?

于 2012-08-03T03:06:58.947 に答える