Is it Possible to Set the ItemsSource of a Control in a Different Class From A Static Method?
I have an addin (class 1) that allows you to view and filter table records. Below the filters is a ListView control that displays saved queries and a button to open a window that manages those queries. In the window (class 2) you can add, edit, and delete queries. After the user saves changes, I would like to update the ListView control in class 1 from class 2. If possible I would like to use the following syntax:
//Class 1 Static Method:
public static void SetListViewItemsSource(ObservableCollection<Query> queries)
this.listViewControl.ItemsSource = queries;
// To Change ItemsSource From Class2:
I know this approach is not possible because you cannot use the "this" keyword in a static method. Is there an alternative, WITHOUT having to create and instance of Class1??