Consider the code below,
private void Convert_Click(Object sender, RoutedEventArgs e)
{
string[] strCmdLineParams = { "str1", "str2", "str3" };
FormatterUI format = new FormatterUI();
format.CmdLineParams = strCmdLineParams;
format.ExecuteRequest();
}
public class FormatterUI
{
string[] args;
public string CmdLineParams
{
set
{
args=value;
}
}
public void ExecuteRequest()
{
//something
}
}
I want to pass the strings present in strCmdLineParams to ExecuteRequest method as property. But the above code is an error. How can I do this? Please help.