0

I have two windows:

ListItemWindow

(parent) that contain ocItems as ObservableCollection

DetailItemWindow

I called DetailItemWindow from ListItemWindow (DetailItemWindow.ShowDialog())

From DetailItemWindow How can I access to ocItems ?

Abdulsalam Elsharif
  • 4,773
  • 7
  • 32
  • 66

1 Answers1

1

Why not pass parent Window in constructor to child Window? It doesn't violate MVVM at all, Views can know each other if they're dependant.

private ListItemWindow parent;

public DetailItemWindow(ListItemWindow window){
   this.parent = window;
}
mwilczynski
  • 3,062
  • 1
  • 17
  • 27