<p>I have a WPF app with many list based controls in a window, which all are bound to different CollectionViews.</p>

<p>At the window level is there a way to get the current selected item for the currently in focus list based control?  I know I can do this with some fairly trivial code by looking for the in focus element but does WPF support this as a concept out of the box?</p>

<p>Something like Window.CurrentSelectedDataItem would be great.  I am looking into using this as a way to centralize command management for enabling disabling commands based on a current selected data item.</p>

I don't think that there is a property like you specify, but as an alternative you could register a ClassHandler for the ListBox.SelectionChanged event in your Window class:
```
```
EventManager.RegisterClassHandler(typeof(ListBox), ListBox.SelectionChanged,
    new SelectionChangedEventHandler(this.OnListBoxSelectionChanged));
```
```
This will get called whenever the selection changes in any ListBox in your application. You can use the sender argument to determine which ListBox it was that changed its selection, and cache this value for when you need it.