private void Button_Click(object sender, RoutedEventArgs e) { logic log = new logic(); if (listBox.SelectedItem is Information _info) { TB_Answer.Text = log.Decision(_info.Index, TB_Variable.Text); } }