There is:
StudentsList (ObservableCollection); GroupsList - ObservableCollection.
ComboBox (group selection); ListView (student selection)
After selecting a group, you must leave only the students of a particular group in ListView.
Should I have another ObservableCollection in the MainViewModel, which will consist of specific StudentList elements? (however, for some reason ListView is not updated) Or are there more rational ways?
Also in the ComboBox, next to the elements of the Group class, you must first put the field "All groups", how to do it ?? At the moment, ComboBox looks like this (it is not necessary to look):
<ComboBox ItemsSource="{Binding GroupsList}" SelectedItem="{Binding SelectedGroup, UpdateSourceTrigger=PropertyChanged}" Margin="20,0,20,20" SelectedIndex="0"> <ComboBox.ItemTemplate> <DataTemplate> <TextBlock Text="{Binding GroupNum}"/> </DataTemplate> </ComboBox.ItemTemplate> </ComboBox> Listview
<ListView Name="StudentsView" ItemsSource="{Binding StudentsList}" SelectedItem="{Binding SelectedStudent, UpdateSourceTrigger=PropertyChanged}" Grid.Column="0" Grid.Row="1" Margin="20,0,0,0"> <ListView.ItemContainerStyle> <Style TargetType="ListViewItem"> <Setter Property="HorizontalContentAlignment" Value="Stretch"/> <Setter Property="VerticalContentAlignment" Value="Stretch"/> </Style> </ListView.ItemContainerStyle> <ListView.ItemTemplate> <DataTemplate> <Border Padding="10"> <Border.InputBindings> <MouseBinding Gesture="LeftDoubleClick" Command="{Binding DataContext.AddStudent, RelativeSource={RelativeSource FindAncestor, AncestorType=Window}}" CommandParameter="{Binding}"/> </Border.InputBindings> <StackPanel> <TextBlock Text="{Binding DisplayName}" FontWeight="Bold"/> <StackPanel Orientation="Horizontal"> <TextBlock Text="{Binding GetGroupNum}" Margin="10,0"/> </StackPanel> </StackPanel> </Border> </DataTemplate> </ListView.ItemTemplate> </ListView> Selectedgroup
public Group SelectedGroup { get { return selectedGroup; } set { selectedGroup = value; OnPropertyChanged("SelectedGroup"); FullListStudents = StudentsList; StudentsList = new ObservableCollection<Student>(FullListStudents.Where( (x) => x.CurrentGroup == selectedGroup)); SelectedStudent = StudentsList.FirstOrDefault(); } } I don’t ask you to write specific implementations, just to prompt ideologically.

Стоит ли в MainViewModel заводить еще одну ObservableCollection, которая будет состоять из конкретных элементов StudentList?- as an option, just needOnPropertyChangednot to forget for it to call for the UI to know that it is time to update - Andrey NOP