【发布时间】:2013-12-04 02:55:39
【问题描述】:
伙计们,我正在将一些参数传递给 WPF 应用程序的新窗口,如下所示
List<string[]> liststat = conf.getlistbytype(type);
if ((liststat == null) || (liststat.Count == 0))
{
MessageBox.Show("There is no stat of that type in this stat server");
}
else
{
CalculatedStat3 prompt = new CalculatedStat3(statwin, conf, liststat, this);
prompt.Show();
但是目标页面的构造器是as
public CalculatedStat3(statwindow statwin, ConfigLayer conf, string[] statsname, CalculatedStat2 backscreen)
{
}
当我遇到错误时,我应该怎么做才能纠正这个问题
'RCCV_Version_2.CalculatedStat3.CalculatedStat3(RCCV_Version_2.statwindow, rmad_wpf_lib.ConfigLayer, string[], RCCV_Version_2.CalculatedStat2)' has some invalid arguments
【问题讨论】:
-
List
和string[]有很大区别。您需要一个处理列表下所有不同字符串 [] 的 foreach 循环。
标签: c# wpf methods parameter-passing