Quantcast
Channel: Windows Presentation Foundation (WPF) forum
Viewing all articles
Browse latest Browse all 18858

Is there a way to programmatically set the selected member of an Observable collection?

$
0
0

What is the syntax to set the 'current' member of an observable collection? I assume that there is such a thing since a ListBox/ComboBox/etc will set this.

For example, let's assume that we have

      public ObservableCollection<IPage> Pages = new ObservableCollection<IPage>();

and that this collection is populated with objects derived from IPage.

Further assume that at some point we want to programmatically set one of these member as the current one using an integer index. Is this possible and, if so, how?


Richard Lewis Haggard


Viewing all articles
Browse latest Browse all 18858

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>