Exemplo n.º 1
0
        private void NewWpfWindow_Click(object sender, EventArgs e)
        {
            var page = new CustomTabPage();
            tabControl1.Controls.Add(page);
            tabControl1.SelectedTab = page;
            IWindowCallback myCallbacks = new WindowCallback(page);

            DuplexChannelFactory<IXamlService> pipeFactory =
               new DuplexChannelFactory<IXamlService>(
                  myCallbacks,
                  new NetNamedPipeBinding(),
                  new EndpointAddress(
                     "net.pipe://localhost/XamlShow"));

            IXamlService pipeProxy = pipeFactory.CreateChannel();

            pipeProxy.ShowChild(page.Handle.ToInt32());
        }
Exemplo n.º 2
0
 public WindowCallback(Control control)
 {
     _control = control as CustomTabPage;
 }