Hallo Zusammen
Ich verwalte in meinem Programm die Daten anhand von ObservableCollections und zum Speichern die IsolatedStorageSettings. Nun möchte ich beim aufrufen einer Site nur gewisse Objekte aus der Collection anzeigen. Dies wollte ich so lösen dass ich eine zweite Collection vom selben Typ mache und dann die Objekts einfach dort hinzufüge. Leider kommt immer beim hinzufügen eines Objekts immer eine "nullreferenceException".
Syntax etc scheint zu stimmen laut Visual Studio.
Temporäre Collection erstellen. Die permanente sieht genau gleich aus, halt einfach mit anderen Variabelnnamen.
Hinzufügen habe ich über folgendes lösen wollen:Code:
[FONT=Consolas][FONT=Consolas][FONT=Consolas]private[/FONT][/FONT][/FONT][FONT=Consolas][FONT=Consolas][FONT=Consolas]ObservableCollection[/FONT][/FONT][/FONT][FONT=Consolas][FONT=Consolas]<[/FONT][/FONT][FONT=Consolas][FONT=Consolas][FONT=Consolas]KategorieVM[/FONT][/FONT][/FONT][FONT=Consolas][FONT=Consolas]> _katAuswahl;[/FONT][/FONT]
[FONT=Consolas][FONT=Consolas][FONT=Consolas]private[/FONT][/FONT][/FONT][FONT=Consolas][FONT=Consolas][FONT=Consolas]ObservableCollection[/FONT][/FONT][/FONT][FONT=Consolas][FONT=Consolas]<[/FONT][/FONT][FONT=Consolas][FONT=Consolas][FONT=Consolas]KategorieVM[/FONT][/FONT][/FONT][FONT=Consolas][FONT=Consolas]> KatAuswahl[/FONT][/FONT]
[FONT=Consolas][FONT=Consolas]{[/FONT][/FONT]
[FONT=Consolas][FONT=Consolas][FONT=Consolas] get[/FONT][/FONT][/FONT][FONT=Consolas][FONT=Consolas] { [/FONT][/FONT][FONT=Consolas][FONT=Consolas][FONT=Consolas]return[/FONT][/FONT][/FONT][FONT=Consolas][FONT=Consolas] _katAuswahl; }[/FONT][/FONT]
[FONT=Consolas][FONT=Consolas][FONT=Consolas] set[/FONT][/FONT][/FONT][FONT=Consolas][FONT=Consolas]{[/FONT][/FONT]
[FONT=Consolas] [FONT=Consolas] _katAuswahl =value[FONT=Consolas][FONT=Consolas];[/FONT][/FONT][/FONT][/FONT]
[FONT=Consolas][FONT=Consolas] }[/FONT][/FONT]
[FONT=Consolas][FONT=Consolas] }[/FONT][/FONT]
Hat jemand irgend ein Hinweis für mich wie ich das hinkriegen könnte? Stehe gerade ziemlich auf dem Schlauch..Code:katAuswahl.Add()
Danke und Gruss
Nemoc