private void TeacherRadioButton_OnChecked(object sender, RoutedEventArgs e) { TeacherOrStudentListViewGridView.Dispatcher.InvokeAsync(() => { TeacherOrStudentListViewGridView.Columns.FirstOrDefault().DisplayMemberBinding = new Binding("TeacherName"); TeacherOrStudentListViewGridView.Columns.FirstOrDefault().Header = "TeacherName"; TeacherOrStudentListView.ItemsSource = _server.GetTeacherInGroup(((Group)(GroupListView.SelectedItem)).GroupName).Where(w => w.Groups.Count > 0).ToList(); }); TeacherBorder.Dispatcher.InvokeAsync(() => { TeacherBorder.Background = (Brush) new BrushConverter().ConvertFrom("#D46A00"); }); StudentBorder.Dispatcher.InvokeAsync(() => { StudentBorder.Background = (Brush) new BrushConverter().ConvertFrom("#FFFFCA82"); }); }