Answer the question
In order to leave comments, you need to log in
How to change Listbox from another script?
WPF/XAML
Project The project has two windows: MainWindow (main window) with Listbox1 and NewWindow (window for adding values).
It is necessary that when the button in NewWindow is clicked, the Listbox in MainWindow changes.
A change is a method call with the ListBox1 argument. The problem is how to pass this argument there.
NewWindow window code
// Нажатие на кнопку.
// Этот метод работает в MainWindow т.к. Listbox1 находится там.
// Этот метод не работает в NewWindow т.к. Listbox1 не находится там. Как "достучаться" до Listbox1 из другого скрипта?
classes.WindowActions.ReloadProgramList(ListBox1);
this.Close();
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question