örn. Böyle olmayan bir şey (ref it) ... E.g. Bu başarısız:Geçerli örneğin başvurusu nasıl yapılır: C#
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace CopyOfThis
{
class Program
{
static void Main(string[] args)
{
View objView = new View();
objView.Boo();
objView.ShowMsg("The objView.StrVal is " + objView.StrVal);
Console.Read();
}
} //eof Program
class View
{
private string strVal;
public string StrVal
{
get { return strVal; }
set { strVal = value; }
}
public void Boo()
{
Controller objController = new Controller(ref this);
}
public void ShowMsg (string msg)
{
Console.WriteLine(msg);
}
} //eof class
class Controller
{
View View { get; set; }
public Controller(View objView)
{
this.View = objView;
this.LoadData();
}
public void LoadData()
{
this.View.StrVal = "newData";
this.View.ShowMsg("the loaded data is" + this.View.StrVal);
}
} //eof class
class Model
{
} //eof class
} //eof namespace
Biraz daha bilgi verebilir misiniz? Uygulamanız için ihtiyacınız olan şeylerin bir örneği, birisinin buna cevap vermesini kolaylaştırabilir. –