0
이 클래스에서 작동하도록 할당 할 수있는 클래스 변수의 생성자를 나타냅니다. 이 클래스에서 어떻게 만들 수 있습니까? 생성자에서 할당 할 수는 없지만 다른 방법으로 할당 할 수 있습니까?클래스 메서드 내에서 creating-ref-arguments를 변경하는 방법은 무엇입니까?
만들기 클래스 :
CreatePackWindow createPackWindow = new CreatePackWindow(ref title, ref description);
if (createPackWindow.ShowDialog() == true)
{
Console.WiteLine(title, description);
}
클래스 CreatePackWindow :
public partial class CreatePackWindow : Window
{
public CreatePackWindow(ref string title, ref string description)
{
InitializeComponent();
}
private void btnCreate_Click(object sender, RoutedEventArgs e)
{
???title = tbPackName.Text; **// How to assign here?**
???description = tbDescription.Text; **// How to assign here?**
this.DialogResult = true;
Close();
}
//..........
}
당신이 그들과 함께 작업 할 제목 및 설명 및 방법에 대한 포인터를 만들 필요가 있음을 이해하지만, 할 그것을하는 방법을 모른다 : (
도와주세요. 감사합니다.