Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
ObservableCollectionにバインドされたItemsSourceを持つDataTemplateで定義されたWPFリストボックスがあります。コレクションに新しいアイテムが追加されるとき、ListBoxを「挿入モード」で機能させ、デフォルトの追加モードではなく、常にリストの先頭に追加します。コードで直接リストボックスに追加しない場合、リストボックスに挿入モードを使用させるにはどうすればよいですか?
Insertのメソッドを使用しObservableCollection、インデックス0を渡します。これによりコレクションの先頭に追加されます。
Insert
ObservableCollection