1 回答

TA貢獻(xiàn)1773條經(jīng)驗(yàn) 獲得超3個(gè)贊
這是因?yàn)槟淖兞课挥?MainWindow() 方法內(nèi)部。嘗試這個(gè):
public partial class MainWindow : Window
{
List<EqualisationSetting> equalisationSettings;
public MainWindow()
{
InitializeComponent();
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();
}
}
- 1 回答
- 0 關(guān)注
- 123 瀏覽
添加回答
舉報(bào)