我是 C# 新手,但我不明白为什么我无法访问 MainWindow 类中的列表。
public partial class MainWindow : Window
{
public MainWindow()
{
InitializeComponent();
List<EqualisationSetting> equalisationSettings = new List<EqualisationSetting>
{
new EqualisationSetting { LowerFrequencyBound = 20, UpperFrequencyBound = 250, DecibelRatioChange = 0 },
new EqualisationSetting { LowerFrequencyBound = 250, UpperFrequencyBound = 4000, DecibelRatioChange = 0}
};
ItemsCountroller.ItemsSource = equalisationSettings;
}
private void AddFrequencyBoundButton_Click(object sender, RoutedEventArgs e)
{
equalisationSettings.add(new EqualisationSetting();
}
}
它抛出“当前上下文 SoundEditor 中不存在名称‘equalizationSettings’”。
慕容3067478
相关分类