WPF의 시작점은 어떻게 될까요?시작 지점 Winforms to WPF
[STAThread]
static void Main()
{
ClientClass remService = new ClientClass();
ObjRef obj = RemotingServices.Marshal(remService,"TcpClient");
// Create apllications MainForm
ClientApp frmMain = new ClientApp();
// provide marshaled object with reference to Application
remService.theMainClient = (IClientApp) frmMain;
System.Console.WriteLine("Please press ENTER to exit...");
System.Console.ReadLine();
// Application closed...
Application.Run(frmMain);
RemotingServices.Unmarshal(obj);
RemotingServices.Disconnect(remService);
}
winforms 마샬링이 올바르게 작동하면 변환하고 WPF를 사용하고 싶습니다.
[System.STAThreadAttribute()]
[System.Diagnostics.DebuggerNonUserCodeAttribute()]
static void Main()
{
OperClass remService = new OperClass();
ObjRef obj = RemotingServices.Marshal(remService, "TcpClient");
// Create apllications MainForm
MainWindow frmMain = new MainWindow();
App app = new App();
// provide marshaled object with reference to Application
remService.TheMainOper = (IOperApp)frmMain;
Console.WriteLine("Please press ENTER to exit...");
Console.ReadLine();
// Application closed...
app.InitializeComponent();
app.Run();
RemotingServices.Unmarshal(obj);
RemotingServices.Disconnect(remService);
}
나는 그렇게했지만, 프로그램 작업이 완전히 올바르지 않기 때문에 나는 옳은 것이 확실하지 않다.
pastebin.com/u/Jinfaa CODE http://screencast-o-matic.com/watch/clniI54tY 동영상
코드를 직접 작성 했습니까? 아니면 변환기를 사용 했습니까? 당신이 변환기를 사용한 것 같습니다. 나는 그것을 반대하는 것이 좋습니다. – Zenexer
나 자신을 썼다. – Feor
그런 경우 DebuggerNonUserCode 속성을 제거해야합니다. – Zenexer