예제 #1
0
        public void EmbedWin_InWin_Works()
        {
            var winFormsUserControl = new WinFormsUserControl();
            var manager = new EmbeddingManager<Control, Control>(winFormsUserControl, control => control);

            var winFormsWindow = new WinFormsWindow(manager);
            winFormsWindow.ShowWindow();
        }
예제 #2
0
        public void EmbedWin_InWinWithExtraClass_Works()
        {
            var winFormsUserControl = new WinFormsUserControl();
            var manager = new WinInWinEmbeddingManager(winFormsUserControl, control => control);

            var winFormsWindow = new WinFormsWindow(manager);
            winFormsWindow.ShowWindow();
        }
예제 #3
0
        public void EmbedWpf_InWin_Works()
        {
            var wpfUserControl = new WpfUserControl();
            var manager = new EmbeddingManager<Control, UIElement>(
                wpfUserControl, uiElement => new ElementHost {Child = uiElement});

            var winFormsWindow = new WinFormsWindow(manager);
            winFormsWindow.ShowWindow();

            //http://sunshaking.blogspot.com/2008/10/tricks-for-writing-unit-tests-for-wpf.html
            Dispatcher.CurrentDispatcher.InvokeShutdown();
        }