私のアプリケーションは WPF を使用していDataGrid
ます。列の 1 つは、行をフィードするエンティティのへのComboBox
バインドを含むテンプレート列です。ObservableCollection
に値を追加するとObservableCollection
、 aNullReferenceException
がスローされます。
なぜこれが起こるのか誰にも分かりますか?例外のスタック トレースは次のとおりです。
MS.Internal.Data.PropertyPathWorker.DetermineWhetherDBNullIsValid() で MS.Internal.Data.PropertyPathWorker.get_IsDBNullValidForUpdate() で MS.Internal.Data.ClrBindingWorker.get_IsDBNullValidForUpdate() で System.Windows.Data.BindingExpression.ConvertProposedValue (オブジェクト値) で System.Windows.Data.BindingExpressionBase.UpdateValue() で System.Windows.Data.BindingExpression.Update (ブール値の同期) で System.Windows.Data.BindingExpressionBase.Dirty() で System.Windows.Data.BindingExpression.SetValue (DependencyObject d、DependencyProperty dp、オブジェクト値) で System.Windows.DependencyObject.SetValueCommon (DependencyProperty dp、オブジェクト値、PropertyMetadata メタデータ、ブール値 coerceWithDeferredReference、OperationType operationType、ブール値 isInternal) で System.Windows.DependencyObject.SetValue (DependencyProperty dp、オブジェクト値) で System.Windows.Controls.Primitives.Selector.UpdatePublicSelectionProperties() で System.Windows.Controls.Primitives.Selector.SelectionChanger.End() で System.Windows.Controls.Primitives.Selector.OnItemsChanged (NotifyCollectionChangedEventArgs e) で System.Windows.Controls.ItemsControl.OnItemCollectionChanged (オブジェクトの送信者、NotifyCollectionChangedEventArgs e) で System.Collections.Specialized.NotifyCollectionChangedEventHandler.Invoke (オブジェクトの送信者、NotifyCollectionChangedEventArgs e) で System.Windows.Data.CollectionView.OnCollectionChanged (NotifyCollectionChangedEventArgs args) で System.Windows.Controls.ItemCollection.System.Windows.IWeakEventListener.ReceiveWeakEvent (managerType の種類、オブジェクトの送信者、EventArgs e) で System.Windows.WeakEventManager.DeliverEventToList (オブジェクトの送信者、EventArgs 引数、ListenerList リスト) で System.Windows.WeakEventManager.DeliverEvent (オブジェクトの送信者、EventArgs 引数) で System.Collections.Specialized.CollectionChangedEventManager.OnCollectionChanged (オブジェクトの送信者、NotifyCollectionChangedEventArgs 引数) で System.Windows.Data.CollectionView.OnCollectionChanged (NotifyCollectionChangedEventArgs args) で System.Windows.Data.ListCollectionView.ProcessCollectionChangedWithAdjustedIndex で (NotifyCollectionChangedEventArgs 引数、Int32 調整されたOldIndex、Int32 調整されたNewIndex) System.Windows.Data.ListCollectionView.ProcessCollectionChanged (NotifyCollectionChangedEventArgs args) で System.Windows.Data.CollectionView.OnCollectionChanged (オブジェクトの送信者、NotifyCollectionChangedEventArgs args) で System.Collections.ObjectModel.ObservableCollection`1.OnCollectionChanged (NotifyCollectionChangedEventArgs e) で System.Collections.ObjectModel.ObservableCollection`1.InsertItem (Int32 インデックス、T アイテム) で System.Collections.ObjectModel.Collection`1.Add(T item) で C:\Project\Phoenix\Development\src\ORF.PersonBook.IdentityModule\Model\SubsidiaryModel.cs:line 127 の ORF.PersonBook.IdentityModule.Model.SubsidiaryModel.AddRoom(RoomModel room) で